Skip to content

Commit

Permalink
Merge pull request #4823 from hwupathum/tenant-api
Browse files Browse the repository at this point in the history
Update Tenant API
  • Loading branch information
hwupathum authored Oct 25, 2024
2 parents 201652c + 7adffa5 commit 309a91f
Showing 1 changed file with 178 additions and 13 deletions.
191 changes: 178 additions & 13 deletions en/identity-server/next/docs/apis/restapis/tenant-management.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ paths:
'application/json':
schema:
$ref: '#/components/schemas/TenantsListResponse'
'400':
$ref: '#/components/responses/InvalidInput'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
Expand All @@ -39,12 +41,6 @@ paths:
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/ServerError'
'501':
description: Not Implemented
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
x-codeSamples:
- lang: Curl
source: |
Expand Down Expand Up @@ -76,6 +72,8 @@ paths:
description: Location of the newly created tenant
schema:
type: string
'206':
$ref: '#/components/responses/PartialContent'
'400':
$ref: '#/components/responses/InvalidInput'
'401':
Expand Down Expand Up @@ -375,6 +373,98 @@ paths:
'https://localhost:9443/api/server/v1/tenants/{tenant-id}/owners' \
-H 'accept: application/json' \
-H 'Authorization: Basic YWRtaW46YWRtaW4='
'/tenants/{tenant-id}/owners/{owner-id}':
get:
tags:
- Tenants
summary: Retrieve tenant owner.
operationId: getOwner
description: |
Retrieve the tenant owner identified by the provided tenant id and owner id.
<b>Scope(Permission) required:</b> `internal_list_tenants`
parameters:
- $ref: '#/components/parameters/tenantIdPathParam'
- $ref: '#/components/parameters/ownerIdPathParam'
- $ref: '#/components/parameters/additionalClaimsQueryParam'
responses:
'200':
description: OK
content:
'application/json':
schema:
$ref: '#/components/schemas/OwnerInfoResponse'
'400':
$ref: '#/components/responses/InvalidInput'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/ServerError'
x-codeSamples:
- lang: Curl
source: |
curl -X 'GET' \
'https://localhost:9443/api/server/v1/tenants/{tenant-id}/owners/{owner-id}' \
-H 'accept: application/json' \
-H 'Authorization: Basic YWRtaW46YWRtaW4='
put:
tags:
- Tenants
summary: Update tenant owner.
operationId: updateOwner
description: |
This API provides the capability to update the tenant owner.
<b>Scope(Permission) required:</b> `internal_modify_tenants`
parameters:
- $ref: '#/components/parameters/tenantIdPathParam'
- $ref: '#/components/parameters/ownerIdPathParam'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OwnerPutModel'
description: This represents the tenant owner to be updated.
required: true
responses:
'200':
$ref: '#/components/responses/Updated'
'206':
$ref: '#/components/responses/PartialContent'
'400':
$ref: '#/components/responses/InvalidInput'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/ServerError'
x-codeSamples:
- lang: Curl
source: |
curl -X 'PUT' \
'https://localhost:9443/api/server/v1/tenants/{tenant-id}/owners/{owner-id}' \
-H 'accept: */*' \
-H 'Authorization: Basic YWRtaW46YWRtaW4=' \
-H 'Content-Type: application/json' \
-d '{
"password": "kim123",
"email": "[email protected]",
"firstname": "kim",
"lastname": "kim",
"additionalClaims": [
{
"claim": "http://wso2.org/claims/telephone",
"value": "+94 562 8723"
}
]
}'
'/tenants/{tenant-id}/metadata':
delete:
tags:
Expand Down Expand Up @@ -437,6 +527,13 @@ components:
description: tenant id
schema:
type: string
ownerIdPathParam:
in: path
name: owner-id
required: true
description: owner id
schema:
type: string
tenantDomainPathParam:
in: path
name: tenant-domain
Expand Down Expand Up @@ -478,7 +575,7 @@ components:
name: sortBy
required: false
description: >-
Attribute by which the retrieved records should be sorted. Currently sorting through _<b>domainName<b>_ only
Attribute by which the retrieved records should be sorted. Currently sorting through <b>domainName</b> only
supported.
schema:
type: string
Expand All @@ -487,12 +584,20 @@ components:
name: filter
required: false
description: >
Condition to filter the retrival of records. Supports 'sw', 'co', 'ew'
and 'eq' operations and also complex queries with 'and' operations. E.g.
/tenants?filter=domain+sw+"wso2". _<b>This
option is not yet supported.<b>_
Condition to filter the retrieval of records. Supports 'sw', 'co', 'ew' and 'eq' operations.
Currently, filtering is supported only by the <b>domainName</b>.
E.g. /tenants?filter=domainName+sw+wso2.
schema:
type: string
additionalClaimsQueryParam:
in: query
name: additionalClaims
required: false
description: >-
Define set of additional user claims (as comma separated) to be returned.
schema:
type: string
example: http://wso2.org/claims/telephone
responses:
NotFound:
description: The specified resource is not found
Expand All @@ -512,6 +617,12 @@ components:
'application/json':
schema:
$ref: '#/components/schemas/Error'
PartialContent:
description: Partial Content
content:
'application/json':
schema:
$ref: '#/components/schemas/Error'
InvalidInput:
description: Invalid Input Request
content:
Expand Down Expand Up @@ -679,8 +790,6 @@ components:
required:
- username
- email
- firstname
- lastname
- provisioningMethod
properties:
username:
Expand Down Expand Up @@ -712,6 +821,62 @@ components:
items:
$ref: '#/components/schemas/AdditionalClaims'

OwnerPutModel:
type: object
required:
- email
- firstname
- lastname
properties:
email:
type: string
example: [email protected]
description: Email address of the owner.
password:
type: string
example: kim123
description: Password of the owner.
firstname:
type: string
example: kim
description: First name of the owner.
lastname:
type: string
example: kim
description: Last name of the owner.
additionalClaims:
type: array
items:
$ref: '#/components/schemas/AdditionalClaims'

OwnerInfoResponse:
type: object
properties:
id:
type: string
example: "4875-jhgr-454hb"
description: id of the tenant owner.
username:
type: string
example: kim
description: Username for the tenant owner.
email:
type: string
example: [email protected]
description: Email address of the owner.
firstname:
type: string
example: kim
description: First name of the owner.
lastname:
type: string
example: kim
description: Last name of the owner.
additionalClaims:
type: array
items:
$ref: '#/components/schemas/AdditionalClaims'

OwnerResponse:
type: object
properties:
Expand Down

0 comments on commit 309a91f

Please sign in to comment.