Skip to content

Commit

Permalink
Add support for Lucky v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
akadusei committed Oct 30, 2023
1 parent 903eb4f commit cf71342
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ jobs:
matrix:
crystal: ['1.6.0', latest]
experimental: [false]
shard_file: [shard.yml, shard.latest.yml]
include:
- crystal: nightly
experimental: true
shard_file: shard.yml
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
steps:
Expand All @@ -56,6 +58,8 @@ jobs:
restore-keys: ${{ runner.os }}-shards-
- name: Install shards
run: shards update --skip-postinstall --skip-executables
env:
SHARDS_OVERRIDE: ${{ matrix.shard_file }}
- name: Install Postgresql
run: sudo apt -y install postgresql
- name: Start Postgresql
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased] -

### Added
- Add support for Lucky v1.1
- Add `OauthGrantType.authorization_code` constructor
- Add `OauthGrantType.client_credentials` constructor
- Add `OauthGrantType.refresh_token` constructor
Expand Down
13 changes: 13 additions & 0 deletions shard.latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
dependencies:
avram:
github: luckyframework/avram
version: ~> 1.1
carbon:
github: luckyframework/carbon
version: ~> 0.4.0
lucky:
github: luckyframework/lucky
version: ~> 1.1
lucky_env:
github: luckyframework/lucky_env
version: ~> 0.2.0
4 changes: 2 additions & 2 deletions spec/shield/utilities/mixins/oauth_grant_verifier_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ describe Shield::OauthGrantVerifier do
.oauth_client_id(oauth_client.id)
.type(grant_type)
.code(code)
.metadata({
.metadata(OauthGrantMetadata.from_json({
code_challenge: code_challenge,
code_challenge_method: "S256"
}.to_json)
}.to_json))

code = OauthGrantCredentials.new(code, oauth_grant.id).to_s
code_2 = OauthGrantCredentials.new("abcdef", 4).to_s
Expand Down
6 changes: 3 additions & 3 deletions spec/support/factories/oauth_grant_factory.cr
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ class OauthGrantFactory < Avram::Factory
OauthGrantPkce.hash(challenge) :
challenge

metadata({
metadata(OauthGrantMetadata.from_json({
code_challenge: code_challenge,
code_challenge_method: challenge_method,
redirect_uri: "https://example.com/oauth/callback"
}.to_json)
}.to_json))
end

def redirect_uri(uri : String)
metadata({redirect_uri: uri}.to_json)
metadata(OauthGrantMetadata.from_json({redirect_uri: uri}.to_json))
end

private def set_defaults
Expand Down

0 comments on commit cf71342

Please sign in to comment.