Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ACL for both user and service checks #261

Merged
merged 2 commits into from
Feb 12, 2020
Merged

Conversation

ryan-lane
Copy link
Contributor

This change removes the special-cased code for controlling authz for services, and moves everything to using ACL checks. I've added a new default ACL function default_acl, which replicates the default behavior of service authz, while making it possible to fully apply ACL checks against services or users for all resources.

resource_type='service',
action=action,
resource_id=id,
logged_in_user = authnz.get_logged_in_user()
Copy link
Member

Choose a reason for hiding this comment

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

having trouble seeing it at moment, but if it's a service, will this return the service name?

Copy link
Member

Choose a reason for hiding this comment

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

nevermind, i think i see it, it will return the service/role name

https://github.com/lyft/confidant/blob/master/confidant/authnz/__init__.py#L191

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep! We set g.username whether it's user or service auth.

@ryan-lane ryan-lane merged commit e00dd23 into master Feb 12, 2020
@ryan-lane ryan-lane deleted the service-auth-acl-refactor branch February 12, 2020 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants