-
Notifications
You must be signed in to change notification settings - Fork 25
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 display attributes for OpenAPI OperationID's #172
Conversation
userAgentPluginName = "auth-gcp" | ||
|
||
// operationPrefixGoogleCloud is used as a prefix for OpenAPI operation id's. | ||
operationPrefixGoogleCloud = "google-cloud" |
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.
Is this the consistent naming throughout? vs GCP
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 is how the plugin is referenced to in the docs. I felt gcp
might be too obscure but I'm happy to change this if folks feel strongly about it.
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.
I don't feel too strongly either way but maybe it would make sense to use gcp
since (1) that is how we reference it everywhere except for the docs and (2) the operationID is an ID so I think the only thing that really matters is uniqueness.
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.
(2) the operationID is an ID so I think the only thing that really matters is uniqueness.
The operationID
is translated directly into method names and struct names in the library generated code. For example google-cloud-list-roles
would be translated into:
func (a *Auth) GoogleCloudListRoles(ctx context.Context, options ...RequestOption) (*GoogleCloudListRolesResponse, error) {
...
}
vs
func (a *Auth) GcpListRoles(ctx context.Context, options ...RequestOption) (*GcpListRolesResponse, error) {
...
}
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.
Got it, thanks! google-cloud works for me!
@@ -217,6 +236,11 @@ func pathsRole(b *GcpAuthBackend) []*framework.Path { | |||
// Edit labels on an GCE role | |||
{ | |||
Pattern: fmt.Sprintf("role/%s/labels", framework.GenericNameRegex("name")), | |||
DisplayAttrs: &framework.DisplayAttributes{ | |||
OperationPrefix: operationPrefixGoogleCloud, | |||
OperationVerb: "edit", |
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 seems like a new OperationVerb, should this be update
for consistency?
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 operation edits the labels with "add" / "remove" arrays. The name is also from the docs
Overview
The display attributes added in this PR will be translated into OperationID's in vault-generated OpenAPI documents (when calling
/sys/internal/specs/openapi
with this plugin enabled). The OperationID's will, in turn, be translated into function / method names in generated OpenAPI-based libraries (e.g. hashicorp/vault-client-go & hashicorp/vault-client-dotnet).This PR will introduce the following OperationIDs:
Related Issues/Pull Requests