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

feat(IAM Policy Management): re-gen service after fix the template metadata as part of policies #226

Merged
merged 3 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion examples/iam-policy-management.v1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ describe('IamPolicyManagementV1', () => {
let exampleTemplateVersion;
let exampleTemplateEtag;
let exampleAssignmentId;
let exampleAssignmentPolicyId;
const exampleCustomRoleDipslayName = 'IAM Groups read access';
const exampleUserId = 'IBMid-user1';
const exampleServiceName = 'iam-groups';
Expand Down Expand Up @@ -1042,7 +1043,6 @@ describe('IamPolicyManagementV1', () => {
const params = {
policyTemplateId: exampleTemplateId,
version: exampleTemplateVersion,
ifMatch: exampleTemplateEtag,
};

try {
Expand Down Expand Up @@ -1184,10 +1184,40 @@ describe('IamPolicyManagementV1', () => {
try {
res = await iamPolicyManagementService.getPolicyAssignment(params);
console.log(JSON.stringify(res.result, null, 2));
exampleAssignmentPolicyId = res.result.resources[0].policy.resource_created.id;
} catch (err) {
console.warn(err);
}

// end-get_policy_assignment
});
test('getV2Policy to get Template meta data request example', async () => {
expect(exampleAssignmentPolicyId).toBeDefined();

consoleLogMock.mockImplementation(output => {
originalLog(output);
});
consoleWarnMock.mockImplementation(output => {
originalWarn(output);
// when the test fails we need to print out the error message and stop execution right after it
expect(true).toBeFalsy();
});

originalLog('getV2Policy() result:');
// begin-get_v2_policy

const params = {
id: exampleAssignmentPolicyId,
};

try {
const res = await iamPolicyManagementService.getV2Policy(params);
examplePolicyETag = res.headers.etag;
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err)
}

// end-get_v2_policy
});
});
Loading