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

Upgrade API key rotation to support fully- and partially-qualified IDs #111

Merged
merged 1 commit into from
Feb 21, 2023

Conversation

john-odonnell
Copy link
Contributor

@john-odonnell john-odonnell commented Feb 17, 2023

Desired Outcome

Allow conjur [user|host] rotate-api-key to accept fully- and partially-qualified IDs.

Implemented Changes

Use the latest version of conjur-api-go, which allows Rotate[User|Host]APIKey() functions to accept both fully- and partially-qualified role IDs.

Add integration test cases to ensure the CLI can rotate a [user|host]'s role given an ID of varying degrees of qualification.

Connected Issue/Story

N/A

Definition of Done

At least 1 todo must be completed in the sections below for the PR to be
merged.

Changelog

  • The CHANGELOG has been updated, or
  • This PR does not include user-facing changes and doesn't require a
    CHANGELOG update

Test coverage

  • This PR includes new unit and integration tests to go with the code
    changes, or
  • The changes in this PR do not require tests

Documentation

  • Docs (e.g. READMEs) were updated in this PR
  • A follow-up issue to update official docs has been filed here: [insert issue ID]
  • This PR does not require updating any documentation

Behavior

  • This PR changes product behavior and has been reviewed by a PO, or
  • These changes are part of a larger initiative that will be reviewed later, or
  • No behavior was changed with this PR

Security

  • Security architect has reviewed the changes in this PR,
  • These changes are part of a larger initiative with a separate security review, or
  • There are no security aspects to these changes

@john-odonnell john-odonnell requested a review from a team as a code owner February 17, 2023 14:26
@john-odonnell john-odonnell force-pushed the rotate-api-key-fully-qualified-support branch 2 times, most recently from 9418900 to 9f89c60 Compare February 17, 2023 14:54
@john-odonnell john-odonnell force-pushed the rotate-api-key-fully-qualified-support branch 2 times, most recently from d47333f to dd6c1a4 Compare February 17, 2023 15:19
@@ -155,3 +156,10 @@ func assertLogoutCmd(t *testing.T, err error, stdOut string, stdErr string) {
assert.Contains(t, stdOut, "Logged out\n")
assert.Equal(t, "", stdErr)
}

func assertAPIKeyRotationCmd(t *testing.T, err error, stdOut string, stdErr string, priorAPIKey string) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function assertAPIKeyRotationCmd has 5 arguments (exceeds 4 allowed). Consider refactoring.

@john-odonnell john-odonnell force-pushed the rotate-api-key-fully-qualified-support branch from dd6c1a4 to 0df6edd Compare February 17, 2023 16:38
@codeclimate
Copy link

codeclimate bot commented Feb 17, 2023

Code Climate has analyzed commit 0df6edd and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 2

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 80.8% (0.0% change).

View more on Code Climate.

Copy link
Contributor

@szh szh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@john-odonnell john-odonnell merged commit 9769838 into master Feb 21, 2023
@john-odonnell john-odonnell deleted the rotate-api-key-fully-qualified-support branch February 21, 2023 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants