Skip to content

Keycloak Breeze integration - #43240

Merged
o-nikolas merged 5 commits into
apache:mainfrom
aws-mwaa:onikolas/keycloak_integration
Oct 30, 2024
Merged

Keycloak Breeze integration#43240
o-nikolas merged 5 commits into
apache:mainfrom
aws-mwaa:onikolas/keycloak_integration

Conversation

@o-nikolas

Copy link
Copy Markdown
Contributor

Work is starting on multi-team Airflow, and this project has many dependencies on a auth manager that can support authn and authz and also support the changes to the auth manager api (upcoming). An option for this is Keycloak.

This PR adds a Breeze integartion for Keycloak which creates a container running keycloak, which uses the existing Postgres container as the DB and disables the requirements for ssl/https/certificates to use the Keycloak admin console (since this is only for development purposes not production).


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@o-nikolas
o-nikolas force-pushed the onikolas/keycloak_integration branch from 8210b61 to 23fb30c Compare October 22, 2024 18:27
@o-nikolas

Copy link
Copy Markdown
Contributor Author

@potiuk Let me know what you think of this, before I take it out of Draft.

Comment thread scripts/ci/docker-compose/integration-keycloak.yml
@potiuk

potiuk commented Oct 24, 2024

Copy link
Copy Markdown
Member

This looks great. I only have one comment about using same "postgres" service for keycloack and metadata-db. Those two should be separate postgres instances IMHO.

@potiuk

potiuk commented Oct 24, 2024

Copy link
Copy Markdown
Member

Also it does not yet work when I try to run it due to "keyclok" typo in constants :)

@o-nikolas

Copy link
Copy Markdown
Contributor Author

Also it does not yet work when I try to run it due to "keyclok" typo in constants :)

Ugh, let me fix 😅

@o-nikolas
o-nikolas force-pushed the onikolas/keycloak_integration branch from c6bd1fe to b84f881 Compare October 28, 2024 17:06
Work is starting on multi-team Airflow, and this project has many
dependencies on a auth manager that can support authn and authz and also
support the changes to the auth manager api (upcoming). An option for
this is Keycloak.

This PR adds a Breeze integartion for Keycloak which creates a container
running keycloak, which uses the existing Postgres container as the DB
and disables the requirements for ssl/https/certificates to use the
Keycloak admin console (since this is only for development purposes not
production).
@o-nikolas
o-nikolas force-pushed the onikolas/keycloak_integration branch from 4256cdb to fa8fbc8 Compare October 29, 2024 15:11
@o-nikolas
o-nikolas marked this pull request as ready for review October 29, 2024 20:55
@o-nikolas

Copy link
Copy Markdown
Contributor Author

@potiuk

This one is ready for review as well. Fixed the typo and added a check to ensure the keycloak integration is used in conjunction with the postgres backend.

Comment thread dev/breeze/src/airflow_breeze/global_constants.py Outdated

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Small NIT with suggestion.

@potiuk

potiuk commented Oct 29, 2024

Copy link
Copy Markdown
Member

Maybe also we should extract all other backend constants for consistency @o-nikolas ? It looks weird when only one POSTGRES is constant.

Comment thread dev/breeze/src/airflow_breeze/global_constants.py Outdated
Comment thread scripts/ci/docker-compose/integration-keycloak.yml Outdated
Comment thread scripts/ci/docker-compose/integration-keycloak.yml Outdated
Comment thread scripts/ci/docker-compose/keycloak/keycloak-entrypoint.sh Outdated
@o-nikolas

Copy link
Copy Markdown
Contributor Author

Maybe also we should extract all other backend constants for consistency @o-nikolas ? It looks weird when only one POSTGRES is constant.

Fair enough, I didn't extract them because they'd only be used in place there, not imported elsewhere which also feel strange. But I don't feel strongly about one approach more than the other, so I can make the change to extract constants for all 👍

@ferruzzi ferruzzi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@o-nikolas
o-nikolas merged commit a2cbaec into apache:main Oct 30, 2024
@o-nikolas
o-nikolas deleted the onikolas/keycloak_integration branch October 30, 2024 22:00
ellisms pushed a commit to ellisms/airflow that referenced this pull request Nov 13, 2024
* Keycloak Breeze integration

Work is starting on multi-team Airflow, and this project has many
dependencies on a auth manager that can support authn and authz and also
support the changes to the auth manager api (upcoming). An option for
this is Keycloak.

This PR adds a Breeze integartion for Keycloak which creates a container
running keycloak, which uses the existing Postgres container as the DB
and disables the requirements for ssl/https/certificates to use the
Keycloak admin console (since this is only for development purposes not
production).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants