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

Format API keys in hexa instead of base64 #2584

Merged
merged 1 commit into from
Jul 6, 2022

Conversation

ManyTheFish
Copy link
Member

@ManyTheFish ManyTheFish commented Jul 5, 2022

This PR:

  • Changes API key generation and formatting to ease the generation of the key made by our users
  • updates the uuid crate version

The API key can now be generated in bash as below:

echo -n $HYPHENATED_UUID | openssl dgst -sha256 -hmac $MASTER_KEY

fixes the issue raised in product/discussion#421, this should not impact anything in documentation nor integration but ease the key generation on the user sides.

poke @gmourier

@ManyTheFish ManyTheFish changed the base branch from main to release-v0.28.0 July 5, 2022 14:12
Copy link
Member

@Kerollmops Kerollmops left a comment

Choose a reason for hiding this comment

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

Thank you very much! I am just awaiting @gmourier approval. Would it be possible to update the specs too @ManyTheFish?

This PR is directly related to this comment. It makes it possible for the users to generate the keys on their side, in a determinist way. I would like to inform the @meilisearch/integration-team and @meilisearch/docs-team, of these changes. However, if you didn't document this client-side key generation (by using hmac and base64...) you must ignore this message. if you are displaying the content of the key field, note that we changed the encoding function and display a 64 chars hexadecimal lowercase string instead of a smaller base64 encoded string.

@Kerollmops Kerollmops requested a review from gmourier July 5, 2022 14:27
bors bot added a commit to meilisearch/milli that referenced this pull request Jul 5, 2022
578: Bump uuid to 1.1.2 r=ManyTheFish a=Kerollmops

Just to [align the version with Meilisearch](meilisearch/meilisearch#2584).

Co-authored-by: Kerollmops <clement@meilisearch.com>
@gmourier
Copy link
Member

gmourier commented Jul 5, 2022

@meilisearch/docs-team @meilisearch/integration-team

Know that the representation of a key field value changes since it removes the base64 encoding.

Now -> key: f8f4d6bcaf27b0308c9ccd30a25e385bdc6a25838ead081a69dbcbc374172bb1 (hexadecimal format)
Before -> key: JTvtex9QQsqanj6cke3hfkqeNIlnHa280YtYIbU/G7Y= (base64 format)

I think you may want to update code snippets or examples showing a key value. At least at some point!

Copy link
Member

@Kerollmops Kerollmops left a comment

Choose a reason for hiding this comment

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

bors merge

@bors
Copy link
Contributor

bors bot commented Jul 6, 2022

🕐 Waiting for PR status (Github check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.

@curquiza curquiza added this to the v0.28.0 milestone Jul 6, 2022
@curquiza
Copy link
Member

curquiza commented Jul 6, 2022

bors merge

@bors
Copy link
Contributor

bors bot commented Jul 6, 2022

Stopped waiting for PR status (Github check) without running due to duplicate requests to run. You may check Bors to see that this PR is included in a batch by one of the other requests.

@bors
Copy link
Contributor

bors bot commented Jul 6, 2022

@bors bors bot merged commit 755b1a5 into release-v0.28.0 Jul 6, 2022
@bors bors bot deleted the hexa-formated-api-keys branch July 6, 2022 13:13
@curquiza curquiza added the v0.28.0 PRs/issues solved in v0.28.0 label Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v0.28.0 PRs/issues solved in v0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants