Skip to content

Commit 02c16c0

Browse files
szhGitHub Enterprise
authored and
GitHub Enterprise
committed
Merge pull request #52 from Conjur-Enterprise/ldap-rotate-api-key
CNJR-9014: Fix URL for rotating API keys when using authn-ldap
2 parents 0148149 + d7c2e2e commit 02c16c0

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

CHANGELOG.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
## [0.12.14] - 2025-03-20
10+
11+
### Fixed
12+
- Fix URL for rotating API keys when using authn-ldap
13+
(CNJR-9014, [cyberark/conjur-cli-go#153](https://github.com/cyberark/conjur-cli-go/issues/153))
14+
915
## [0.12.13] - 2025-02-21
1016

1117
### Fixed
@@ -285,7 +291,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
285291
### Added
286292
- Initial version
287293

288-
[Unreleased]: https://github.com/cyberark/conjur-api-go/compare/v0.12.10...HEAD
294+
[Unreleased]: https://github.com/cyberark/conjur-api-go/compare/v0.12.14...HEAD
295+
[0.12.14]: https://github.com/cyberark/conjur-api-go/compare/v0.12.13...v0.12.14
296+
[0.12.13]: https://github.com/cyberark/conjur-api-go/compare/v0.12.12...v0.12.13
297+
[0.12.12]: https://github.com/cyberark/conjur-api-go/compare/v0.12.11...v0.12.12
298+
[0.12.11]: https://github.com/cyberark/conjur-api-go/compare/v0.12.10...v0.12.11
289299
[0.12.10]: https://github.com/cyberark/conjur-api-go/compare/v0.12.9...v0.12.10
290300
[0.12.9]: https://github.com/cyberark/conjur-api-go/compare/v0.12.8...v0.12.9
291301
[0.12.8]: https://github.com/cyberark/conjur-api-go/compare/v0.12.7...v0.12.8

conjurapi/requests.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ func (c *Client) RotateAPIKeyRequest(roleID string) (*http.Request, error) {
215215
}
216216
roleID = fmt.Sprintf("%s:%s:%s", account, kind, identifier)
217217

218-
rotateURL := makeRouterURL(c.authnURL(c.config.AuthnType, c.config.ServiceID), "api_key").withFormattedQuery("role=%s", roleID).String()
218+
// Always use the default authenticator for API key rotation
219+
rotateURL := makeRouterURL(c.authnURL("authn", ""), "api_key").withFormattedQuery("role=%s", roleID).String()
219220

220221
return http.NewRequest(
221222
"PUT",
@@ -229,7 +230,8 @@ func (c *Client) RotateCurrentUserAPIKeyRequest(login string, password string) (
229230
}
230231

231232
func (c *Client) RotateCurrentRoleAPIKeyRequest(login string, password string) (*http.Request, error) {
232-
rotateUrl := makeRouterURL(c.authnURL(c.config.AuthnType, c.config.ServiceID), "api_key")
233+
// Always use the default authenticator for API key rotation
234+
rotateUrl := makeRouterURL(c.authnURL("authn", ""), "api_key")
233235

234236
req, err := http.NewRequest(
235237
"PUT",

0 commit comments

Comments
 (0)