@@ -150,7 +150,7 @@ func (a *akeylessSecretStore) BulkGetSecret(ctx context.Context, req secretstore
150150 defer wg .Done ()
151151 if len (staticItemNames ) == 1 {
152152 staticSecretName := staticItemNames [0 ]
153- value , err := a .GetSingleSecretValue (staticSecretName , AKEYLESS_SECRET_TYPE_STATIC_SECRET_RESPONSE )
153+ value , err := a .GetSingleSecretValue (staticSecretName , STATIC_SECRET_RESPONSE )
154154 secretResultChannels <- secretResultCollection {name : staticSecretName , value : value , err : err }
155155 } else {
156156 secretResponse := a .GetBulkStaticSecretValues (staticItemNames )
@@ -167,7 +167,7 @@ func (a *akeylessSecretStore) BulkGetSecret(ctx context.Context, req secretstore
167167 go func () {
168168 defer wg .Done ()
169169 for _ , item := range dynamicItemNames {
170- value , err := a .GetSingleSecretValue (item , AKEYLESS_SECRET_TYPE_DYNAMIC_SECRET_RESPONSE )
170+ value , err := a .GetSingleSecretValue (item , DYNAMIC_SECRET_RESPONSE )
171171 if err != nil {
172172 secretResultChannels <- secretResultCollection {name : item , value : "" , err : err }
173173 } else {
@@ -181,7 +181,7 @@ func (a *akeylessSecretStore) BulkGetSecret(ctx context.Context, req secretstore
181181 go func () {
182182 defer wg .Done ()
183183 for _ , item := range rotatedItemNames {
184- value , err := a .GetSingleSecretValue (item , AKEYLESS_SECRET_TYPE_ROTATED_SECRET_RESPONSE )
184+ value , err := a .GetSingleSecretValue (item , ROTATED_SECRET_RESPONSE )
185185 if err != nil {
186186 secretResultChannels <- secretResultCollection {name : item , value : "" , err : err }
187187 } else {
@@ -266,11 +266,11 @@ func (a *akeylessSecretStore) parseMetadata(meta secretstores.Metadata) (*akeyle
266266 a .logger .Debugf ("access type detected: %s" , accessTypeDisplayName )
267267
268268 switch accessTypeDisplayName {
269- case AKEYLESS_AUTH_DEFAULT_ACCESS_TYPE :
269+ case DEFAULT_AUTH_TYPE :
270270 if m .AccessKey == "" {
271271 return nil , errors .New ("accessKey is required" )
272272 }
273- case AKEYLESS_AUTH_ACCESS_JWT :
273+ case AUTH_JWT :
274274 if m .JWT == "" {
275275 return nil , errors .New ("jwt is required" )
276276 }
@@ -279,8 +279,8 @@ func (a *akeylessSecretStore) parseMetadata(meta secretstores.Metadata) (*akeyle
279279
280280 // Set default gateway URL if not specified
281281 if m .GatewayURL == "" {
282- a .logger .Infof ("Gateway URL is not set, using default value %s..." , AKEYLESS_PUBLIC_GATEWAY_URL )
283- m .GatewayURL = AKEYLESS_PUBLIC_GATEWAY_URL
282+ a .logger .Infof ("Gateway URL is not set, using default value %s..." , PUBLIC_GATEWAY_URL )
283+ m .GatewayURL = PUBLIC_GATEWAY_URL
284284 }
285285
286286 return & m , nil
@@ -309,7 +309,7 @@ func (a *akeylessSecretStore) GetSingleSecretValue(secretName string, secretType
309309 var err error
310310
311311 switch secretType {
312- case AKEYLESS_SECRET_TYPE_STATIC_SECRET_RESPONSE :
312+ case STATIC_SECRET_RESPONSE :
313313 getSecretValue := akeyless .NewGetSecretValue ([]string {secretName })
314314 getSecretValue .SetToken (a .token )
315315 secretRespMap , _ , apiErr := a .v2 .GetSecretValue (context .Background ()).Body (* getSecretValue ).Execute ()
@@ -333,7 +333,7 @@ func (a *akeylessSecretStore) GetSingleSecretValue(secretName string, secretType
333333 break
334334 }
335335
336- case AKEYLESS_SECRET_TYPE_DYNAMIC_SECRET_RESPONSE :
336+ case DYNAMIC_SECRET_RESPONSE :
337337 getDynamicSecretValue := akeyless .NewGetDynamicSecretValue (secretName )
338338 getDynamicSecretValue .SetToken (a .token )
339339 secretRespMap , _ , apiErr := a .v2 .GetDynamicSecretValue (context .Background ()).Body (* getDynamicSecretValue ).Execute ()
@@ -366,7 +366,7 @@ func (a *akeylessSecretStore) GetSingleSecretValue(secretName string, secretType
366366 // Return the value field directly (already a JSON string with credentials)
367367 secretValue = dynamicSecretResp .Value
368368
369- case AKEYLESS_SECRET_TYPE_ROTATED_SECRET_RESPONSE :
369+ case ROTATED_SECRET_RESPONSE :
370370 getRotatedSecretValue := akeyless .NewGetRotatedSecretValue (secretName )
371371 getRotatedSecretValue .SetToken (a .token )
372372 secretRespMap , _ , apiErr := a .v2 .GetRotatedSecretValue (context .Background ()).Body (* getRotatedSecretValue ).Execute ()
@@ -418,7 +418,7 @@ func (a *akeylessSecretStore) listItemsRecursively(path string) ([]akeyless.Item
418418 listItems .SetToken (a .token )
419419 listItems .SetPath (path )
420420 listItems .SetAutoPagination ("enabled" )
421- listItems .SetType ([] string { AKEYLESS_SECRET_TYPE_STATIC , AKEYLESS_SECRET_TYPE_DYNAMIC , AKEYLESS_SECRET_TYPE_ROTATED } )
421+ listItems .SetType (SUPPORTED_SECRET_TYPES )
422422
423423 // Execute the list items request
424424 a .logger .Debugf ("listing items from path '%s'..." , path )
@@ -462,18 +462,18 @@ func (a *akeylessSecretStore) Authenticate(metadata *akeylessMetadata) error {
462462 // Depending on the access type we set the appropriate authentication method
463463 switch accessType {
464464 // If access type is AWS IAM we use the cloud ID
465- case AKEYLESS_AUTH_ACCESS_IAM :
465+ case AUTH_IAM :
466466 id , err := aws .GetCloudId ()
467467 if err != nil {
468468 return errors .New ("unable to get cloud ID" )
469469 }
470470 authRequest .SetCloudId (id )
471- case AKEYLESS_AUTH_ACCESS_JWT :
471+ case AUTH_JWT :
472472 authRequest .SetJwt (metadata .JWT )
473- case AKEYLESS_AUTH_DEFAULT_ACCESS_TYPE :
473+ case DEFAULT_AUTH_TYPE :
474474 a .logger .Debug ("authenticating using access key..." )
475475 authRequest .SetAccessKey (metadata .AccessKey )
476- case AKEYLESS_AUTH_ACCESS_K8S :
476+ case AUTH_K8S :
477477 a .logger .Debug ("authenticating using k8s..." )
478478 err := setK8SAuthConfiguration (* metadata , authRequest , a )
479479 if err != nil {
@@ -489,8 +489,8 @@ func (a *akeylessSecretStore) Authenticate(metadata *akeylessMetadata) error {
489489 URL : metadata .GatewayURL ,
490490 },
491491 }
492- config .UserAgent = AKEYLESS_USER_AGENT
493- config .AddDefaultHeader ("akeylessclienttype" , AKEYLESS_USER_AGENT )
492+ config .UserAgent = USER_AGENT
493+ config .AddDefaultHeader ("akeylessclienttype" , USER_AGENT )
494494
495495 a .v2 = akeyless .NewAPIClient (config ).V2Api
496496
@@ -514,11 +514,11 @@ func (a *akeylessSecretStore) separateItemsByType(items []akeyless.Item) ([]akey
514514 itemType := * item .ItemType
515515
516516 switch itemType {
517- case AKEYLESS_SECRET_TYPE_STATIC_SECRET_RESPONSE :
517+ case STATIC_SECRET_RESPONSE :
518518 staticItems = append (staticItems , item )
519- case AKEYLESS_SECRET_TYPE_DYNAMIC_SECRET_RESPONSE :
519+ case DYNAMIC_SECRET_RESPONSE :
520520 dynamicItems = append (dynamicItems , item )
521- case AKEYLESS_SECRET_TYPE_ROTATED_SECRET_RESPONSE :
521+ case ROTATED_SECRET_RESPONSE :
522522 rotatedItems = append (rotatedItems , item )
523523 }
524524 }
0 commit comments