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(jwt): add dsl claims builder #18

Merged
merged 1 commit into from
May 29, 2024
Merged

feat(jwt): add dsl claims builder #18

merged 1 commit into from
May 29, 2024

Conversation

beatt83
Copy link
Owner

@beatt83 beatt83 commented May 29, 2024

This feature will add the ability of creating JWTs claims with DSL.

Example:

let jwt = try JWT.signed(
        payload: {
            IssuerClaim(value: "testIssuer")
            SubjectClaim(value: "testSubject")
            ExpirationTimeClaim(value: Date())
            IssuedAtClaim(value: Date())
            NotBeforeClaim(value: Date())
            JWTIdentifierClaim(value: "ThisIdentifier")
            AudienceClaim(value: "testAud")
        },
        protectedHeader: DefaultJWSHeaderImpl(algorithm: .ES256),
        key: key
    ).jwtString

@beatt83 beatt83 force-pushed the feature/jwt-claims-dsl branch from 2b908d2 to 91b17f6 Compare May 29, 2024 01:43
@beatt83 beatt83 force-pushed the feature/jwt-claims-dsl branch from 91b17f6 to 5a49164 Compare May 29, 2024 01:55
@beatt83 beatt83 merged commit 5a03a65 into main May 29, 2024
2 checks passed
@beatt83 beatt83 deleted the feature/jwt-claims-dsl branch May 29, 2024 02:00
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