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

feat: drop methods for finding keys by public/private prefix #2814

Closed
wants to merge 2 commits into from

Conversation

aarmam
Copy link
Contributor

@aarmam aarmam commented Oct 19, 2021

Drop FindKeyByPrefix/FindKeysByPrefix methods for finding keys by public/private prefix and use FindPublicKey/FindPrivateKey helper methods instead.

Related issue(s)

This feature is continuation of #2758

It is also related to #2625 where it would be easer to review it, if suggest this change separately.
In short to find keypairs from HSM I use attribute CKA_LABEL as key set id and CKA_ID as key id and they have to be 1:1 for pub/priv keys:
https://github.com/ThalesIgnite/crypto11/blob/master/keys.go#L247-L278

This helps me to get rid of https://github.com/aarmam/hydra/blob/feature/hsm/hsm/manager_hsm.go#L243-L261 where I prefix keys manually altough key id's on HSM are without prefixes.

Checklist

@aarmam aarmam requested a review from aeneasr as a code owner October 19, 2021 19:20
@codecov
Copy link

codecov bot commented Oct 19, 2021

Codecov Report

Merging #2814 (c1fb80d) into master (f15f339) will decrease coverage by 0.13%.
The diff coverage is 36.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2814      +/-   ##
==========================================
- Coverage   49.87%   49.74%   -0.14%     
==========================================
  Files         236      236              
  Lines       14974    15032      +58     
==========================================
+ Hits         7469     7477       +8     
- Misses       6843     6890      +47     
- Partials      662      665       +3     
Impacted Files Coverage Δ
client/client.go 81.25% <ø> (ø)
consent/manager.go 100.00% <ø> (ø)
consent/handler.go 63.57% <18.75%> (-1.76%) ⬇️
consent/strategy_default.go 67.34% <26.66%> (-2.37%) ⬇️
persistence/sql/persister_consent.go 73.99% <40.00%> (-4.42%) ⬇️
consent/manager_test_helpers.go 97.50% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d687366...c1fb80d. Read the comment docs.

aarmam added a commit to aarmam/hydra that referenced this pull request Oct 25, 2021
aarmam added a commit to aarmam/hydra that referenced this pull request Oct 26, 2021
aarmam added a commit to aarmam/hydra that referenced this pull request Oct 26, 2021
aarmam added a commit to aarmam/hydra that referenced this pull request Oct 27, 2021
aarmam added a commit to aarmam/hydra that referenced this pull request Oct 27, 2021
aarmam added a commit to aarmam/hydra that referenced this pull request Nov 2, 2021
@aarmam aarmam force-pushed the feature/kid-prefix branch 2 times, most recently from 4cad943 to c9b9bcd Compare November 8, 2021 08:16
aarmam added a commit to aarmam/hydra that referenced this pull request Nov 8, 2021
@aarmam aarmam force-pushed the feature/kid-prefix branch 3 times, most recently from d7a67ca to c1fb80d Compare November 8, 2021 18:03
@aarmam aarmam closed this Nov 9, 2021
@aarmam aarmam deleted the feature/kid-prefix branch November 9, 2021 10:15
aarmam added a commit to aarmam/hydra that referenced this pull request Nov 9, 2021
aarmam added a commit to aarmam/hydra that referenced this pull request Nov 24, 2021
aarmam added a commit to aarmam/hydra that referenced this pull request Dec 1, 2021
aarmam added a commit to aarmam/hydra that referenced this pull request Dec 8, 2021
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.

1 participant