-
Notifications
You must be signed in to change notification settings - Fork 18.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add API documentation for plugable secret backends #34202
Add API documentation for plugable secret backends #34202
Conversation
api/swagger.yaml
Outdated
Driver: | ||
description: "Driver represents a driver (network, logging, secrets)." | ||
type: "object" | ||
required: [Name, Data] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
janky failure looks related.
09:58:42 - The swagger spec at "api/swagger.yaml" is invalid against swagger specification 2.0. see errors :
09:58:42 - "Data" is present in required but not defined as property in definition "Driver"
09:58:42 - /secrets/{id}.Spec.Driver.Data in body is required
Q: I haven't looked at the swagger.yaml before, but I'm guessing Data is supposed to Options here, which is based off
moby/api/types/swarm/common.go
Line 23 in 0304c98
// Driver represents a driver (network, logging). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, hm, looks like I may have copy/pasted the Data
yes thanks, I'll check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think Data
/ Options
is required here, so I'll remove
cb04757
to
22c654e
Compare
ping @liron-l @cpuguy83 @vdemeester PTAL |
api/swagger.yaml
Outdated
type: "string" | ||
x-nullable: false | ||
example: "some-driver" | ||
Options: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider
description: "key/value map of driver specific options."
(same as DriverConfig.Options)
docs/api/version-history.md
Outdated
@@ -19,6 +19,14 @@ keywords: "API, Docker, rcli, REST, documentation" | |||
|
|||
* `DELETE /secrets/(name)` now returns status code 404 instead of 500 when the secret does not exist. | |||
* `POST /secrets/create` now returns status code 409 instead of 500 when creating an already existing secret. | |||
* `POST /secrets/create` now accepts a `Driver` struct, allowing the | |||
`Name` and diver-specific `Options` to be passed to store a secrets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diver-specific -> driver-specific (here and below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch :)
LGTM @thaJeztah, left some minor comments inline. |
22c654e
to
9f19ba7
Compare
@liron-l thanks, I updated. Question: do you know;
TL;DR I'd like to document what are acceptable values for the |
Thanks @thaJeztah. Finally, if we do add such restrictions on the name, I know that plguins names need to have versioning support ( |
Ah, right, yes, these are managed plugins (installed through |
Yes, @thaJeztah, secret plugins are managed plugins. We will add dedicated documentation and examples after all relevant commits are merged. |
api/swagger.yaml
Outdated
additionalProperties: | ||
type: "string" | ||
example: | ||
"value for driver-specific option" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This formatting seems wrong. I think there's a key missing here on the newline?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, this is odd, yes, definitely should be fixed 👍
data to store as secret. | ||
|
||
This field is only used to _create_ a secret, and is not returned by | ||
other endpoints. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, we should probably have two different types then. One without this field. Since this already exited we can wait for another PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes; while working on these changes in the Swagger, I found other types that are reused and don't make sense
I think this is an "omitempty" (so in practice it's not there), but yes, probably should have a separate type
422c690
to
417a9a7
Compare
Data: | ||
description: "Base64-url-safe-encoded secret data" | ||
type: "array" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
417a9a7
to
c8dad44
Compare
@dnephin updated PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🐸
Documents the API changes introduced in
0304c98 (#34157) and 08f7cf0 (#34123)
- What I did
- How I did it
- How to verify it
run
make swagger-docs
and visit http://localhost:9000 to view the docsping @liron-l @cpuguy83 @vdemeester PTAL