Skip to content

Commit

Permalink
Merge pull request #5394 from microsoft/chore/update-cli-specs-with-a…
Browse files Browse the repository at this point in the history
…uth-options

docs: Update CLI specs for `plugin add` and `edit` commands with auth options
  • Loading branch information
samwelkanda authored Sep 11, 2024
2 parents 8e4ade3 + ae96990 commit 217d3ec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 7 additions & 2 deletions specs/cli/plugin-add.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ For `apimanifest`, the generated file will be named `{plugin-name}-apimanifest.j
| `--include-path \| -i` | No | /repos/{owner}/{repo} | A glob pattern to include paths from generation. Accepts multiple values. Defaults to no value which includes everything. | Yes, without its value |
| `--exclude-path \| -e` | No | /advisories | A glob pattern to exclude paths from generation. Accepts multiple values. Defaults to no value which excludes nothing. | Yes, without its value |
| `--type \| -t` | Yes | openai | The target type of plugin for the generated output files. Accepts multiple values. Possible values are `apiplugin`, `openai` and `apimanifest`.| Yes |
| `--authentication-type \| --at` | No | oauth2 | The authentication type that will be used to connect to the API. Accepts a single value corresponding to a supported OpenAPI security scheme. Possible values are `apikey`, `http`, `oauth2` and `openidconnect`.| |
| `--authentication-ref-id \| --refid` | No | xxxxxxxx | The authentication reference id that will be used to connect to the API. Accepts a single string value.| |
| `--skip-generation \| --sg` | No | true | When specified, the generation would be skipped. Defaults to false. | Yes |
| `--output \| -o` | No | ./generated/plugins/github | The output directory or file path for the generated output files. This is relative to the location of `workspace.json`. Defaults to `./output`. | Yes, without its value |

Expand All @@ -95,7 +97,7 @@ For `apimanifest`, the generated file will be named `{plugin-name}-apimanifest.j
## Using `kiota plugin add`

```bash
kiota plugin add --plugins-name "GitHub" --openapi "https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json" --include-path "/repos/{owner}/{repo}" --type apiplugin, apimanifest --output "./generated/plugins/github"
kiota plugin add --plugins-name "GitHub" --openapi "https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json" --include-path "/repos/{owner}/{repo}" --type apiplugin, apimanifest --authentication-type "oauth2" --authentication-ref-id "somerefid" --output "./generated/plugins/github"
```

_The resulting `workspace.json` file will look like this:_
Expand All @@ -106,6 +108,8 @@ _The resulting `workspace.json` file will look like this:_
"clients": {...}, //if any
"plugins": {
"GitHub": {
"authType": "OAuthPluginVault",
"authReferenceId": "somerefid",
"descriptionLocation": "https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json",
"includePatterns": ["/repos/{owner}/{repo}"],
"excludePatterns": [],
Expand Down Expand Up @@ -150,7 +154,8 @@ _The resulting API Plugin named `github-apiplugin.json` will look like this:_
{
"type": "OpenApi",
"auth": {
"type": "None"
"type": "OAuthPluginVault",
"reference_id": "somerefid"
},
"spec": {
"url": "githubreposowner-openapi.yml"
Expand Down
7 changes: 6 additions & 1 deletion specs/cli/plugin-edit.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Once the `workspace.json` file and the API Manifest are updated, the code genera
| `--include-path \| -i` | No | /repos/{owner}/{repo} | A glob pattern to include paths from generation. Accepts multiple values. Defaults to no value which includes everything. | Yes, without its value |
| `--exclude-path \| -e` | No | /repos/{owner}/{repo}#DELETE | A glob pattern to exclude paths from generation. Accepts multiple values. Defaults to no value which excludes nothing. | Yes, without its value |
| `--type \| -t` | Yes | openai | The target type of plugin for the generated output files. Accepts multiple values. Possible values are `apiplugin`, `openai` and `apimanifest`.| Yes |
| `--authentication-type \| --at` | No | oauth2 | The authentication type that will be used to connect to the API. Accepts a single value corresponding to a supported OpenAPI security scheme. Possible values are `apikey`, `http`, `oauth2` and `openidconnect`.| |
| `--authentication-ref-id \| --refid` | No | xxxxxxxx | The authentication reference id that will be used to connect to the API. Accepts a single string value.| |
| `--skip-generation \| --sg` | No | true | When specified, the generation would be skipped. Defaults to false. | Yes |
| `--output \| -o` | No | ./generated/plugins/github | The output directory or file path for the generated output files. This is relative to the current working directory. Defaults to `./output`. | Yes, without its value |

Expand All @@ -39,6 +41,8 @@ _The resulting `workspace.json` file will look like this:_
"clients": {...}, //if any
"plugins": {
"GitHub": {
"authType": "OAuthPluginVault",
"authReferenceId": "somerefid",
"descriptionLocation": "https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json",
"includePatterns": ["/repos/{owner}/{repo}"],
"excludePatterns": ["/repos/{owner}/{repo}#DELETE"],
Expand Down Expand Up @@ -79,7 +83,8 @@ _The resulting API Plugin named `github-apiplugin.json` will look like this:_
{
"type": "OpenApi",
"auth": {
"type": "None"
"type": "OAuthPluginVault",
"reference_id": "somerefid"
},
"spec": {
"url": "githubreposowner-openapi.yml"
Expand Down

0 comments on commit 217d3ec

Please sign in to comment.