From 28bb344b695b314732304214c186dcebac3d6dcc Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Thu, 4 Mar 2021 08:10:31 +0100 Subject: [PATCH] Change AuthClient res. type strings to kebab-case --- system/service/access_control.go | 2 +- system/service/auth_client_actions.gen.go | 68 +++++++++---------- system/service/auth_client_actions.yaml | 2 +- .../event/{authClient.go => auth_client.go} | 0 system/service/event/events.gen.go | 32 ++++----- system/service/event/events.yaml | 2 +- 6 files changed, 53 insertions(+), 53 deletions(-) rename system/service/event/{authClient.go => auth_client.go} (100%) diff --git a/system/service/access_control.go b/system/service/access_control.go index 7c0f4a7ab..e96e9bb15 100644 --- a/system/service/access_control.go +++ b/system/service/access_control.go @@ -268,7 +268,7 @@ func (svc accessControl) Whitelist() rbac.Whitelist { "grant", "settings.read", "settings.manage", - "authClient.create", + "auth-client.create", "role.create", "user.create", "application.create", diff --git a/system/service/auth_client_actions.gen.go b/system/service/auth_client_actions.gen.go index 89019b446..cdebd1f59 100644 --- a/system/service/auth_client_actions.gen.go +++ b/system/service/auth_client_actions.gen.go @@ -242,14 +242,14 @@ func (e *authClientAction) ToAction() *actionlog.Action { // ********************************************************************************************************************* // Action constructors -// AuthClientActionSearch returns "system:authClient.search" action +// AuthClientActionSearch returns "system:auth-client.search" action // // This function is auto-generated. // func AuthClientActionSearch(props ...*authClientActionProps) *authClientAction { a := &authClientAction{ timestamp: time.Now(), - resource: "system:authClient", + resource: "system:auth-client", action: "search", log: "searched for auth clients", severity: actionlog.Info, @@ -262,14 +262,14 @@ func AuthClientActionSearch(props ...*authClientActionProps) *authClientAction { return a } -// AuthClientActionLookup returns "system:authClient.lookup" action +// AuthClientActionLookup returns "system:auth-client.lookup" action // // This function is auto-generated. // func AuthClientActionLookup(props ...*authClientActionProps) *authClientAction { a := &authClientAction{ timestamp: time.Now(), - resource: "system:authClient", + resource: "system:auth-client", action: "lookup", log: "looked-up for a {authClient}", severity: actionlog.Info, @@ -282,14 +282,14 @@ func AuthClientActionLookup(props ...*authClientActionProps) *authClientAction { return a } -// AuthClientActionCreate returns "system:authClient.create" action +// AuthClientActionCreate returns "system:auth-client.create" action // // This function is auto-generated. // func AuthClientActionCreate(props ...*authClientActionProps) *authClientAction { a := &authClientAction{ timestamp: time.Now(), - resource: "system:authClient", + resource: "system:auth-client", action: "create", log: "created {authClient}", severity: actionlog.Notice, @@ -302,14 +302,14 @@ func AuthClientActionCreate(props ...*authClientActionProps) *authClientAction { return a } -// AuthClientActionUpdate returns "system:authClient.update" action +// AuthClientActionUpdate returns "system:auth-client.update" action // // This function is auto-generated. // func AuthClientActionUpdate(props ...*authClientActionProps) *authClientAction { a := &authClientAction{ timestamp: time.Now(), - resource: "system:authClient", + resource: "system:auth-client", action: "update", log: "updated {authClient}", severity: actionlog.Notice, @@ -322,14 +322,14 @@ func AuthClientActionUpdate(props ...*authClientActionProps) *authClientAction { return a } -// AuthClientActionDelete returns "system:authClient.delete" action +// AuthClientActionDelete returns "system:auth-client.delete" action // // This function is auto-generated. // func AuthClientActionDelete(props ...*authClientActionProps) *authClientAction { a := &authClientAction{ timestamp: time.Now(), - resource: "system:authClient", + resource: "system:auth-client", action: "delete", log: "deleted {authClient}", severity: actionlog.Notice, @@ -342,14 +342,14 @@ func AuthClientActionDelete(props ...*authClientActionProps) *authClientAction { return a } -// AuthClientActionUndelete returns "system:authClient.undelete" action +// AuthClientActionUndelete returns "system:auth-client.undelete" action // // This function is auto-generated. // func AuthClientActionUndelete(props ...*authClientActionProps) *authClientAction { a := &authClientAction{ timestamp: time.Now(), - resource: "system:authClient", + resource: "system:auth-client", action: "undelete", log: "undeleted {authClient}", severity: actionlog.Notice, @@ -362,14 +362,14 @@ func AuthClientActionUndelete(props ...*authClientActionProps) *authClientAction return a } -// AuthClientActionExposeSecret returns "system:authClient.exposeSecret" action +// AuthClientActionExposeSecret returns "system:auth-client.exposeSecret" action // // This function is auto-generated. // func AuthClientActionExposeSecret(props ...*authClientActionProps) *authClientAction { a := &authClientAction{ timestamp: time.Now(), - resource: "system:authClient", + resource: "system:auth-client", action: "exposeSecret", log: "secret exposed", severity: actionlog.Notice, @@ -382,14 +382,14 @@ func AuthClientActionExposeSecret(props ...*authClientActionProps) *authClientAc return a } -// AuthClientActionRegenerateSecret returns "system:authClient.regenerateSecret" action +// AuthClientActionRegenerateSecret returns "system:auth-client.regenerateSecret" action // // This function is auto-generated. // func AuthClientActionRegenerateSecret(props ...*authClientActionProps) *authClientAction { a := &authClientAction{ timestamp: time.Now(), - resource: "system:authClient", + resource: "system:auth-client", action: "regenerateSecret", log: "secret regenerated", severity: actionlog.Notice, @@ -406,7 +406,7 @@ func AuthClientActionRegenerateSecret(props ...*authClientActionProps) *authClie // ********************************************************************************************************************* // Error constructors -// AuthClientErrGeneric returns "system:authClient.generic" as *errors.Error +// AuthClientErrGeneric returns "system:auth-client.generic" as *errors.Error // // // This function is auto-generated. @@ -423,7 +423,7 @@ func AuthClientErrGeneric(mm ...*authClientActionProps) *errors.Error { p.Format("failed to complete request due to internal error", nil), errors.Meta("type", "generic"), - errors.Meta("resource", "system:authClient"), + errors.Meta("resource", "system:auth-client"), // action log entry; no formatting, it will be applied inside recordAction fn. errors.Meta(authClientLogMetaKey{}, "{err}"), @@ -438,7 +438,7 @@ func AuthClientErrGeneric(mm ...*authClientActionProps) *errors.Error { return e } -// AuthClientErrNotFound returns "system:authClient.notFound" as *errors.Error +// AuthClientErrNotFound returns "system:auth-client.notFound" as *errors.Error // // // This function is auto-generated. @@ -455,7 +455,7 @@ func AuthClientErrNotFound(mm ...*authClientActionProps) *errors.Error { p.Format("auth client not found", nil), errors.Meta("type", "notFound"), - errors.Meta("resource", "system:authClient"), + errors.Meta("resource", "system:auth-client"), errors.Meta(authClientPropsMetaKey{}, p), @@ -468,7 +468,7 @@ func AuthClientErrNotFound(mm ...*authClientActionProps) *errors.Error { return e } -// AuthClientErrInvalidID returns "system:authClient.invalidID" as *errors.Error +// AuthClientErrInvalidID returns "system:auth-client.invalidID" as *errors.Error // // // This function is auto-generated. @@ -485,7 +485,7 @@ func AuthClientErrInvalidID(mm ...*authClientActionProps) *errors.Error { p.Format("invalid ID", nil), errors.Meta("type", "invalidID"), - errors.Meta("resource", "system:authClient"), + errors.Meta("resource", "system:auth-client"), errors.Meta(authClientPropsMetaKey{}, p), @@ -498,7 +498,7 @@ func AuthClientErrInvalidID(mm ...*authClientActionProps) *errors.Error { return e } -// AuthClientErrNotAllowedToRead returns "system:authClient.notAllowedToRead" as *errors.Error +// AuthClientErrNotAllowedToRead returns "system:auth-client.notAllowedToRead" as *errors.Error // // // This function is auto-generated. @@ -515,7 +515,7 @@ func AuthClientErrNotAllowedToRead(mm ...*authClientActionProps) *errors.Error { p.Format("not allowed to read this auth client", nil), errors.Meta("type", "notAllowedToRead"), - errors.Meta("resource", "system:authClient"), + errors.Meta("resource", "system:auth-client"), // action log entry; no formatting, it will be applied inside recordAction fn. errors.Meta(authClientLogMetaKey{}, "failed to read {authClient}; insufficient permissions"), @@ -530,7 +530,7 @@ func AuthClientErrNotAllowedToRead(mm ...*authClientActionProps) *errors.Error { return e } -// AuthClientErrNotAllowedToListAuthClients returns "system:authClient.notAllowedToListAuthClients" as *errors.Error +// AuthClientErrNotAllowedToListAuthClients returns "system:auth-client.notAllowedToListAuthClients" as *errors.Error // // // This function is auto-generated. @@ -547,7 +547,7 @@ func AuthClientErrNotAllowedToListAuthClients(mm ...*authClientActionProps) *err p.Format("not allowed to list auth clients", nil), errors.Meta("type", "notAllowedToListAuthClients"), - errors.Meta("resource", "system:authClient"), + errors.Meta("resource", "system:auth-client"), // action log entry; no formatting, it will be applied inside recordAction fn. errors.Meta(authClientLogMetaKey{}, "failed to list authClient; insufficient permissions"), @@ -562,7 +562,7 @@ func AuthClientErrNotAllowedToListAuthClients(mm ...*authClientActionProps) *err return e } -// AuthClientErrNotAllowedToCreate returns "system:authClient.notAllowedToCreate" as *errors.Error +// AuthClientErrNotAllowedToCreate returns "system:auth-client.notAllowedToCreate" as *errors.Error // // // This function is auto-generated. @@ -579,7 +579,7 @@ func AuthClientErrNotAllowedToCreate(mm ...*authClientActionProps) *errors.Error p.Format("not allowed to create auth clients", nil), errors.Meta("type", "notAllowedToCreate"), - errors.Meta("resource", "system:authClient"), + errors.Meta("resource", "system:auth-client"), // action log entry; no formatting, it will be applied inside recordAction fn. errors.Meta(authClientLogMetaKey{}, "failed to create authClient; insufficient permissions"), @@ -594,7 +594,7 @@ func AuthClientErrNotAllowedToCreate(mm ...*authClientActionProps) *errors.Error return e } -// AuthClientErrNotAllowedToUpdate returns "system:authClient.notAllowedToUpdate" as *errors.Error +// AuthClientErrNotAllowedToUpdate returns "system:auth-client.notAllowedToUpdate" as *errors.Error // // // This function is auto-generated. @@ -611,7 +611,7 @@ func AuthClientErrNotAllowedToUpdate(mm ...*authClientActionProps) *errors.Error p.Format("not allowed to update this auth client", nil), errors.Meta("type", "notAllowedToUpdate"), - errors.Meta("resource", "system:authClient"), + errors.Meta("resource", "system:auth-client"), // action log entry; no formatting, it will be applied inside recordAction fn. errors.Meta(authClientLogMetaKey{}, "failed to update {authClient}; insufficient permissions"), @@ -626,7 +626,7 @@ func AuthClientErrNotAllowedToUpdate(mm ...*authClientActionProps) *errors.Error return e } -// AuthClientErrNotAllowedToDelete returns "system:authClient.notAllowedToDelete" as *errors.Error +// AuthClientErrNotAllowedToDelete returns "system:auth-client.notAllowedToDelete" as *errors.Error // // // This function is auto-generated. @@ -643,7 +643,7 @@ func AuthClientErrNotAllowedToDelete(mm ...*authClientActionProps) *errors.Error p.Format("not allowed to delete this auth client", nil), errors.Meta("type", "notAllowedToDelete"), - errors.Meta("resource", "system:authClient"), + errors.Meta("resource", "system:auth-client"), // action log entry; no formatting, it will be applied inside recordAction fn. errors.Meta(authClientLogMetaKey{}, "failed to delete {authClient}; insufficient permissions"), @@ -658,7 +658,7 @@ func AuthClientErrNotAllowedToDelete(mm ...*authClientActionProps) *errors.Error return e } -// AuthClientErrNotAllowedToUndelete returns "system:authClient.notAllowedToUndelete" as *errors.Error +// AuthClientErrNotAllowedToUndelete returns "system:auth-client.notAllowedToUndelete" as *errors.Error // // // This function is auto-generated. @@ -675,7 +675,7 @@ func AuthClientErrNotAllowedToUndelete(mm ...*authClientActionProps) *errors.Err p.Format("not allowed to undelete this auth client", nil), errors.Meta("type", "notAllowedToUndelete"), - errors.Meta("resource", "system:authClient"), + errors.Meta("resource", "system:auth-client"), // action log entry; no formatting, it will be applied inside recordAction fn. errors.Meta(authClientLogMetaKey{}, "failed to undelete {authClient}; insufficient permissions"), diff --git a/system/service/auth_client_actions.yaml b/system/service/auth_client_actions.yaml index f6eae1a70..86174afae 100644 --- a/system/service/auth_client_actions.yaml +++ b/system/service/auth_client_actions.yaml @@ -1,6 +1,6 @@ # List of loggable service actions -resource: system:authClient +resource: system:auth-client service: authClient # Default sensitivity for actions diff --git a/system/service/event/authClient.go b/system/service/event/auth_client.go similarity index 100% rename from system/service/event/authClient.go rename to system/service/event/auth_client.go diff --git a/system/service/event/events.gen.go b/system/service/event/events.gen.go index 6ae6a4f4f..362eed263 100644 --- a/system/service/event/events.gen.go +++ b/system/service/event/events.gen.go @@ -1203,11 +1203,11 @@ func (res *authBase) Decode(results map[string][]byte) (err error) { return } -// ResourceType returns "system:authClient" +// ResourceType returns "system:auth-client" // // This function is auto-generated. func (authClientBase) ResourceType() string { - return "system:authClient" + return "system:auth-client" } // EventType on authClientOnManual returns "onManual" @@ -1259,7 +1259,7 @@ func (authClientAfterDelete) EventType() string { return "afterDelete" } -// AuthClientOnManual creates onManual for system:authClient resource +// AuthClientOnManual creates onManual for system:auth-client resource // // This function is auto-generated. func AuthClientOnManual( @@ -1275,7 +1275,7 @@ func AuthClientOnManual( } } -// AuthClientOnManualImmutable creates onManual for system:authClient resource +// AuthClientOnManualImmutable creates onManual for system:auth-client resource // // None of the arguments will be mutable! // @@ -1293,7 +1293,7 @@ func AuthClientOnManualImmutable( } } -// AuthClientBeforeCreate creates beforeCreate for system:authClient resource +// AuthClientBeforeCreate creates beforeCreate for system:auth-client resource // // This function is auto-generated. func AuthClientBeforeCreate( @@ -1309,7 +1309,7 @@ func AuthClientBeforeCreate( } } -// AuthClientBeforeCreateImmutable creates beforeCreate for system:authClient resource +// AuthClientBeforeCreateImmutable creates beforeCreate for system:auth-client resource // // None of the arguments will be mutable! // @@ -1327,7 +1327,7 @@ func AuthClientBeforeCreateImmutable( } } -// AuthClientBeforeUpdate creates beforeUpdate for system:authClient resource +// AuthClientBeforeUpdate creates beforeUpdate for system:auth-client resource // // This function is auto-generated. func AuthClientBeforeUpdate( @@ -1343,7 +1343,7 @@ func AuthClientBeforeUpdate( } } -// AuthClientBeforeUpdateImmutable creates beforeUpdate for system:authClient resource +// AuthClientBeforeUpdateImmutable creates beforeUpdate for system:auth-client resource // // None of the arguments will be mutable! // @@ -1361,7 +1361,7 @@ func AuthClientBeforeUpdateImmutable( } } -// AuthClientBeforeDelete creates beforeDelete for system:authClient resource +// AuthClientBeforeDelete creates beforeDelete for system:auth-client resource // // This function is auto-generated. func AuthClientBeforeDelete( @@ -1377,7 +1377,7 @@ func AuthClientBeforeDelete( } } -// AuthClientBeforeDeleteImmutable creates beforeDelete for system:authClient resource +// AuthClientBeforeDeleteImmutable creates beforeDelete for system:auth-client resource // // None of the arguments will be mutable! // @@ -1395,7 +1395,7 @@ func AuthClientBeforeDeleteImmutable( } } -// AuthClientAfterCreate creates afterCreate for system:authClient resource +// AuthClientAfterCreate creates afterCreate for system:auth-client resource // // This function is auto-generated. func AuthClientAfterCreate( @@ -1411,7 +1411,7 @@ func AuthClientAfterCreate( } } -// AuthClientAfterCreateImmutable creates afterCreate for system:authClient resource +// AuthClientAfterCreateImmutable creates afterCreate for system:auth-client resource // // None of the arguments will be mutable! // @@ -1429,7 +1429,7 @@ func AuthClientAfterCreateImmutable( } } -// AuthClientAfterUpdate creates afterUpdate for system:authClient resource +// AuthClientAfterUpdate creates afterUpdate for system:auth-client resource // // This function is auto-generated. func AuthClientAfterUpdate( @@ -1445,7 +1445,7 @@ func AuthClientAfterUpdate( } } -// AuthClientAfterUpdateImmutable creates afterUpdate for system:authClient resource +// AuthClientAfterUpdateImmutable creates afterUpdate for system:auth-client resource // // None of the arguments will be mutable! // @@ -1463,7 +1463,7 @@ func AuthClientAfterUpdateImmutable( } } -// AuthClientAfterDelete creates afterDelete for system:authClient resource +// AuthClientAfterDelete creates afterDelete for system:auth-client resource // // This function is auto-generated. func AuthClientAfterDelete( @@ -1479,7 +1479,7 @@ func AuthClientAfterDelete( } } -// AuthClientAfterDeleteImmutable creates afterDelete for system:authClient resource +// AuthClientAfterDeleteImmutable creates afterDelete for system:auth-client resource // // None of the arguments will be mutable! // diff --git a/system/service/event/events.yaml b/system/service/event/events.yaml index 59f049d24..3fffbf1bc 100644 --- a/system/service/event/events.yaml +++ b/system/service/event/events.yaml @@ -24,7 +24,7 @@ system:auth: - name: 'provider' type: '*types.AuthProvider' -system:authClient: +system:auth-client: on: ['manual'] ba: ['create', 'update', 'delete'] props: