-
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
Changes from all commits
3c11915
13fd6b1
7675e0d
8d405ad
5a9f478
644c08c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,7 +158,11 @@ func pathsRole(b *GcpAuthBackend) []*framework.Path { | |
|
||
paths := []*framework.Path{ | ||
{ | ||
Pattern: fmt.Sprintf("role/%s", framework.GenericNameRegex("name")), | ||
Pattern: fmt.Sprintf("role/%s", framework.GenericNameRegex("name")), | ||
DisplayAttrs: &framework.DisplayAttributes{ | ||
OperationPrefix: operationPrefixGoogleCloud, | ||
OperationSuffix: "role", | ||
}, | ||
Fields: roleFieldSchema, | ||
ExistenceCheck: b.pathRoleExistenceCheck, | ||
Callbacks: map[logical.Operation]framework.OperationFunc{ | ||
|
@@ -173,6 +177,11 @@ func pathsRole(b *GcpAuthBackend) []*framework.Path { | |
// Paths for listing roles | ||
{ | ||
Pattern: "role/?", | ||
DisplayAttrs: &framework.DisplayAttributes{ | ||
OperationPrefix: operationPrefixGoogleCloud, | ||
OperationVerb: "list", | ||
OperationSuffix: "roles", | ||
}, | ||
Callbacks: map[logical.Operation]framework.OperationFunc{ | ||
logical.ListOperation: b.pathRoleList, | ||
}, | ||
|
@@ -182,6 +191,11 @@ func pathsRole(b *GcpAuthBackend) []*framework.Path { | |
}, | ||
{ | ||
Pattern: "roles/?", | ||
DisplayAttrs: &framework.DisplayAttributes{ | ||
OperationPrefix: operationPrefixGoogleCloud, | ||
OperationVerb: "list", | ||
OperationSuffix: "roles2", | ||
}, | ||
Callbacks: map[logical.Operation]framework.OperationFunc{ | ||
logical.ListOperation: b.pathRoleList, | ||
}, | ||
|
@@ -193,6 +207,11 @@ func pathsRole(b *GcpAuthBackend) []*framework.Path { | |
// Edit service accounts on an IAM role | ||
{ | ||
Pattern: fmt.Sprintf("role/%s/service-accounts", framework.GenericNameRegex("name")), | ||
DisplayAttrs: &framework.DisplayAttributes{ | ||
OperationPrefix: operationPrefixGoogleCloud, | ||
OperationVerb: "edit", | ||
OperationSuffix: "service-accounts-for-role", | ||
}, | ||
Fields: map[string]*framework.FieldSchema{ | ||
"name": { | ||
Type: framework.TypeString, | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. This seems like a new OperationVerb, should this be There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
OperationSuffix: "labels-for-role", | ||
}, | ||
Fields: map[string]*framework.FieldSchema{ | ||
"name": { | ||
Type: framework.TypeString, | ||
|
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.
The
operationID
is translated directly into method names and struct names in the library generated code. For examplegoogle-cloud-list-roles
would be translated into:vs
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!