This repository has been archived by the owner on Nov 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 199
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fix preauthorized application
- add timeout to access rule cache - update python version in deployment - update unit tests
fix type in static group memebership
fix group membership check logic
make the group membership query transitive
api_access_rules is now a dictionary add environment variable to disable cache
chkeita
commented
Nov 17, 2021
chkeita
commented
Nov 18, 2021
stishkin
reviewed
Nov 18, 2021
stishkin
reviewed
Nov 19, 2021
stishkin
reviewed
Nov 19, 2021
stishkin
reviewed
Nov 19, 2021
stishkin
approved these changes
Nov 19, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR enables the restriction of certain api to some user based on their principalid or their group membership
Api Restriction rules
We provide the ability to create a set of rules that specify which group has access to an api
The set of rules is a list of
RuleDefinition
defined set in the propertyapi_access_rules
of the Instance configurationWe store and manage in the
RequestAccess
class defined in #1420Rules enforcement
Those rules are enforced when the request is received by the service.
A call to
check_access
determine if the request is authorized or not.Group membership information retrieval
The group membership is retrieved from azure call to msgraph in the
AzureADGroupMembership
classThis call requires specific permissions which depending on the environmentt can only be granted by an admin.
We also provide for testing purposes a
StaticGroupMembership
class to provide the access restriction functionality without querying azure.The class is initialized with the group membership information stored in the Instance configuration in the field
group_membership
Testing
A functional test is provided in
api_restriction_test.py