Skip to content

Feat: Added Support for Application Access Permission#1152

Merged
tanya732 merged 3 commits into
masterfrom
sdk-6240-Application-Access-Permission-node-support
Aug 18, 2025
Merged

Feat: Added Support for Application Access Permission#1152
tanya732 merged 3 commits into
masterfrom
sdk-6240-Application-Access-Permission-node-support

Conversation

@tanya732
Copy link
Copy Markdown
Contributor

@tanya732 tanya732 commented Aug 8, 2025

Changes

Updated Below Endpoints -

Path HTTP Method Method Name
/api/v2/resource-servers/{id} GET get
/api/v2/resource-servers GET getAll
/api/v2/resource-servers/{id} PATCH update
/api/v2/resource-servers POST create
/api/v2/client-grants GET getAll
/api/v2/client-grants POST create
/api/v2/client-grants/:id PATCH update

ResourceServer Endpoint is updated with the following new property:

subject_type_authorization: {
  "user": {
    "policy": string,
  }
  "client": {
    "policy": string
  } 

ClientGrants Endpoint is updated with the following new property:
subject_type and authorization_details_types

References

Please include relevant links supporting this change such as a:

  • support ticket
  • community post
  • StackOverflow post
  • support forum thread

Manual Testing Code


const auth = new ManagementClient({
    domain: '<DOMAIN>',
    token: "<TOKEN>",
  
});

// Endpoint - GET : /api/v2/client-grants
const getPermissions = await auth.clientGrants.getAll();

// Endpoint - POST : /api/v2/client-grants
  const createClientPayload : ClientGrantCreate = {
    client_id: "<CLIENT_ID>",
    audience: "<AUDIENCE>",
    scope: []
    subject_type: "user", //By default it will be client
    authorization_details_types: ["<TYPE>"]
  }
  const createClientGrant = await auth.clientGrants.create(createClientPayload);

// Endpoint - PATCH : /api/v2/client-grants/{id}
  const updateClientPayload : PatchClientGrantsByIdRequest = {
    scope: ["read:client_grants", "create:client_grants", "update:client_grants", "delete:client_grants", "read:users"],
    authorization_details_types: ["<TYPE>"]
  }
  const updateClientGrant = await auth.clientGrants.update({id: "<ID>"}, updateClientPayload);

// Endpoint - GET : /api/v2/resource-servers
  const getResourceServer = await auth.resourceServers.getAll();

// Endpoint - POST : /api/v2/resource-servers
  const createResourceServerPayload : ResourceServerCreate = {
    name: "<NAME>",
    identifier: "<IDENTIFIER>",
    scopes: [
      {
        value: "read:resource",
        description: "Read access to the resource"
      },
      {
        value: "write:resource",
        description: "Write access to the resource"
      }
    ]
  }
  const createResourceServer = await auth.resourceServers.create(createResourceServerPayload);

// Endpoint - PATCH : /api/v2/resource-servers/{id}
  const updateResourceServerPayload : ResourceServerUpdate = {
    subject_type_authorization: {
      user: {
        policy: "<POLICY>",
      },
      client: {
        policy: "<POLICY>",
      }
    } 

  }
  const updateResourceServer = await auth.resourceServers.update({id: "<ID>"}, updateResourceServerPayload);

Testing

Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

  • This change adds unit test coverage
  • This change adds integration test coverage

Checklist

@tanya732 tanya732 marked this pull request as ready for review August 8, 2025 12:30
@tanya732 tanya732 requested a review from a team as a code owner August 8, 2025 12:30
@tanya732 tanya732 merged commit 38cf9db into master Aug 18, 2025
8 checks passed
@tanya732 tanya732 deleted the sdk-6240-Application-Access-Permission-node-support branch August 18, 2025 15:15
@tanya732 tanya732 mentioned this pull request Sep 1, 2025
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.

3 participants