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

docs: Added REST Identity API section #4880

Merged
merged 7 commits into from
Oct 31, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
doc updated.
salvatore-coppola authored and nicolatimeus committed Oct 31, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 625b0391a9bb2fd2b7bbd125360e1cc6513c1545
118 changes: 53 additions & 65 deletions docs/references/rest-apis/rest-identity-api.md
Original file line number Diff line number Diff line change
@@ -9,46 +9,21 @@ Identities with `rest.identity` permissions can access these APIs.

## POST methods

#### Set users configuration
#### Create User

- Description: This method allows to overwrite the users configuration in the system.
- Description: This method allows to create a new user in the system.
- Method: POST
- API PATH: `services/identity/v1/users/configs`
- API PATH: `services/identity/v1/identities`

##### Request
```JSON
{
"userConfig": [
{
"userName": "admin",
"passwordChangeNeeded": false,
"permissions": [
"rest.command",
"rest.inventory",
"rest.configuration",
"rest.tamper.detection",
"rest.security",
"kura.cloud.connection.admin",
"rest.position",
"kura.packages.admin",
"kura.device",
"rest.wires.admin",
"kura.admin",
"rest.keystores",
"rest.assets",
"rest.system",
"kura.maintenance",
"kura.wires.admin",
"rest.identity"
]
},
{
"userName": "kura.user.example",
"passwordChangeNeeded": true,
"permissions": [
"rest.assets"
]
}
"userName": "username",
"password": "password",
"passwordChangeNeeded": false,
"passwordAuthEnabled": true,
"permissions": [
"rest.identity"
]
}
```
@@ -58,43 +33,23 @@ Identities with `rest.identity` permissions can access these APIs.
- 200 OK status
- 500 Internal Server Error

#### Create User
#### Get User by Name

- Description: This method allows to create a new user in the system. The only accepted parameter is the userName.
- Description: This method allows to get data about an user in the system. The only considered field is the userName.
- Method: POST
- API PATH: `services/identity/v1/users`

##### Request
```JSON
{
"userName": "example"
}
```

##### Responses

- 200 OK status
- 500 Internal Server Error

## GET methods

#### Get User

- Description: This method allows to get data about an user in the system. The only accepted parameter is the userName.
- Method: GET
- API PATH: `services/identity/v1/users`
- API PATH: `services/identity/v1/identities/byName`

##### Request
```JSON
{
"userName": "example"
"userName": "username"
}
salvatore-coppola marked this conversation as resolved.
Show resolved Hide resolved
```

##### Responses
```JSON
{
"userName": "kura.user.example",
"userName": "kura.user.username",
"passwordAuthEnabled": false,
"passwordChangeNeeded": false,
"permissions": []
@@ -104,14 +59,16 @@ Identities with `rest.identity` permissions can access these APIs.
- 200 OK status
- 500 Internal Server Error

## GET methods

#### Get defined permissions

- Description: This method allows you to get the list of the permissions defined in the system
- Method: GET
- API PATH: `services/identity/v1/defined-permissions`

##### Responses

- 200 OK status
```JSON
{
"permissions": [
@@ -135,16 +92,18 @@ Identities with `rest.identity` permissions can access these APIs.
]
}
```

- 200 OK status
- 500 Internal Server Error

#### Get users configuration

- Description: This method allows you to get the list of the users and their configuration on the system.
- API PATH: `services/identity/v1/users/configs`
- Method: GET
- API PATH: `services/identity/v1/identities`

##### Responses

- 200 OK status
```JSON
{
"userConfig": [
@@ -169,20 +128,49 @@ Identities with `rest.identity` permissions can access these APIs.
]
}
```

- 200 OK status
- 500 Internal Server Error

## PUT methods

#### Update User

- Description: This method allows to update an existing user in the system.
- Method: PUT
- API PATH: `services/identity/v1/identities`

##### Request

```JSON
{
"userName": "username",
"password": "password",
"passwordChangeNeeded": false,
"passwordAuthEnabled": true,
"permissions": [
"rest.identity"
]
}
```

##### Responses

- 200 OK status
- 500 Internal Server Error

## DELETE methods

#### Delete User

- Description: This method allows to delete an existing user in the system. The only accepted parameter is the userName.
- Description: This method allows to delete an existing user in the system. The only considered field is the userName.
- Method: DELETE
- API PATH: `services/identity/v1/users`
- API PATH: `services/identity/v1/identities`

##### Request
```JSON
{
"userName": "example",
"userName": "username",
}
salvatore-coppola marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the comma also here.

```