Skip to content

Commit 0ee634e

Browse files
Releasing version 2.60.0
Releasing version 2.60.0
2 parents cc1bf2a + ffca44c commit 0ee634e

File tree

147 files changed

+1029
-564
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+1029
-564
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/).
55

6+
## 2.60.0 - 2023-05-16
7+
### Added
8+
- Support for self-service integration in the Fusion Apps as a Service service
9+
10+
### Breaking Changes
11+
- The `AttachExistingInstanceDetails`, `CreateNewInstanceDetails`, `CreateOaxServiceInstanceDetails`, `CreateOicServiceInstanceDetails`, and `CreateServiceInstanceDetails` models were removed in the Fusion Apps as a Service service
12+
- The `action` property was removed in the `CreateServiceAttachmentDetails` model in the Fusion Apps as a Service service- The `action` property was removed in the `CreateServiceAttachmentDetails` model in the Fusion Apps as a Service service
13+
- The `action` property was removed in the `ServiceAttachment` model in the Fusion Apps as a Service service
14+
15+
616
## 2.59.1 - 2023-05-09
717
### Added
818
- Support for the Access Governance service
Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
const common = require("oci-common");
2+
const identityDomains = require("oci-identitydomains");
3+
4+
/**
5+
* Pre-requisite: the target domain's endpoint URL.
6+
* It can be retreived via Console, CLI or API. Please find details on https://docs.oracle.com/en-us/iaas/Content/Identity/domains/to-view-details-of-an-identity-domain.htm
7+
*/
8+
const DOMAIN_ENDPOINT = "";
9+
// Use default configuration
10+
const provider = new common.ConfigFileAuthenticationDetailsProvider();
11+
/* Or use personal configuration, more details on https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/typescriptsdkgettingstarted.htm#configuring
12+
const configurationFilePath = "~/.oci/config";
13+
const configProfile = "DEFAULT";
14+
const config = common.ConfigFileReader.parseDefault(configProfile);
15+
const profile = config.accumulator.configurationsByProfile.get(configProfile);
16+
// The endpoint url can also be set as part of the configuration, for example:
17+
const DOMAIN_ENDPOINT = profile?.get("domain_endpoint") || "";
18+
const provider = new common.ConfigFileAuthenticationDetailsProvider(
19+
configurationFilePath,
20+
configProfile
21+
);
22+
*/
23+
24+
(async () => {
25+
const identityDomainsClient = new identityDomains.IdentityDomainsClient({
26+
authenticationDetailsProvider: provider
27+
});
28+
identityDomainsClient.endpoint = DOMAIN_ENDPOINT;
29+
30+
//#region Manage Users
31+
console.log("****************** Get list of users (Paginated and sorted) ******************");
32+
33+
let nextPageToken,
34+
page = 0;
35+
do {
36+
page++;
37+
const usersList = await identityDomainsClient.listUsers({
38+
sortBy: "userName",
39+
sortOrder: "DESCENDING",
40+
attributes: "userName",
41+
limit: 10,
42+
page: nextPageToken
43+
});
44+
45+
console.log("Users list: page", page, JSON.stringify(usersList.users.resources));
46+
nextPageToken = usersList.opcNextPage;
47+
} while (!!nextPageToken);
48+
49+
const testUserName = `testUserJavaScriptSDK-${Date.now().toString()}`;
50+
51+
console.log("****************** Create user ******************");
52+
const reqBody = {
53+
name: { givenName: "test_new", familyName: "user_new" },
54+
schemas: ["urn:ietf:params:scim:schemas:core:2.0:User"],
55+
groups: [],
56+
userName: testUserName,
57+
emails: [{ type: "work", primary: true, value: "[email protected]" }],
58+
urnIetfParamsScimSchemasOracleIdcsExtensionUserUser: {
59+
isFederatedUser: false,
60+
status: "pendingVerification",
61+
provider: "IDCS",
62+
creationMechanism: "samljit"
63+
},
64+
urnIetfParamsScimSchemasOracleIdcsExtensionCapabilitiesUser: {
65+
canUseApiKeys: true,
66+
canUseAuthTokens: true
67+
},
68+
urnIetfParamsScimSchemasOracleIdcsExtensionOciTags: {
69+
freeformTags: [],
70+
definedTags: []
71+
},
72+
urnIetfParamsScimSchemasExtensionEnterprise2_0User: {
73+
/** provide existing user id or ocid to value field */
74+
// manager: {value: "d7227e2297dd48dc9d1249845e79f438"}
75+
}
76+
};
77+
const createUserReq = {
78+
user: reqBody,
79+
attributes: "name,userName,id",
80+
attributeSets: ["default"]
81+
};
82+
const user = await identityDomainsClient.createUser(createUserReq);
83+
console.log("User created: ", JSON.stringify(user));
84+
85+
console.log("****************** Get user by id ******************");
86+
const getUserReq = {
87+
userId: user.user.id || ""
88+
};
89+
const result = await identityDomainsClient.getUser(getUserReq);
90+
console.log("User got: ", result);
91+
92+
console.log("****************** Replace user (PUT) ******************");
93+
const putReqBody = {
94+
name: { givenName: "test_new", familyName: "user_new" },
95+
schemas: ["urn:ietf:params:scim:schemas:core:2.0:User"],
96+
groups: [],
97+
idcsCreatedBy: { value: "", type: "user" },
98+
userName: testUserName,
99+
emails: [{ type: "work", primary: true, value: "[email protected]" }],
100+
urnIetfParamsScimSchemasOracleIdcsExtensionUserUser: { isFederatedUser: false },
101+
urnIetfParamsScimSchemasOracleIdcsExtensionCapabilitiesUser: {
102+
canUseApiKeys: true,
103+
canUseAuthTokens: true
104+
}
105+
};
106+
const putUserReq = {
107+
userId: user.user.id || "",
108+
user: putReqBody
109+
};
110+
const putUserDetails = await identityDomainsClient.putUser(putUserReq);
111+
console.log("User replaced with PUT: ", putUserDetails);
112+
113+
console.log("****************** Update user (PATCH) ******************");
114+
const patchReqBody = {
115+
operations: [
116+
// { path: "userType", value: "employee", op: "add"},
117+
{ path: "description", value: "Test user for JavaScript SDK", op: "add" }
118+
],
119+
schemas: ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]
120+
};
121+
const patchUserReq = {
122+
userId: user.user.id || "",
123+
patchOp: patchReqBody
124+
};
125+
const patchUserDetails = await identityDomainsClient.patchUser(patchUserReq);
126+
console.log("User updated with PATCH: ", patchUserDetails);
127+
128+
console.log("****************** Delete user ******************");
129+
const deleteUserReq = {
130+
userId: user.user.id || ""
131+
};
132+
const res = await identityDomainsClient.deleteUser(deleteUserReq);
133+
console.log("User deleted", res);
134+
//#endregion Manage Users
135+
136+
//#region Manage Dynamic groups
137+
console.log("****************** Create Dynamic Resource Group ******************");
138+
const dynamicGroup = {
139+
displayName: "testsdkdynamicgroup",
140+
description: "description",
141+
matchingRule:
142+
"Any {Any {instance.id = 'ocid1.instance.oc1.iad..exampleuniqueid1', instance.compartment.id = 'ocid1.compartment.oc1..exampleuniqueid2'}}",
143+
schemas: ["urn:ietf:params:scim:schemas:oracle:idcs:DynamicResourceGroup"]
144+
};
145+
146+
const postDynamicResourceGroupsRequest = {
147+
dynamicResourceGroup: dynamicGroup
148+
};
149+
const response = await identityDomainsClient.createDynamicResourceGroup(
150+
postDynamicResourceGroupsRequest
151+
);
152+
const createdDynamicGroup = response.dynamicResourceGroup;
153+
console.log("Created Dynamic Resource Group: ", createdDynamicGroup);
154+
155+
console.log("****************** Get Dynamic Resource Group by ID ******************");
156+
const getDynamicResourceGroupsIdRequest = {
157+
dynamicResourceGroupId: createdDynamicGroup.id
158+
};
159+
const getDynamicResourceGroupsIdResponse = await identityDomainsClient.getDynamicResourceGroup(
160+
getDynamicResourceGroupsIdRequest
161+
);
162+
console.log(
163+
`Found Dynamic Resource Group by ID: \n displayName: ${getDynamicResourceGroupsIdResponse.dynamicResourceGroup.displayName} \n id: ${getDynamicResourceGroupsIdResponse.dynamicResourceGroup.id}`
164+
);
165+
166+
console.log("****************** Update Dynamic Resource Group (PATCH) ******************");
167+
const operations = [
168+
{
169+
op: "replace",
170+
path: "description",
171+
value: "updated description"
172+
}
173+
];
174+
const patchBody = {
175+
schemas: ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
176+
operations: operations
177+
};
178+
const patchDynamicResourceGroupsIdRequest = {
179+
dynamicResourceGroupId: createdDynamicGroup.id,
180+
patchOp: patchBody
181+
};
182+
const updatedDynamicGroupResponse = await identityDomainsClient.patchDynamicResourceGroup(
183+
patchDynamicResourceGroupsIdRequest
184+
);
185+
console.log("Updated Dynamic Resource Group: ", updatedDynamicGroupResponse.dynamicResourceGroup);
186+
187+
console.log("****************** Update Dynamic Resource Group (PUT) ******************");
188+
const updatedDynamicGroup = {
189+
displayName: createdDynamicGroup.displayName,
190+
description: "new description",
191+
matchingRule:
192+
"Any {Any {instance.id = 'ocid1.instance.oc1.iad..exampleuniqueid1', instance.compartment.id = 'ocid1.compartment.oc1..exampleuniqueid2'}}",
193+
schemas: createdDynamicGroup.schemas
194+
};
195+
const putDynamicResourceGroupsIdRequest = {
196+
dynamicResourceGroupId: createdDynamicGroup.id,
197+
dynamicResourceGroup: updatedDynamicGroup
198+
};
199+
console.log("putDynamicResourceGroupsIdRequest__________", putDynamicResourceGroupsIdRequest);
200+
const replacedDynamicGroupResponse = await identityDomainsClient.putDynamicResourceGroup(
201+
putDynamicResourceGroupsIdRequest
202+
);
203+
console.log(
204+
"Updated Dynamic Resource Group: ",
205+
replacedDynamicGroupResponse.dynamicResourceGroup
206+
);
207+
208+
console.log("****************** Delete Dynamic Resource Group ******************");
209+
const deleteDynamicResourceGroupsIdRequest = {
210+
dynamicResourceGroupId: createdDynamicGroup.id
211+
};
212+
await identityDomainsClient.deleteDynamicResourceGroup(deleteDynamicResourceGroupsIdRequest);
213+
console.log(`Deleted dynamic group: ${createdDynamicGroup.displayName}`);
214+
215+
//#endregion Manage Dynamic groups
216+
})();

0 commit comments

Comments
 (0)