Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
added list policy providers endpoint (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
edewit committed Jan 3, 2022
1 parent b525d74 commit 52afbad
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/defs/policyProviderRepresentation.ts
@@ -0,0 +1,5 @@
export interface PolicyProviderRepresentation {
type?: string;
name?: string;
group?: string;
}
10 changes: 10 additions & 0 deletions src/resources/clients.ts
Expand Up @@ -16,6 +16,7 @@ import CertificateRepresentation from '../defs/certificateRepresentation';
import KeyStoreConfig from '../defs/keystoreConfig';
import ResourceServerRepresentation from '../defs/resourceServerRepresentation';
import ScopeRepresentation from '../defs/scopeRepresentation';
import {PolicyProviderRepresentation} from '../defs/policyProviderRepresentation';

export interface PaginatedQuery {
first?: number;
Expand Down Expand Up @@ -622,6 +623,15 @@ export class Clients extends Resource<{realm?: string}> {
urlParamKeys: ['id', 'policyId'],
});

public listPolicyProviders = this.makeRequest<
{id: string},
PolicyProviderRepresentation
>({
method: 'GET',
path: '/{id}/authz/resource-server/policy/providers',
urlParamKeys: ['id'],
});

public async createOrUpdatePolicy(payload: {
id: string;
policyName: string;
Expand Down
7 changes: 7 additions & 0 deletions test/clients.spec.ts
Expand Up @@ -1260,5 +1260,12 @@ describe('Clients', () => {
},
]);
});

it('list policy providers', async () => {
const result = await kcAdminClient.clients.listPolicyProviders({
id: currentClient.id!,
});
expect(result).to.be.ok;
});
});
});

0 comments on commit 52afbad

Please sign in to comment.