Skip to content

Homework 4: Testing Custos with the API endpoints

ayushsanghavi edited this page May 5, 2022 · 6 revisions

After successful Custos deployment


Below are the actions and Custos' REST endpoints

1) Registering a user

Base URL : https://js-157-36.jetstream-cloud.org:32036/

API endpoint: user-management/v1.0.0/user

Request type : POST

Header : {Authorization : Bearer API key}

Params : No params

Body :

{
"username":"UserA",
"first_name":"Jhon",
"last_name":"Creg",
"email":"[email protected]",
"password":"12345",
"temporary_password":false`
}`

2) Creating Groups

Base URL : https://js-157-36.jetstream-cloud.org:32036/

API endpoint: /group-management/v1.0.0/groups

Request type : POST

Header : {Authorization : Bearer API key}

Params : No params

Body :

{
"clientId":"custosuser3000",
"groups": [ {
"name": "Test grouping",
"ownerId":"UserA",
"description":"This is test group.",
"realm_roles": [],
"client_roles": [],
"attributes": [],
"sub_groups": []
}]
}

3) Adding a user to a group

Base URL : https://js-157-36.jetstream-cloud.org:32036/

API endpoint: /group-management/v1.0.0/user/group/membership

Request type : POST

Header : {Authorization : Bearer API key}

Params : No params

Body :

{
"group_id":"30c93703-2843-46a4-9551-4ea5ccb7fa4d",
"username":"UserA",
"membership_type":"MEMBER"
}

4) Generating SSH credential

Base URL : https://js-157-36.jetstream-cloud.org:32036/

API endpoint: /resource-secret-management/v1.0.0/secret/ssh

Request type : POST

Header : {Authorization : Bearer API key}

Params : No params

Body :

{
"metadata" : {
"client_id":"custosId",
"description":"Admin user SSH for Gateway phasta",
"owner_id":"username"
}
}

5) Getting the SSH credential

Base URL : https://js-157-36.jetstream-cloud.org:32036/

API endpoint: /resource-secret-management/v1.0.0/secret/ssh

Request type : GET

Header : {Authorization : Bearer API key}

Params :

`client_id=xxxxx`

`token=credential_token`

Body : No body