-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #24826: Add an API endpoint to get plugin license info
- Loading branch information
Showing
17 changed files
with
686 additions
and
25 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
webapp/sources/api-doc/code_samples/curl/plugins/get-plugins-settings.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
curl --header "X-API-Token: yourToken" https://rudder.example.com/rudder/api/latest/plugins/settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
curl --header "X-API-Token: yourToken" https://rudder.example.com/rudder/api/latest/plugins/info |
11 changes: 11 additions & 0 deletions
11
webapp/sources/api-doc/code_samples/curl/plugins/set-plugins-settings.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# settings.json: | ||
# | ||
#{ | ||
# "username": "my-account-login", | ||
# "password": "xxxxxxxxx", | ||
# "url": "https://download.rudder.io/plugins", | ||
# "proxyUrl": "" | ||
# "proxyUser": "" | ||
# "proxyPassword": "" | ||
#} | ||
curl --header "X-API-Token: yourToken" --request POST https://rudder.example.com/rudder/api/latest/plugins/settings --header "Content-type: application/json" --data @dsettings.json |
99 changes: 99 additions & 0 deletions
99
webapp/sources/api-doc/components/schemas/plugins-info.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# SPDX-License-Identifier: CC-BY-SA-2.0 | ||
# SPDX-FileCopyrightText: 2013-2020 Normation SAS | ||
type: object | ||
required: | ||
- details | ||
properties: | ||
# FIXME: required on not depends on where it's used | ||
globalLimits: | ||
type: object | ||
description: Most restrictive limits computed from each plugin license limits | ||
properties: | ||
licensees: | ||
type: array | ||
description: list of licensees for these plugins | ||
items: | ||
type: string | ||
description: a licensee | ||
example: Customer Inc | ||
startDate: | ||
type: string | ||
description: the latest date of start of validity for plugins | ||
example: 2023-08-14T02:00:00+02:00 | ||
endDate: | ||
type: string | ||
description: the earliest date of end of validity for plugins | ||
example: 2023-08-14T02:00:00+02:00 | ||
maxNodes: | ||
type: integer | ||
description: the lowest limit on maximum number of nodes for plugins | ||
example: 5000 | ||
details: | ||
type: array | ||
description: the list of details for each plugins | ||
properties: | ||
id: | ||
type: string | ||
description: internal id of the plugin | ||
example: com.normation.plugins.authbackends.AuthBackendsPluginDef | ||
name: | ||
type: string | ||
description: fully qualified name of the plugin | ||
example: rudder-plugin-auth-backends | ||
shortName: | ||
type: string | ||
description: short name of the plugin | ||
example: auth-backends | ||
description: | ||
type: string | ||
description: description of the plugin | ||
example: <p>This plugin provides additional authentication backends for Rudder, like LDAP, OIDC, etc</p> | ||
version: | ||
type: string | ||
description: version of the plugin | ||
example: 7.3.12-2.1.0 | ||
status: | ||
type: string | ||
description: status of the plugin, enabled or disabled | ||
example: enabled | ||
enum: | ||
- enabled | ||
- disabled | ||
statusMessage: | ||
type: string | ||
description: a message explaining the status when disabled | ||
example: this plugin is disabled because its end of validity date is in the past | ||
license: | ||
type: object | ||
description: information about the plugin | ||
properties: | ||
licensee: | ||
type: string | ||
description: name of the licensee for that plugin | ||
example: Customer Inc | ||
softwareId: | ||
type: string | ||
description: the fully qualified name of the plugin for which that license was issued | ||
example: rudder-plugin-auth-backends | ||
minVersion: | ||
type: string | ||
description: lowest version of the software for which that license is valid | ||
example: 0.0-0.0 | ||
maxVersion: | ||
type: string | ||
description: highest version of the software for which that license is valid | ||
example: 2023-08-14T02:00:00+02:00 | ||
startDate: | ||
type: string | ||
description: start of validity date | ||
example: 2023-08-14T02:00:00+02:00 | ||
endDate: | ||
type: string | ||
description: end of validity date | ||
example: 2023-08-14T02:00:00+02:00 | ||
maxNodes: | ||
type: integer | ||
description: maximum number of node in Rudder for that license | ||
additionalInfo: | ||
type: object | ||
description: additional information provided by the license |
32 changes: 32 additions & 0 deletions
32
webapp/sources/api-doc/components/schemas/plugins-settings.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# SPDX-License-Identifier: CC-BY-SA-2.0 | ||
# SPDX-FileCopyrightText: 2013-2020 Normation SAS | ||
type: object | ||
required: | ||
- username | ||
- password | ||
properties: | ||
# FIXME: required on not depends on where it's used | ||
username: | ||
type: string | ||
description: username to use for Rudder account | ||
example: Customer Inc | ||
password: | ||
type: | ||
description: password to access Rudder account | ||
example: some password | ||
url: | ||
type: string | ||
description: URL for getting plugins | ||
example: https://download.rudder.io/plugins | ||
proxyUser: | ||
type: string | ||
description: if an authenticated proxy is necessary, username of proxy | ||
example: proxy_user | ||
proxyPassword: | ||
type: string | ||
description: if an authenticated proxy is necessary, password of the proxy | ||
example: some password | ||
proxyUrl: | ||
type: string | ||
description: proxy URL to use | ||
example: https://proxy.url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# SPDX-License-Identifier: CC-BY-SA-2.0 | ||
# SPDX-FileCopyrightText: 2013-2020 Normation SAS | ||
get: | ||
summary: Information about installed plugins | ||
description: Get the list of plugin details and their licenses information | ||
operationId: getPluginsInfo | ||
responses: | ||
"200": | ||
description: Settings | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
required: | ||
- result | ||
- action | ||
- data | ||
properties: | ||
result: | ||
type: string | ||
description: Result of the request | ||
enum: | ||
- success | ||
- error | ||
action: | ||
type: string | ||
description: The id of the action | ||
enum: | ||
- getPluginsInfo | ||
data: | ||
type: object | ||
description: Plugins info | ||
required: | ||
- plugins | ||
properties: | ||
parameters: | ||
type: array | ||
items: | ||
$ref: ../../components/schemas/plugins-info.yml | ||
tags: | ||
- Plugins | ||
x-codeSamples: | ||
- lang: curl | ||
source: | ||
$ref: ../../code_samples/curl/plugins/info.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# SPDX-License-Identifier: CC-BY-SA-2.0 | ||
# SPDX-FileCopyrightText: 2013-2020 Normation SAS | ||
get: | ||
summary: Get plugins repository settings | ||
description: Get plugins url and proxy settings | ||
operationId: pluginSettings | ||
responses: | ||
"200": | ||
description: Settings | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
required: | ||
- result | ||
- action | ||
- data | ||
properties: | ||
result: | ||
type: string | ||
description: Result of the request | ||
enum: | ||
- success | ||
- error | ||
action: | ||
type: string | ||
description: The id of the action | ||
enum: | ||
- pluginSettings | ||
data: | ||
type: object | ||
description: Settings | ||
required: | ||
- plugins | ||
properties: | ||
plugins: | ||
type: array | ||
items: | ||
$ref: ../../components/schemas/plugins-settings.yml | ||
tags: | ||
- Plugins | ||
x-codeSamples: | ||
- lang: curl | ||
source: | ||
$ref: ../../code_samples/curl/plugins/get-plugins-settings.sh | ||
post: | ||
summary: Update plugins settings | ||
description: Update plugins repository URL and proxy | ||
operationId: updateSettings | ||
responses: | ||
"200": | ||
description: Settings | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
required: | ||
- result | ||
- action | ||
- data | ||
properties: | ||
result: | ||
type: string | ||
description: Result of the request | ||
enum: | ||
- success | ||
- error | ||
action: | ||
type: string | ||
description: The id of the action | ||
enum: | ||
- updateSettings | ||
data: | ||
type: object | ||
description: Parameters | ||
required: | ||
- plugins | ||
properties: | ||
parameters: | ||
type: array | ||
items: | ||
$ref: ../../components/schemas/plugins-settings.yml | ||
tags: | ||
- Plugins | ||
x-codeSamples: | ||
- lang: curl | ||
source: | ||
$ref: ../../code_samples/curl/plugins/set-plugins-settings.sh |
Oops, something went wrong.