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

Fetch least privilege permissions for set of request URLs and not individual request URLs #1510

Merged
merged 3 commits into from
Apr 19, 2023

Conversation

millicentachieng
Copy link
Contributor

@millicentachieng millicentachieng commented Apr 18, 2023

Overview

Fixes #1505

Example

Sample permissions file

{
  "/users/{id}/chats": {
     "GET": {
         "DelegatedWork": {
	      "leastPrivilegePermissions": [
                  "Chat.ReadBasic"
	      ],
	   "allPermissions": [
	       "Chat.Read",
	       "Chat.ReadBasic",
	       "Chat.ReadWrite"
	   ]
      }
  },
  "/chats/{id}/messages": {
     "GET": {
         "DelegatedWork": {
	      "leastPrivilegePermissions": [
                  "Chat.Read"
	      ],
	   "allPermissions": [
	       "Chat.Read",
	       "Chat.ReadWrite"
	   ]
      }
  }
}

Request

POST /permissions?scopeType=DelegatedWork
[ 
    { 
        "requestUrl": "/users/{id}/chats",
        "method": "GET"
    },
    { 
        "requestUrl": "/chats/{id}/messages",
        "method": "POST"
    }
]

Response

[
    {
        "value": "Chat.Read",
        "scopeType": "DelegatedWork",
        "consentDisplayName": "Read your chat messages",
        "consentDescription": "Allows an app to read your 1 on 1 or group chat messages in Microsoft Teams, on your behalf.",
        "isAdmin": false,
        "isLeastPrivilege": true,
        "isHidden": false
    }
]

PermissionsService/Services/PermissionsStore.cs Outdated Show resolved Hide resolved
PermissionsService/Services/PermissionsStore.cs Outdated Show resolved Hide resolved
PermissionsService/Services/PermissionsStore.cs Outdated Show resolved Hide resolved
PermissionsService/Services/PermissionsStore.cs Outdated Show resolved Hide resolved
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

82.3% 82.3% Coverage
0.0% 0.0% Duplication

@millicentachieng millicentachieng requested a review from baywet April 19, 2023 17:27
Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes

@millicentachieng millicentachieng merged commit 6a31be0 into dev Apr 19, 2023
@millicentachieng millicentachieng deleted the task/ma/update-permissions-endpoint branch April 19, 2023 18:52
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.

Fetch least privilege permissions for set of request URLs and not individual request URLs
2 participants