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: import keys with a default key id #2563

Merged
merged 2 commits into from
Jun 18, 2021

Conversation

rzana
Copy link
Contributor

@rzana rzana commented Jun 7, 2021

Related issue

#1741

When importing keys without kid attribute:

hydra keys delete hydra.jwt.access-token
hydra keys import hydra.jwt.access-token private.key public.key

the kids for the keys are created in a format of private:uuid1 and public:uuid2. Trying to create a token using that causes the following error:

public and private key pair kids do not match

Proposed changes

I added a default-key-id param to NewKeysImportCmd as a fallback kid value, respecting the previous behavior as well.

Checklist

  • I have read the contributing guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security. vulnerability, I
    confirm that I got green light (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

@CLAassistant
Copy link

CLAassistant commented Jun 7, 2021

CLA assistant check
All committers have signed the CLA.

@rzana rzana changed the title import keys with a default key id fix: import keys with a default key id Jun 7, 2021
@rzana
Copy link
Contributor Author

rzana commented Jun 8, 2021

If the general idea is acceptable I can create tests for the change.

@aeneasr
Copy link
Member

aeneasr commented Jun 11, 2021

Looking good! :)

Regarding the CLA


It looks like the CLA bot is not properly detecting your signature. To fix this, try the following:

$ git commit  --amend --author="Author Name <email@address.com>"

Ensure that Author Name is replaced with your GitHub username (e.g. aeneasr) and that the email address is replaced with the email address you have set up in GitHub (e.g. 3372410+aeneasr@users.noreply.github.com):

$ git commit  --amend --author="aeneasr <3372410+aeneasr@users.noreply.github.com>"

Once that is done, you can force-push your changes (make sure to push to the correct remote and branch!):

$ git push --force <remote> HEAD:<branch>

@rzana rzana force-pushed the import_keys_with_a_default_key_id branch from 712ecde to 13f3fd7 Compare June 11, 2021 12:59
@rzana rzana force-pushed the import_keys_with_a_default_key_id branch from 13f3fd7 to 3248016 Compare June 11, 2021 13:03
@aeneasr aeneasr merged commit cd3014c into ory:master Jun 18, 2021
@aeneasr
Copy link
Member

aeneasr commented Jun 18, 2021

Thank you! :)

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.

3 participants