Skip to content

Infisical Token Auth authentication method do not work properly #5215

@arthlr

Description

@arthlr

Describe the bug
The new Token Auth authentication method (added in #5080) is not correctly implemented.

To Reproduce

  1. Try to use a (Cluster)SecretStore with these settings:
      auth:
        tokenAuthCredentials:
          accessToken:
            key: accessToken
            name: infisical-credentials
            namespace: external-secrets
  1. The ClusterSecretStore is validated only once and then failed to be validated again
  2. Check on your infisical account, the token has been revoked.

Expected behavior
The ClusterSecretStore must be validated and stable with Token Auth authentication method.

Additional context
I think the issue is due to the Close function of infisical provider (here).

func (p *Provider) Close(ctx context.Context) error {
	p.cancelSdkClient()
	err := p.sdkClient.Auth().RevokeAccessToken()
	metrics.ObserveAPICall(constants.ProviderName, revokeAccessToken, err)

	return err
}

It is a good practice to revoke the token for other auth methods but obviously not for Token Auth method.

I will provide soon a PR to solve the issue

Metadata

Metadata

Assignees

Labels

area/infisicalIssues / Pull Requests related to infisical providerkind/bugCategorizes issue or PR as related to a bug.track/providerscapture issues related to providers

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions