Skip to content

Commit

Permalink
Docs: Document plugin authentication in metadata schema (grafana#32703)
Browse files Browse the repository at this point in the history
* Update plugin schema

* Fix review comments
  • Loading branch information
marcusolsson authored Apr 8, 2021
1 parent 7a2ab93 commit f345459
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 39 deletions.
46 changes: 24 additions & 22 deletions docs/sources/developers/plugins/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,46 +197,48 @@ For data source plugins. Token authentication section used with an JWT OAuth API

#### Properties

| Property | Type | Required | Description |
|----------|-------------------|----------|---------------------------------------------------------------------------|
| `params` | [object](#params) | No | For data source plugins. Parameters for the token authentication request. |
| `url` | string | No | For data source plugins. URL to fetch the JWT token. |
| Property | Type | Required | Description |
|----------|-------------------|----------|------------------------------------------------------|
| `params` | [object](#params) | No | Parameters for the JWT token authentication request. |
| `scopes` | string | No | |
| `url` | string | No | URL to fetch the JWT token. |

#### params

For data source plugins. Parameters for the token authentication request.
Parameters for the JWT token authentication request.

##### Properties

| Property | Type | Required | Description |
|-----------------|--------|----------|--------------------------------------------------------------------------------------------------------------------|
| `client_id` | string | No | For data source plugins. OAuth client id. |
| `client_secret` | string | No | For data source plugins. OAuth client secret. Usually populated by decrypting the secret from the SecureJson blob. |
| `grant_type` | string | No | For data source plugins. OAuth grant type. |
| `resource` | string | No | For data source plugins. OAuth resource. |
| Property | Type | Required | Description |
|----------------|----------|----------|-------------|
| `client_email` | string | No | |
| `private_key` | string | No | |
| `scopes` | string[] | No | |
| `token_uri` | string | No | |

### tokenAuth

For data source plugins. Token authentication section used with an OAuth API.

#### Properties

| Property | Type | Required | Description |
|----------|-------------------|----------|---------------------------------------------------------------------------|
| `params` | [object](#params) | No | For data source plugins. Parameters for the token authentication request. |
| `url` | string | No | For data source plugins. URL to fetch the authentication token. |
| Property | Type | Required | Description |
|----------|-------------------|----------|--------------------------------------------------|
| `params` | [object](#params) | No | Parameters for the token authentication request. |
| `scopes` | string | No | |
| `url` | string | No | URL to fetch the authentication token. |

#### params

For data source plugins. Parameters for the token authentication request.
Parameters for the token authentication request.

##### Properties

| Property | Type | Required | Description |
|-----------------|--------|----------|--------------------------------------------------------------------------------------------------------------------|
| `client_id` | string | No | For data source plugins. OAuth client id. |
| `client_secret` | string | No | For data source plugins. OAuth client secret. Usually populated by decrypting the secret from the SecureJson blob. |
| `grant_type` | string | No | For data source plugins. OAuth grant type. |
| `resource` | string | No | For data source plugins. OAuth resource. |
| Property | Type | Required | Description |
|-----------------|--------|----------|-------------------------------------------------------------------------------------------|
| `client_id` | string | No | OAuth client ID |
| `client_secret` | string | No | OAuth client secret. Usually populated by decrypting the secret from the SecureJson blob. |
| `grant_type` | string | No | OAuth grant type |
| `resource` | string | No | OAuth resource |


45 changes: 28 additions & 17 deletions docs/sources/developers/plugins/plugin.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -361,28 +361,32 @@
"properties": {
"url": {
"type": "string",
"description": "For data source plugins. URL to fetch the authentication token."
"description": "URL to fetch the authentication token."
},
"scopes": {
"type": "string",
"description": ""
},
"params": {
"type": "object",
"description": "For data source plugins. Parameters for the token authentication request.",
"description": "Parameters for the token authentication request.",
"additionalProperties": false,
"properties": {
"grant_type": {
"type": "string",
"description": "For data source plugins. OAuth grant type."
"description": "OAuth grant type"
},
"client_id": {
"type": "string",
"description": "For data source plugins. OAuth client id."
"description": "OAuth client ID"
},
"client_secret": {
"type": "string",
"description": "For data source plugins. OAuth client secret. Usually populated by decrypting the secret from the SecureJson blob."
"description": "OAuth client secret. Usually populated by decrypting the secret from the SecureJson blob."
},
"resource": {
"type": "string",
"description": "For data source plugins. OAuth resource."
"description": "OAuth resource"
}
}
}
Expand All @@ -395,29 +399,36 @@
"properties": {
"url": {
"type": "string",
"description": "For data source plugins. URL to fetch the JWT token.",
"description": "URL to fetch the JWT token.",
"format": "uri"
},
"scopes": {
"type": "string",
"description": ""
},
"params": {
"type": "object",
"description": "For data source plugins. Parameters for the token authentication request.",
"description": "Parameters for the JWT token authentication request.",
"additionalProperties": false,
"properties": {
"grant_type": {
"type": "string",
"description": "For data source plugins. OAuth grant type."
"scopes": {
"type": "array",
"description": "",
"items": {
"type": "string"
}
},
"client_id": {
"token_uri": {
"type": "string",
"description": "For data source plugins. OAuth client id."
"description": ""
},
"client_secret": {
"client_email": {
"type": "string",
"description": "For data source plugins. OAuth client secret. Usually populated by decrypting the secret from the SecureJson blob."
"description": ""
},
"resource": {
"private_key": {
"type": "string",
"description": "For data source plugins. OAuth resource."
"description": ""
}
}
}
Expand Down
Empty file added metadata.md
Empty file.

0 comments on commit f345459

Please sign in to comment.