-
Notifications
You must be signed in to change notification settings - Fork 34
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
athmangude/permissionspec #343
Open
athmangude
wants to merge
10
commits into
microsoftgraph:dm/permissionspec
Choose a base branch
from
athmangude:athmangude/permissionspec
base: dm/permissionspec
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.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
fc251c3
Update permissions.md
athmangude 09acc05
updated model schema object properties and definitions
athmangude 8489c09
updated JSON schema in appendix
athmangude 8ed0e25
removed provisioningInfo from permissions schema
athmangude 475b4f3
added provisioningInfo file
athmangude 54dad8c
removed proposal for provisioning info
athmangude 50fcdb0
schema updates
athmangude bdbbfaa
added boolean expressions for additional permissions
athmangude 965ddb2
updated spec definition
athmangude 3cd1bf1
toned down stress on requirement of ownerSecurityGroup
athmangude 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 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 |
---|---|---|
|
@@ -30,7 +30,7 @@ The canonical model for a permissions document is a JSON [JSON] object. When ser | |
"schemes": ["DelegatedWork"], | ||
"methods": ["GET"], | ||
"paths": { | ||
"/print/settings": {} | ||
"/print/settings": "" | ||
} | ||
}] | ||
} | ||
|
@@ -51,35 +51,17 @@ The permissions object contains the details about a permission that can be used | |
### note | ||
The "note" member is a freeform string that provides additional details about the permission that cannot be determined from the other members of the permission object. | ||
|
||
### implicit | ||
The "implicit" member is a boolean value that indicates that the current permission object is implied. The default value is "false". This member is usually set to "true" in combination with a "alsoRequires" expression. | ||
|
||
> Note: This member enables support for legacy paths that have been created that do not require any permission. Also, when used in combination with the "alsoRequires" member it enables support for the Microsoft Graph "create subscription" endpoint and the "Search query" endpoint. | ||
|
||
### schemes | ||
The "schemes" member is a REQUIRED JSON object whose members are [Scheme objects](#schemeObject) supported by the permission. The key of each member is an identifier of the scheme and the value is a [Scheme object](#schemeObject) that contains descriptions of the permission within the scheme. | ||
|
||
### pathSets | ||
The "pathSets" member is a REQUIRED JSON Array. Each element of the array is a [pathSet object](#pathSetObject). | ||
|
||
### privilegeLevel | ||
The "privilegeLevel" member value provides a hint as to the risks of consenting this permissions. Valid values include: low, medium and high. | ||
|
||
## <a name="provisioningInfo"></a>Provisioning Info Object | ||
|
||
The provisioning info object contains information related to the deployment of the permission into its environment. This object should only contain information that is not required by a consumer of the API and can safely be removed in any public projection of the permissions information. | ||
|
||
### isHidden | ||
The "isHidden" member is a boolean value that indicates if a permission should be publicly usable in the API. | ||
|
||
### requiredEnvironments | ||
The "requiredEnvironments" member is an array of strings that identifies the deployment environments in which the permission SHOULD be supported. When this member is not present, support for all environments is implied. | ||
|
||
### resourceAppId | ||
The "resourceAppId" member value provides an identifier of the resource server that is used to enforce Conditional Access checks for this permission. | ||
## <a name="ownerInfo"></a>OwnerInfo Object | ||
|
||
The owner info object contains information related to the ownership of the permission. This object should only contain information that is not required by a consumer of the API and can safely be removed in any public projection of the permissions information. | ||
### ownerSecurityGroup | ||
The "ownerSecurityGroup" member is a REQUIRED string that provides a contact mechanism for communicating with the owners of the permission. It is important that owners of permissions are aware when new paths are added to an existing permission. | ||
The "ownerSecurityGroup" member is a string that provides a contact mechanism for communicating with the owners of the permission. It is important that owners of permissions are aware when new paths are added to an existing permission. This member is REQUIRED when `ownerInfo` is present. | ||
|
||
## <a name="pathSetObject"></a>PathSet Object | ||
A pathSet object identifies a set of paths that are accessible and have a common set of security characteristics, such as HTTP methods and schemes. Ideally, a permission object contains a single pathSet object. This indicates that all paths protected by the permission support the same characteristics. In practice there are cases where support is not uniform. Distinct pathSet objects can be created to separate the paths with varying characteristics. | ||
|
@@ -98,7 +80,7 @@ A pathSet object identifies a set of paths that are accessible and have a common | |
"schemeKeys": ["Application"], | ||
"methods": ["GET,POST"], | ||
"paths": { | ||
"/print/settings": {} | ||
"/print/settings": "" | ||
} | ||
} | ||
] | ||
|
@@ -114,9 +96,9 @@ The "methods" member is a REQUIRED array of strings that represent the HTTP meth | |
The "paths" member is a REQUIRED object whose keys contain a simplified URI template to identify the resources protected by this permission object. | ||
|
||
### alsoRequires | ||
The "alsoRequires" member is logical expression of permissions that must be presented as claims alongside the current permission. | ||
The "alsoRequires" member is logical expression of permissions that must be presented as claims alongside the current permission. | ||
|
||
``` | ||
```json | ||
(User.Read | User.Read.All) & Group.Read | ||
``` | ||
|
||
|
@@ -126,7 +108,6 @@ The "includedProperties" member is an array of strings that identify properties | |
### excludedProperties | ||
The "excludedProperties" member is an array of strings that identify properties of the resource representation returned by the path, that are not accessible with the permission. | ||
|
||
|
||
## <a name="schemeObject"></a>Scheme Object | ||
The scheme object has members that describe the permission within the context of the scheme. Additional members provide behavioral constraints of the permission when used with the scheme. | ||
|
||
|
@@ -137,15 +118,18 @@ The scheme object has members that describe the permission within the context of | |
"adminDescription": "Allows the app to read and report the signed-in user's activity in the app.", | ||
"userConsentDisplayName": "Read and write app activity to users'activity feed", | ||
"userConsentDescription": "Allows the app to read and report the signed-in user's activity in the app.", | ||
"requiresAdminConsent": true | ||
"requiresAdminConsent": true, | ||
"privilegeLevel": 3 | ||
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. Using integer values is problematic because how does anyone know if 1 is high privilege or 5 is? I see it is in the description, but that doesn't help when just looking at the JSON object. |
||
}, | ||
"DelegatedPersonal": { | ||
"userConsentDisplayName": "Read and write app activity to users'activity feed", | ||
"userConsentDescription": "Allows the app to read and report the signed-in user's activity in the app." | ||
"userConsentDescription": "Allows the app to read and report the signed-in user's activity in the app.", | ||
"privilegeLevel": 2 | ||
}, | ||
"Application": { | ||
"adminDisplayName": "Read and write app activity to users' activity feed", | ||
"adminDescription": "Allows the app to read and report the signed-in user's activity in the app.", | ||
"privilegeLevel": 5 | ||
} | ||
``` | ||
|
||
|
@@ -164,17 +148,24 @@ The "userConsentDescription" member is a REQUIRED string that describes the perm | |
### requiresAdminConsent | ||
The "requiresAdminConsent" member is a boolean value with a default value of false. When true, this permission can only be consented by an adminstrator. | ||
|
||
### privilegeLevel | ||
The "privilegeLevel" member is an integer value that provides a hint as to the risks of consenting to the permissions. Valid values range from 1 (least privileged) to 5 (most privileged). The value is arrived at by considering the breadth of access that a permission will give access to and the sensitivity of the operations allowed by the permission. The same permission can have different privilege levels when used with different schemes. | ||
|
||
## <a name="pathObject"></a>Path Object | ||
The path object contains properties that affect how the permission object controls access to resource identified by the key of the path object. | ||
The path object contains stringified properties and value pairs that affect how the permission object controls access to resource identified by the key of the path object. | ||
|
||
```json | ||
"paths": { | ||
"/me/activities/{id}": { | ||
"leastPrivilegePermission": ["DelegatedWork", "DelegatedPersonal"] | ||
} | ||
"/me/activities/{id}": "least=DelegatedWork,DelegatedPersonal" | ||
``` | ||
|
||
### leastPrivilegePermission | ||
```json | ||
"paths": { | ||
"/search/query": "implicit=true;alsoRequires=Bookmark.Read.All;least=Delegated" | ||
} | ||
``` | ||
|
||
### least (least privilege permission) | ||
The "leastPrivilegePermission" member is an array of strings that identify the schemes for which the current permission is the least privilege permission for accessing the path. Each string value in the array MUST match one of the schemes defined in the [pathSet Object](#pathsetObject) | ||
|
||
## Appendix A. Model Diagram | ||
|
@@ -184,25 +175,24 @@ classDiagram | |
|
||
class Permission{ | ||
note: string | ||
implicit: bool | ||
requiredEnvironments: string[] | ||
ownerEmail:string | ||
isHidden: bool | ||
privilegeLevel: string | ||
} | ||
Permission "1" --> "*" PathSet:pathSets | ||
Permission "1" --> "*" Scheme:schemes | ||
|
||
class PathSet{ | ||
schemeKeys: string[] | ||
methods: string[] | ||
alsoRequires: stringExpression | ||
includedProperties: string[] | ||
excludedProperties: string[] | ||
} | ||
PathSet "1" --> "*" Path:paths | ||
|
||
class Path{ | ||
alsoRequires: stringExpression | ||
implicit: bool | ||
leastPrivilegePermission: string | ||
} | ||
|
||
|
@@ -212,6 +202,7 @@ classDiagram | |
userDisplayName: string | ||
userDescription: string | ||
requiresAdminConsent: string | ||
privilegeLevel: int | ||
} | ||
|
||
``` | ||
|
@@ -243,23 +234,13 @@ classDiagram | |
"additionalProperties": false, | ||
"properties": { | ||
"note": {"type": "string"}, | ||
"implicit": {"type": "boolean"}, | ||
"isHidden": {"type": "boolean"}, | ||
"ownerEmail": {"type": "string"}, | ||
"privilegeLevel": { | ||
"type":"string", | ||
"enum":["low","medium","high"] | ||
} | ||
"requiredEnvironments": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"alsoRequires": { | ||
"type": "string", | ||
"pattern": "[\\w]+\\.[\\w]+[\\.[\\w]+]?" | ||
}, | ||
"schemes": { | ||
"type": "object", | ||
"patternProperties": { | ||
|
@@ -318,13 +299,8 @@ classDiagram | |
} | ||
}, | ||
"path": { | ||
"type": "object", | ||
"properties": { | ||
"leastPrivilegePermission": { | ||
"type": "array", | ||
"items": { "type":"string"} | ||
} | ||
}, | ||
"type": "string", | ||
}, | ||
"scheme": { | ||
"type": "object", | ||
"properties": { | ||
|
@@ -342,6 +318,10 @@ classDiagram | |
}, | ||
"userConsentDescription": { | ||
"type": "string" | ||
}, | ||
"privilegeLevel": { | ||
"type": "int", | ||
"enum": [1, 2, 3, 4, 5] | ||
} | ||
} | ||
} | ||
|
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.
This needs to go back here.