Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/fositePublic
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

refactor: split HMAC SHA strategy#813

Merged
aeneasr merged 1 commit intomasterfromimprove-p
Jul 9, 2024
Merged

refactor: split HMAC SHA strategy#813

aeneasr merged 1 commit intomasterfromimprove-p
Jul 9, 2024

Conversation

aeneasr
Copy link
Member

BREAKING CHANGES: Going forward, theHMACSHAStrategy requires aBaseHMACSHAStrategy. Here is how to upgrade it:

var hmacshaStrategy = HMACSHAStrategy{-Enigma: &hmac.HMACStrategy{Config: &fosite.Config{GlobalSecret: []byte("foobarfoobarfoobarfoobarfoobarfoobarfoobarfoobar")}},-Config: &fosite.Config{-AccessTokenLifespan:   time.Hour * 24,-AuthorizeCodeLifespan: time.Hour * 24,+BaseHMACSHAStrategy: &BaseHMACSHAStrategy{+Enigma: &hmac.HMACStrategy{Config: &fosite.Config{GlobalSecret: []byte("foobarfoobarfoobarfoobarfoobarfoobarfoobarfoobar")}},+Config: &fosite.Config{+AccessTokenLifespan:   time.Hour * 24,+AuthorizeCodeLifespan: time.Hour * 24,+},},}

Checklist

  • I have read thecontributing guidelines and signed the CLA.
  • [ ] I have referenced an issue containing the design document if my change introduces a new feature.
  • I have read thesecurity 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 approval (please contactsecurity@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 the necessary documentation within the code base (if appropriate).

Further comments

BREAKING CHANGES: Going forward, the `HMACSHAStrategy` requires a `BaseHMACSHAStrategy`. Here is how to upgrade it:```patchvar hmacshaStrategy = HMACSHAStrategy{-Enigma: &hmac.HMACStrategy{Config: &fosite.Config{GlobalSecret: []byte("foobarfoobarfoobarfoobarfoobarfoobarfoobarfoobar")}},-Config: &fosite.Config{-AccessTokenLifespan:   time.Hour * 24,-AuthorizeCodeLifespan: time.Hour * 24,+BaseHMACSHAStrategy: &BaseHMACSHAStrategy{+Enigma: &hmac.HMACStrategy{Config: &fosite.Config{GlobalSecret: []byte("foobarfoobarfoobarfoobarfoobarfoobarfoobarfoobar")}},+Config: &fosite.Config{+AccessTokenLifespan:   time.Hour * 24,+AuthorizeCodeLifespan: time.Hour * 24,+},},}```
@aeneasraeneasr self-assigned thisJul 9, 2024
@aeneasraeneasr merged commit576230a intomasterJul 9, 2024
8 checks passed
@aeneasraeneasr deleted the improve-p branchJuly 9, 2024 10:31
aeneasr added a commit that referenced this pull requestJul 10, 2024
aeneasr added a commit that referenced this pull requestJul 10, 2024
aeneasr added a commit that referenced this pull requestJul 16, 2024
This PR addresses improvements to the OAuth2 package, making it easier to inject custom strategies. As part of this change, the HMAC strategy has been split into a prefixed and unprefixed strategy. Due to this, the instantiation of `HMACSHAStrategy` has changed.This patch addresses improvements over#813 which has been reverted and fixed here.BREAKING CHANGES: Going forward, please instantiate the HMACSHAStrategy using `oauth2.NewHMACSHAStrategy()`:```patch-var hmacshaStrategy = oauth2.HMACSHAStrategy{-Enigma: &hmac.HMACStrategy{Config: &fosite.Config{GlobalSecret: []byte("foobarfoobarfoobarfoobarfoobarfoobarfoobarfoobar")}},-Config: &fosite.Config{-AccessTokenLifespan:   time.Hour * 24,-AuthorizeCodeLifespan: time.Hour * 24,-},-}+var hmacshaStrategy = oauth2.NewHMACSHAStrategy(+&hmac.HMACStrategy{Config: &fosite.Config{GlobalSecret: []byte("foobarfoobarfoobarfoobarfoobarfoobarfoobarfoobar")}},+&fosite.Config{+AccessTokenLifespan:   time.Hour * 24,+AuthorizeCodeLifespan: time.Hour * 24,+},+)```
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees

@aeneasraeneasr

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@aeneasr

[8]ページ先頭

©2009-2025 Movatter.jp