-
Notifications
You must be signed in to change notification settings - Fork 3
Auth scope changes #61
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
Open
RaggedStaff
wants to merge
7
commits into
master
Choose a base branch
from
authScopeChanges
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+101
−10
Open
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
67c957c
Added Authorization Strategy Entry
RaggedStaff 29fc8fc
Initial Authorization Strategy, covering scopes & linking out to Data…
RaggedStaff 24324b6
Incorpated review feedback.
RaggedStaff e6e8562
Incorporated @simonLouvet 's requested changes.
RaggedStaff edf18c1
Merge branch 'master' into authScopeChanges
lecoqlibre 4d8b5eb
Rewrite authentication strategy
lecoqlibre b3087f0
Mention decentralized authn systems, add details
lecoqlibre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Authorization Strategy | ||
|
|
||
| To manage authorization of requests across the DFC standard, it is necessary to apply authorization scopes to each request. These scopes determine whether an authenticated request can access certain data from DFC endpoints. | ||
|
|
||
|
lecoqlibre marked this conversation as resolved.
|
||
| ## Scope based authorization | ||
|
|
||
| We propose a scope-based approach to authorization. Based on OAuth2 authorization logic, these form part of the OpenID Connect protocol already adopted for Authentication. These scopes further restrict access to specific operations on certain endpoints within the DFC standard. | ||
|
|
||
| Scopes are managed by the OpenID Provider (DFC implmentations often use Keycloak) as client scopes. | ||
|
|
||
| Scopes are formed of an action & a subject: | ||
|
|
||
| ### Actions | ||
|
|
||
| Actions define the permitted operations a request can perform, these are: | ||
| 1. **Read** - authorised to HEAD + GET | ||
| 2. **Write** - authorised to POST + PUT + PATCH (if supported) | ||
| 3. **Delete** - authorised to DELETE | ||
|
|
||
| ### Subjects | ||
|
|
||
| Subjects define which endpoints authorization is granted to. Subjects are: | ||
|
|
||
| | **Subject** | **Endpoints accessible with subject** | | ||
| | --- | --- | | ||
| | Enterprise | Enterprise, Address, SocialMedia, PhoneNumber, CustomerCategory, Coordination, Place | | ||
| | Product | TechnicalProduct, LocalizedProduct, SuppliedProduct, Catalog, CatalogItem, Offer, Price, Transformation, ConsumptionFlow, ProductionFlow | | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Split Price/Offer |
||
| | Order | Order, OrderLine, SaleSession, FulfilmentStatus, PaymentStatus, OrderStatus, Coordination, ShippingOption, Place, PhysicalPlace | | ||
|
|
||
| ## Implmentation of scopes by Relying Parties | ||
|
|
||
| Relying Parties (RP's), typically platforms implmenting the DFC standard, must implement security constraints on all DFC endpoints to ensure all requests have the appropriate scope for the action/subject combination. | ||
|
|
||
| Furthermore it is recommended that RP's implment a data consent system, whereby data owners can grant (and revoke) access to these scopes for individual clients/users within the OIDC domain. For example a portal wishing to read data on a users Enterprise and Products, might request `ReadEnterprise` and `ReadProduct` access. The RP should record which Enterprises have authorized a specific client or user to which scopes. | ||
|
|
||
| The DFC community provides a web component that can support RP's with this workflow: the [Data Sharing Module](https://github.com/startin-blox/data-sharing-module/) has full instructions on how to implment & manage scope permissions for users on your platform. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clarify SiB (not part of DFC Community) built DPMfor Coopcircuits (are part of DFC Community) |
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation