Skip to content

Commit

Permalink
Merge pull request #12135 from hasuniea/newmas
Browse files Browse the repository at this point in the history
added sub level scopes for admin APIs
  • Loading branch information
chamilaadhi authored Oct 31, 2023
2 parents a3d10ef + d393e33 commit 1a342f0
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,14 @@
"Name": "apim:admin_operations",
"Roles": "admin"
},
{
"Name": "apim:keymanagers_manage",
"Roles": "admin"
},
{
"Name": "apim:api_category",
"Roles": "admin"
},
{
"Name": "apim:shared_scope_manage",
"Roles": "admin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public class ApiCategoriesApi {
@ApiOperation(value = "Delete an API Category", notes = "Delete an API Category by API Category Id ", response = Void.class, authorizations = {
@Authorization(value = "OAuth2Security", scopes = {
@AuthorizationScope(scope = "apim:admin", description = "Manage all admin operations"),
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations")
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations"),
@AuthorizationScope(scope = "apim:api_category", description = "Manage API categories")
})
}, tags={ "API Category (Individual)", })
@ApiResponses(value = {
Expand All @@ -61,7 +62,8 @@ public Response apiCategoriesApiCategoryIdDelete(@ApiParam(value = "API Category
@ApiOperation(value = "Update an API Category", notes = "Update an API Category by category Id ", response = APICategoryDTO.class, authorizations = {
@Authorization(value = "OAuth2Security", scopes = {
@AuthorizationScope(scope = "apim:admin", description = "Manage all admin operations"),
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations")
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations"),
@AuthorizationScope(scope = "apim:api_category", description = "Manage API categories")
})
}, tags={ "API Category (Individual)", })
@ApiResponses(value = {
Expand All @@ -79,7 +81,8 @@ public Response apiCategoriesApiCategoryIdPut(@ApiParam(value = "API Category UU
@ApiOperation(value = "Get all API Categories", notes = "Get all API categories ", response = APICategoryListDTO.class, authorizations = {
@Authorization(value = "OAuth2Security", scopes = {
@AuthorizationScope(scope = "apim:admin", description = "Manage all admin operations"),
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations")
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations"),
@AuthorizationScope(scope = "apim:api_category", description = "Manage API categories")
})
}, tags={ "API Category (Collection)", })
@ApiResponses(value = {
Expand All @@ -95,7 +98,8 @@ public Response apiCategoriesGet() throws APIManagementException{
@ApiOperation(value = "Add API Category", notes = "Add a new API category ", response = APICategoryDTO.class, authorizations = {
@Authorization(value = "OAuth2Security", scopes = {
@AuthorizationScope(scope = "apim:admin", description = "Manage all admin operations"),
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations")
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations"),
@AuthorizationScope(scope = "apim:api_category", description = "Manage API categories")
})
}, tags={ "API Category (Individual)" })
@ApiResponses(value = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public class KeyManagersApi {
@ApiOperation(value = "Retrieve Well-known information from Key Manager Well-known Endpoint", notes = "Retrieve well-known information from key manager's well-known endpoint ", response = KeyManagerWellKnownResponseDTO.class, authorizations = {
@Authorization(value = "OAuth2Security", scopes = {
@AuthorizationScope(scope = "apim:admin", description = "Manage all admin operations"),
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations")
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations"),
@AuthorizationScope(scope = "apim:keymanagers_manage", description = "Manage Key Managers")
})
}, tags={ "Key Manager (Collection)", })
@ApiResponses(value = {
Expand All @@ -61,7 +62,8 @@ public Response keyManagersDiscoverPost(@Multipart(value = "url", required = fal
@ApiOperation(value = "Get all Key managers", notes = "Get all Key managers ", response = KeyManagerListDTO.class, authorizations = {
@Authorization(value = "OAuth2Security", scopes = {
@AuthorizationScope(scope = "apim:admin", description = "Manage all admin operations"),
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations")
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations"),
@AuthorizationScope(scope = "apim:keymanagers_manage", description = "Manage Key Managers")
})
}, tags={ "Key Manager (Collection)", })
@ApiResponses(value = {
Expand All @@ -77,7 +79,8 @@ public Response keyManagersGet() throws APIManagementException{
@ApiOperation(value = "Delete a Key Manager", notes = "Delete a Key Manager by keyManager id ", response = Void.class, authorizations = {
@Authorization(value = "OAuth2Security", scopes = {
@AuthorizationScope(scope = "apim:admin", description = "Manage all admin operations"),
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations")
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations"),
@AuthorizationScope(scope = "apim:keymanagers_manage", description = "Manage Key Managers")
})
}, tags={ "Key Manager (Individual)", })
@ApiResponses(value = {
Expand All @@ -94,7 +97,8 @@ public Response keyManagersKeyManagerIdDelete(@ApiParam(value = "Key Manager UUI
@ApiOperation(value = "Get a Key Manager Configuration", notes = "Retrieve a single Key Manager Configuration. We should provide the Id of the KeyManager as a path parameter. ", response = KeyManagerDTO.class, authorizations = {
@Authorization(value = "OAuth2Security", scopes = {
@AuthorizationScope(scope = "apim:admin", description = "Manage all admin operations"),
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations")
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations"),
@AuthorizationScope(scope = "apim:keymanagers_manage", description = "Manage Key Managers")
})
}, tags={ "Key Manager (Individual)", })
@ApiResponses(value = {
Expand All @@ -112,7 +116,8 @@ public Response keyManagersKeyManagerIdGet(@ApiParam(value = "Key Manager UUID "
@ApiOperation(value = "Update a Key Manager", notes = "Update a Key Manager by keyManager id ", response = KeyManagerDTO.class, authorizations = {
@Authorization(value = "OAuth2Security", scopes = {
@AuthorizationScope(scope = "apim:admin", description = "Manage all admin operations"),
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations")
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations"),
@AuthorizationScope(scope = "apim:keymanagers_manage", description = "Manage Key Managers")
})
}, tags={ "Key Manager (Individual)", })
@ApiResponses(value = {
Expand All @@ -130,7 +135,8 @@ public Response keyManagersKeyManagerIdPut(@ApiParam(value = "Key Manager UUID "
@ApiOperation(value = "Add a new API Key Manager", notes = "Add a new API Key Manager ", response = KeyManagerDTO.class, authorizations = {
@Authorization(value = "OAuth2Security", scopes = {
@AuthorizationScope(scope = "apim:admin", description = "Manage all admin operations"),
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations")
@AuthorizationScope(scope = "apim:admin_operations", description = "Manage API categories and Key Managers related operations"),
@AuthorizationScope(scope = "apim:keymanagers_manage", description = "Manage Key Managers")
})
}, tags={ "Key Manager (Collection)" })
@ApiResponses(value = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2172,6 +2172,7 @@ paths:
- OAuth2Security:
- apim:admin
- apim:admin_operations
- apim:api_category
x-code-samples:
- lang: Curl
source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
Expand Down Expand Up @@ -2206,6 +2207,7 @@ paths:
- OAuth2Security:
- apim:admin
- apim:admin_operations
- apim:api_category
x-code-samples:
- lang: Curl
source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
Expand Down Expand Up @@ -2248,6 +2250,7 @@ paths:
- OAuth2Security:
- apim:admin
- apim:admin_operations
- apim:api_category
x-code-samples:
- lang: Curl
source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
Expand All @@ -2273,6 +2276,7 @@ paths:
- OAuth2Security:
- apim:admin
- apim:admin_operations
- apim:api_category
x-code-samples:
- lang: Curl
source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
Expand Down Expand Up @@ -3012,6 +3016,7 @@ paths:
- OAuth2Security:
- apim:admin
- apim:admin_operations
- apim:keymanagers_manage
x-code-samples:
- lang: Curl
source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
Expand Down Expand Up @@ -3046,6 +3051,7 @@ paths:
- OAuth2Security:
- apim:admin
- apim:admin_operations
- apim:keymanagers_manage
x-code-samples:
- lang: Curl
source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
Expand Down Expand Up @@ -3086,6 +3092,7 @@ paths:
- OAuth2Security:
- apim:admin
- apim:admin_operations
- apim:keymanagers_manage
x-code-samples:
- lang: Curl
source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
Expand Down Expand Up @@ -3124,6 +3131,7 @@ paths:
- OAuth2Security:
- apim:admin
- apim:admin_operations
- apim:keymanagers_manage
x-code-samples:
- lang: Curl
source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
Expand All @@ -3149,6 +3157,7 @@ paths:
- OAuth2Security:
- apim:admin
- apim:admin_operations
- apim:keymanagers_manage
x-code-samples:
- lang: Curl
source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
Expand Down Expand Up @@ -3187,6 +3196,7 @@ paths:
- OAuth2Security:
- apim:admin
- apim:admin_operations
- apim:keymanagers_manage
x-code-samples:
- lang: Curl
source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8"
Expand Down Expand Up @@ -5217,9 +5227,11 @@ components:
apim:tenant_theme_manage: Manage tenant themes
apim:admin_operations: Manage API categories and Key Managers related
operations
apim:api_category: Manage API categories
apim:admin_settings: Retrieve admin settings
apim:admin_alert_manage: Manage admin alerts
apim:api_workflow_view: Retrive workflow requests
apim:scope_manage: Manage system scopes
apim:role_manage: Manage system roles
apim:admin_application_view: View Applications
apim:admin_application_view: View Applications
apim:keymanagers_manage: Manage Key Managers

0 comments on commit 1a342f0

Please sign in to comment.