Skip to content

Commit

Permalink
feat(jans-config-api): added patch endpoint for custom script
Browse files Browse the repository at this point in the history
  • Loading branch information
pujavs committed Apr 20, 2022
1 parent f3f0d0d commit f8da77d
Show file tree
Hide file tree
Showing 6 changed files with 243 additions and 22 deletions.
178 changes: 168 additions & 10 deletions jans-cli/cli/jca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,37 @@ paths:
description: Internal Server Error
security:
- oauth2: [https://jans.io/oauth/config/scripts.delete]
patch:
summary: Partially update custom script.
description: Partially update custom script.
operationId: patch-config-scripts-by-inum
security:
- oauth2: [https://jans.io/oauth/config/scripts.write]
tags:
- Custom Scripts
requestBody:
content:
application/json-patch+json:
schema:
type: array
items:
$ref: '#/components/schemas/PatchRequest'
description: String representing patch-document.
example: '[ {op:replace, path: enabled, value: \"false\" } ]'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CustomScript'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalServerError'
/jans-config-api/api/v1/config/cache:
get:
summary: Returns cache configuration.
Expand Down Expand Up @@ -3073,6 +3104,95 @@ paths:
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalServerError'
/jans-config-api/admin-ui/license/isActive:
get:
tags:
- Admin UI - License
x-cli-plugin: admin-ui
summary: Check if admin-ui license is active.
description: Check if admin-ui license is active.
operationId: is-license-active
security:
- oauth2: [https://jans.io/oauth/jans-auth-server/config/adminui/license.readonly]
responses:
'200':
description: OK
content:
application/json:
schema:
title: Check if admin-ui license is active.
description: Check if admin-ui license is active.
$ref: '#/components/schemas/LicenseApiResponse'
'400':
$ref: '#/components/schemas/LicenseApiResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/schemas/LicenseApiResponse'
/jans-config-api/admin-ui/license/activateLicense:
post:
tags:
- Admin UI - License
x-cli-plugin: admin-ui
summary: Activate license using license-key.
description: Activate license using license-key.
operationId: activate-adminui-license
security:
- oauth2: [https://jans.io/oauth/jans-auth-server/config/adminui/license.write]
requestBody:
content:
application/json:
schema:
required:
- licenseKey
$ref: '#/components/schemas/LicenseApiRequest'
responses:
'200':
description: OK
content:
application/json:
schema:
title: Activate license using license-key.
description: Activate license using license-key.
$ref: '#/components/schemas/LicenseApiResponse'
'400':
$ref: '#/components/schemas/LicenseApiResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/schemas/LicenseApiResponse'
/jans-config-api/admin-ui/license/saveApiCredentials:
post:
tags:
- Admin UI - License
x-cli-plugin: admin-ui
summary: Save license api credentials.
description: Save license api credentials.
operationId: save-license-api-credentials
security:
- oauth2: [https://jans.io/oauth/jans-auth-server/config/adminui/license.write]
requestBody:
content:
application/json:
schema:
required:
- licenseKey
$ref: '#/components/schemas/LicenseSpringCredentials'
responses:
'200':
description: OK
content:
application/json:
schema:
title: Save license api credentials.
description: Save license api credentials.
$ref: '#/components/schemas/LicenseApiResponse'
'400':
$ref: '#/components/schemas/LicenseApiResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/schemas/LicenseApiResponse'
/jans-config-api/admin-ui/license/licenseDetails:
get:
tags:
Expand All @@ -3091,7 +3211,7 @@ paths:
schema:
title: Get admin ui license details.
description: Get admin ui license details.
$ref: '#/components/schemas/LicenseResponse'
$ref: '#/components/schemas/LicenseDetailsResponse'
'400':
$ref: '#/components/responses/NotAcceptable'
'401':
Expand All @@ -3113,7 +3233,7 @@ paths:
schema:
required:
- role
$ref: '#/components/schemas/LicenseRequest'
$ref: '#/components/schemas/LicenseDetailsRequest'
responses:
'200':
description: OK
Expand All @@ -3122,7 +3242,7 @@ paths:
schema:
title: Edit admin ui license details.
description: Edit admin ui license details.
$ref: '#/components/schemas/LicenseResponse'
$ref: '#/components/schemas/LicenseDetailsResponse'
'400':
$ref: '#/components/responses/NotAcceptable'
'401':
Expand Down Expand Up @@ -4962,9 +5082,6 @@ components:
type: array
items:
type: string
clientName:
description: A human-readable name of the client.
type: string
idTokenTokenBindingCnf:
description: 'Specifies the JWT Confirmation Method member name (e.g. tbh) that the Relying Party expects when receiving Token Bound ID Tokens. The presence of this parameter indicates that the Relying Party supports Token Binding of ID Tokens. If omitted, the default is that the Relying Party does not support Token Binding of ID Tokens.'
type: string
Expand Down Expand Up @@ -6323,9 +6440,9 @@ components:
items:
type: string
description: permissions
LicenseRequest:
LicenseDetailsRequest:
type: object
description: Admin license request
description: Admin license details request
required:
- validityPeriod
properties:
Expand All @@ -6338,9 +6455,38 @@ components:
licenseActive:
type: string
description: Is license active?
LicenseResponse:
LicenseApiRequest:
type: object
description: Admin license response
description: Admin license api request
required:
- licenseKey
properties:
licenseKey:
type: string
description: The license-key.
LicenseSpringCredentials:
type: object
required:
- apiKey
- productCode
- sharedKey
- managementKey
properties:
apiKey:
type: string
description: The api-key.
productCode:
type: string
description: The product-code.
sharedKey:
type: string
description: The shared-key.
managementKey:
type: string
description: The management-key.
LicenseDetailsResponse:
type: object
description: Admin license details response
properties:
licenseEnabled:
type: boolean
Expand Down Expand Up @@ -6380,6 +6526,18 @@ components:
customerLastName:
type: string
description: The customer last name.
LicenseApiResponse:
type: object
properties:
apiResult:
type: boolean
description: liceseSpring api request success status
responseMessage:
type: string
description: Response Message
responseCode:
type: integer
description: Response code
ScimAppConfiguration:
type: object
properties:
Expand Down
4 changes: 2 additions & 2 deletions jans-config-api/profiles/local/test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ test.scopes=https://jans.io/oauth/config/acrs.readonly https://jans.io/oauth/con
# jans.server
token.endpoint=https://jans.server/jans-auth/restv1/token
token.grant.type=client_credentials
test.client.id=1800.5cfac798-9a5d-4a92-8efe-4cecc4f0c196
test.client.secret=SSj633EttZdV
test.client.id=1800.231f5c29-8e4b-40a9-b939-3d3db4bd40ef
test.client.secret=Vwp8xXgdpjoN
test.issuer=https://jans.server
8 changes: 8 additions & 0 deletions jans-config-api/server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,14 @@
</resources>

<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<failOnError>false</failOnError>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
Expand Down
Loading

0 comments on commit f8da77d

Please sign in to comment.