openapi: Add display attributes for identity/group (#19762)
This commit is contained in:
parent
4b94669779
commit
31e123f7a0
|
@ -19,6 +19,13 @@ func groupAliasPaths(i *IdentityStore) []*framework.Path {
|
||||||
return []*framework.Path{
|
return []*framework.Path{
|
||||||
{
|
{
|
||||||
Pattern: "group-alias$",
|
Pattern: "group-alias$",
|
||||||
|
|
||||||
|
DisplayAttrs: &framework.DisplayAttributes{
|
||||||
|
OperationPrefix: "group",
|
||||||
|
OperationVerb: "create",
|
||||||
|
OperationSuffix: "alias",
|
||||||
|
},
|
||||||
|
|
||||||
Fields: map[string]*framework.FieldSchema{
|
Fields: map[string]*framework.FieldSchema{
|
||||||
"id": {
|
"id": {
|
||||||
Type: framework.TypeString,
|
Type: framework.TypeString,
|
||||||
|
@ -37,6 +44,7 @@ func groupAliasPaths(i *IdentityStore) []*framework.Path {
|
||||||
Description: "ID of the group to which this is an alias.",
|
Description: "ID of the group to which this is an alias.",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
Callbacks: map[logical.Operation]framework.OperationFunc{
|
Callbacks: map[logical.Operation]framework.OperationFunc{
|
||||||
logical.UpdateOperation: i.pathGroupAliasRegister(),
|
logical.UpdateOperation: i.pathGroupAliasRegister(),
|
||||||
},
|
},
|
||||||
|
@ -46,6 +54,12 @@ func groupAliasPaths(i *IdentityStore) []*framework.Path {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Pattern: "group-alias/id/" + framework.GenericNameRegex("id"),
|
Pattern: "group-alias/id/" + framework.GenericNameRegex("id"),
|
||||||
|
|
||||||
|
DisplayAttrs: &framework.DisplayAttributes{
|
||||||
|
OperationPrefix: "group",
|
||||||
|
OperationSuffix: "alias-by-id",
|
||||||
|
},
|
||||||
|
|
||||||
Fields: map[string]*framework.FieldSchema{
|
Fields: map[string]*framework.FieldSchema{
|
||||||
"id": {
|
"id": {
|
||||||
Type: framework.TypeString,
|
Type: framework.TypeString,
|
||||||
|
@ -64,10 +78,26 @@ func groupAliasPaths(i *IdentityStore) []*framework.Path {
|
||||||
Description: "ID of the group to which this is an alias.",
|
Description: "ID of the group to which this is an alias.",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Callbacks: map[logical.Operation]framework.OperationFunc{
|
|
||||||
logical.UpdateOperation: i.pathGroupAliasIDUpdate(),
|
Operations: map[logical.Operation]framework.OperationHandler{
|
||||||
logical.ReadOperation: i.pathGroupAliasIDRead(),
|
logical.UpdateOperation: &framework.PathOperation{
|
||||||
logical.DeleteOperation: i.pathGroupAliasIDDelete(),
|
Callback: i.pathGroupAliasIDUpdate(),
|
||||||
|
DisplayAttrs: &framework.DisplayAttributes{
|
||||||
|
OperationVerb: "update",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
logical.ReadOperation: &framework.PathOperation{
|
||||||
|
Callback: i.pathGroupAliasIDRead(),
|
||||||
|
DisplayAttrs: &framework.DisplayAttributes{
|
||||||
|
OperationVerb: "read",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
logical.DeleteOperation: &framework.PathOperation{
|
||||||
|
Callback: i.pathGroupAliasIDDelete(),
|
||||||
|
DisplayAttrs: &framework.DisplayAttributes{
|
||||||
|
OperationVerb: "delete",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
HelpSynopsis: strings.TrimSpace(groupAliasHelp["group-alias-by-id"][0]),
|
HelpSynopsis: strings.TrimSpace(groupAliasHelp["group-alias-by-id"][0]),
|
||||||
|
@ -75,6 +105,12 @@ func groupAliasPaths(i *IdentityStore) []*framework.Path {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Pattern: "group-alias/id/?$",
|
Pattern: "group-alias/id/?$",
|
||||||
|
|
||||||
|
DisplayAttrs: &framework.DisplayAttributes{
|
||||||
|
OperationPrefix: "group",
|
||||||
|
OperationSuffix: "aliases-by-id",
|
||||||
|
},
|
||||||
|
|
||||||
Callbacks: map[logical.Operation]framework.OperationFunc{
|
Callbacks: map[logical.Operation]framework.OperationFunc{
|
||||||
logical.ListOperation: i.pathGroupAliasIDList(),
|
logical.ListOperation: i.pathGroupAliasIDList(),
|
||||||
},
|
},
|
||||||
|
|
|
@ -62,7 +62,13 @@ func groupPaths(i *IdentityStore) []*framework.Path {
|
||||||
return []*framework.Path{
|
return []*framework.Path{
|
||||||
{
|
{
|
||||||
Pattern: "group$",
|
Pattern: "group$",
|
||||||
Fields: groupPathFields(),
|
|
||||||
|
DisplayAttrs: &framework.DisplayAttributes{
|
||||||
|
OperationPrefix: "group",
|
||||||
|
OperationVerb: "create",
|
||||||
|
},
|
||||||
|
|
||||||
|
Fields: groupPathFields(),
|
||||||
Callbacks: map[logical.Operation]framework.OperationFunc{
|
Callbacks: map[logical.Operation]framework.OperationFunc{
|
||||||
logical.UpdateOperation: i.pathGroupRegister(),
|
logical.UpdateOperation: i.pathGroupRegister(),
|
||||||
},
|
},
|
||||||
|
@ -72,11 +78,33 @@ func groupPaths(i *IdentityStore) []*framework.Path {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Pattern: "group/id/" + framework.GenericNameRegex("id"),
|
Pattern: "group/id/" + framework.GenericNameRegex("id"),
|
||||||
Fields: groupPathFields(),
|
|
||||||
Callbacks: map[logical.Operation]framework.OperationFunc{
|
DisplayAttrs: &framework.DisplayAttributes{
|
||||||
logical.UpdateOperation: i.pathGroupIDUpdate(),
|
OperationPrefix: "group",
|
||||||
logical.ReadOperation: i.pathGroupIDRead(),
|
OperationSuffix: "by-id",
|
||||||
logical.DeleteOperation: i.pathGroupIDDelete(),
|
},
|
||||||
|
|
||||||
|
Fields: groupPathFields(),
|
||||||
|
|
||||||
|
Operations: map[logical.Operation]framework.OperationHandler{
|
||||||
|
logical.UpdateOperation: &framework.PathOperation{
|
||||||
|
Callback: i.pathGroupIDUpdate(),
|
||||||
|
DisplayAttrs: &framework.DisplayAttributes{
|
||||||
|
OperationVerb: "update",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
logical.ReadOperation: &framework.PathOperation{
|
||||||
|
Callback: i.pathGroupIDRead(),
|
||||||
|
DisplayAttrs: &framework.DisplayAttributes{
|
||||||
|
OperationVerb: "read",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
logical.DeleteOperation: &framework.PathOperation{
|
||||||
|
Callback: i.pathGroupIDDelete(),
|
||||||
|
DisplayAttrs: &framework.DisplayAttributes{
|
||||||
|
OperationVerb: "delete",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
HelpSynopsis: strings.TrimSpace(groupHelp["group-by-id"][0]),
|
HelpSynopsis: strings.TrimSpace(groupHelp["group-by-id"][0]),
|
||||||
|
@ -84,6 +112,12 @@ func groupPaths(i *IdentityStore) []*framework.Path {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Pattern: "group/id/?$",
|
Pattern: "group/id/?$",
|
||||||
|
|
||||||
|
DisplayAttrs: &framework.DisplayAttributes{
|
||||||
|
OperationPrefix: "group",
|
||||||
|
OperationSuffix: "by-id",
|
||||||
|
},
|
||||||
|
|
||||||
Callbacks: map[logical.Operation]framework.OperationFunc{
|
Callbacks: map[logical.Operation]framework.OperationFunc{
|
||||||
logical.ListOperation: i.pathGroupIDList(),
|
logical.ListOperation: i.pathGroupIDList(),
|
||||||
},
|
},
|
||||||
|
@ -93,11 +127,33 @@ func groupPaths(i *IdentityStore) []*framework.Path {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Pattern: "group/name/(?P<name>.+)",
|
Pattern: "group/name/(?P<name>.+)",
|
||||||
Fields: groupPathFields(),
|
|
||||||
Callbacks: map[logical.Operation]framework.OperationFunc{
|
DisplayAttrs: &framework.DisplayAttributes{
|
||||||
logical.UpdateOperation: i.pathGroupNameUpdate(),
|
OperationPrefix: "group",
|
||||||
logical.ReadOperation: i.pathGroupNameRead(),
|
OperationSuffix: "by-name",
|
||||||
logical.DeleteOperation: i.pathGroupNameDelete(),
|
},
|
||||||
|
|
||||||
|
Fields: groupPathFields(),
|
||||||
|
|
||||||
|
Operations: map[logical.Operation]framework.OperationHandler{
|
||||||
|
logical.UpdateOperation: &framework.PathOperation{
|
||||||
|
Callback: i.pathGroupNameUpdate(),
|
||||||
|
DisplayAttrs: &framework.DisplayAttributes{
|
||||||
|
OperationVerb: "update",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
logical.ReadOperation: &framework.PathOperation{
|
||||||
|
Callback: i.pathGroupNameRead(),
|
||||||
|
DisplayAttrs: &framework.DisplayAttributes{
|
||||||
|
OperationVerb: "read",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
logical.DeleteOperation: &framework.PathOperation{
|
||||||
|
Callback: i.pathGroupNameDelete(),
|
||||||
|
DisplayAttrs: &framework.DisplayAttributes{
|
||||||
|
OperationVerb: "delete",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
HelpSynopsis: strings.TrimSpace(groupHelp["group-by-name"][0]),
|
HelpSynopsis: strings.TrimSpace(groupHelp["group-by-name"][0]),
|
||||||
|
@ -105,6 +161,12 @@ func groupPaths(i *IdentityStore) []*framework.Path {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Pattern: "group/name/?$",
|
Pattern: "group/name/?$",
|
||||||
|
|
||||||
|
DisplayAttrs: &framework.DisplayAttributes{
|
||||||
|
OperationPrefix: "group",
|
||||||
|
OperationSuffix: "by-name",
|
||||||
|
},
|
||||||
|
|
||||||
Callbacks: map[logical.Operation]framework.OperationFunc{
|
Callbacks: map[logical.Operation]framework.OperationFunc{
|
||||||
logical.ListOperation: i.pathGroupNameList(),
|
logical.ListOperation: i.pathGroupNameList(),
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue