Skip to content

Conversation

@vincbeck
Copy link
Contributor

@vincbeck vincbeck commented Nov 6, 2023

This PR introduces the AWS auth manager. The target is to create an auth manager using AWS services: AWS Identity center and Amazon Verified Permissions. This PR handles the login and logout mechanism. Other features such as authorization will come in a separate PR. The auth manager wont be usable as such because of missing feature but since it is not documented anywhere, it should not be used by users.


^ 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.

Copy link
Contributor Author

@vincbeck vincbeck Nov 6, 2023

Choose a reason for hiding this comment

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

For now, returns whether the user is logged-in. The actual authorization will be implemented in a separate PR. This is true for all the authorization APIs

@vincbeck vincbeck added the AIP-56 Extensible user management label Nov 6, 2023
@vincbeck vincbeck changed the title Implement log in and log out in AWS auth manager Implement login and logout in AWS auth manager Nov 6, 2023
@vincbeck vincbeck force-pushed the vincbeck/aws_auth_manager branch 2 times, most recently from 74e587b to 17d1cea Compare November 7, 2023 16:59
@vincbeck vincbeck force-pushed the vincbeck/aws_auth_manager branch from 17d1cea to fab6e97 Compare November 7, 2023 18:18
@vincbeck vincbeck force-pushed the vincbeck/aws_auth_manager branch from dd1caa9 to 8f5aaf1 Compare November 10, 2023 21:11
Copy link
Contributor

@o-nikolas o-nikolas left a comment

Choose a reason for hiding this comment

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

Builds are still going, but other than that, the changes look good to me


return redirect(saml_auth.logout())

@csrf.exempt
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick, maybe this is obvious to someone with a better background in auth backends, but I have no clue what CSRF is without looking it up, or why this method should be exempt. A comment might be helpful here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just added a very simple comment. I only know I need to disable CSRF otherwise Identity center redirection wont work :)

Copy link
Contributor

@ferruzzi ferruzzi left a comment

Choose a reason for hiding this comment

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

Left a couple nitpicks and a clarification question, but nothing blocking. LGTM (pending the CI going green.. tests are currently in progress)

@vincbeck vincbeck merged commit 379b7c0 into apache:main Nov 21, 2023
@vincbeck vincbeck deleted the vincbeck/aws_auth_manager branch November 21, 2023 17:35
if not user:
self.log.error("Calling 'get_user_name()' but the user is not signed in.")
raise AirflowException("The user must be signed in.")
return user.get_name()
Copy link
Contributor

Choose a reason for hiding this comment

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

@vincbeck This looks like a breaking change since get_name() method was just defined in the BaseUser class. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No because the auth manager interface is not public interface YET. It will become in the near future but work in auth manager is still in progress. It is not documented anywhere how to build an auth manager or even how to use it so I assume nobody uses it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AIP-56 Extensible user management area:dev-tools area:production-image Production image improvements and fixes area:providers area:webserver Webserver related Issues changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) kind:documentation provider:amazon AWS/Amazon - related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants