@@ -13,6 +13,7 @@ import (
1313 g "gitlab.com/gitlab-org/api/client-go"
1414
1515 "github.com/ilijamt/vault-plugin-secrets-gitlab/internal/errs"
16+ "github.com/ilijamt/vault-plugin-secrets-gitlab/internal/event"
1617 "github.com/ilijamt/vault-plugin-secrets-gitlab/internal/gitlab"
1718)
1819
@@ -91,7 +92,7 @@ func (b *Backend) pathConfigDelete(ctx context.Context, req *logical.Request, da
9192 }
9293
9394 if err = req .Storage .Delete (ctx , fmt .Sprintf ("%s/%s" , PathConfigStorage , name )); err == nil {
94- Event (ctx , b .Backend , "config-delete" , map [string ]string {
95+ event . Event (ctx , b .Backend , operationPrefixGitlabAccessTokens , "config-delete" , map [string ]string {
9596 "path" : fmt .Sprintf ("%s/%s" , PathConfigStorage , name ),
9697 })
9798 b .SetClient (nil , name )
@@ -146,7 +147,7 @@ func (b *Backend) pathConfigPatch(ctx context.Context, req *logical.Request, dat
146147 defer b .lockClientMutex .Unlock ()
147148 if err = saveConfig (ctx , * config , req .Storage ); err == nil {
148149 lrd := config .LogicalResponseData (b .flags .ShowConfigToken )
149- Event (ctx , b .Backend , "config-patch" , changes )
150+ event . Event (ctx , b .Backend , operationPrefixGitlabAccessTokens , "config-patch" , changes )
150151 b .SetClient (nil , name )
151152 b .Logger ().Debug ("Patched config" , "lrd" , lrd , "warnings" , warnings )
152153 lResp = & logical.Response {Data : lrd , Warnings : warnings }
@@ -205,7 +206,7 @@ func (b *Backend) pathConfigWrite(ctx context.Context, req *logical.Request, dat
205206 var lResp * logical.Response
206207
207208 if err = saveConfig (ctx , * config , req .Storage ); err == nil {
208- Event (ctx , b .Backend , "config-write" , map [string ]string {
209+ event . Event (ctx , b .Backend , operationPrefixGitlabAccessTokens , "config-write" , map [string ]string {
209210 "path" : fmt .Sprintf ("%s/%s" , PathConfigStorage , name ),
210211 "auto_rotate_token" : strconv .FormatBool (config .AutoRotateToken ),
211212 "auto_rotate_before" : config .AutoRotateBefore .String (),
0 commit comments