Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix secret revoke error with user_token #240

Merged
merged 7 commits into from
Jan 14, 2025

Conversation

alexhung
Copy link
Member

Fix #237

Now secret lease revoke will check for empty access token from admin config and fall back to user_token config if it was empty.

Improve logging for TTL values.

Also fix errors when reading admin config if access_token is not set. Fixes #236

@alexhung alexhung added the bug Something isn't working label Jan 13, 2025
@alexhung alexhung marked this pull request as ready for review January 13, 2025 22:17
benharosh
benharosh previously approved these changes Jan 13, 2025
@alexhung alexhung requested a review from danielmkn January 14, 2025 00:52
@Claudiordev
Copy link

Claudiordev commented Jan 14, 2025

Hi,

@alexhung

I builded this branch artifactory plugin and test it locally, still having an error on the leases being revoked as following:

2025-01-14T15:34:49.627+0100 [ERROR] expiration: failed to revoke lease: lease_id=artifactory/user_token/cfreita1/gom1W5LMI39gBib63zs0MscK error="failed to revoke entry: resp: &logical.Response{Secret:<nil>, Auth:<nil>, Data:map[string]interface {}{\"error\":\"admin access_token is not configured\"}, Redirect:\"\", Warnings:[]string(nil), WrapInfo:(*wrapping.ResponseWrapInfo)(nil), Headers:map[string][]string(nil), MountType:\"\"} err: %!w(<nil>)" attempts=2 next_attempt=20.774219754s

secret_access_token.go Outdated Show resolved Hide resolved
@alexhung
Copy link
Member Author

@Claudiordev Thanks for testing/verifying. I've improved the path matching. This should work correctly now.

@alexhung alexhung merged commit 27b2a8a into master Jan 14, 2025
7 checks passed
@alexhung alexhung deleted the GH-237-fix-secret-revoke-error-with-user-token branch January 14, 2025 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to revoke lease due to empty access token not allowed Error on reading artifactory/config/admin path
5 participants