• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Lokicoule / nestjs-cognito / 18258395424
92%

Build:
DEFAULT BRANCH: main
Ran 05 Oct 2025 12:00PM UTC
Jobs 1
Files 60
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

05 Oct 2025 11:59AM UTC coverage: 93.176% (+0.2%) from 92.933%
18258395424

push

github

web-flow
feat(auth,graphql): add specialized decorators for Cognito token types (#1454)

* feat(auth,graphql): add specialized decorators for Cognito token types

Add @CognitoAccessUser and @CognitoIdUser decorators with runtime validation for better type safety when working with different Cognito JWT token types.

Changes:
- Add CognitoAccessTokenPayload and CognitoIdTokenPayload types in @nestjs-cognito/core
- Add isAccessTokenPayload() and isIdTokenPayload() type guards
- Add @CognitoAccessUser and @CognitoIdUser decorators for REST controllers
- Add @GqlCognitoAccessUser and @GqlCognitoIdUser decorators for GraphQL resolvers
- Refactor decorator logic using shared createCognitoUserDecorator() factory
- Add CognitoTokenTypeMismatchError for token type validation errors
- Add comprehensive test coverage for token extraction and validation

Resolves #1445

* docs: update Cognito user decorators and GraphQL integration

Enhance documentation for Cognito user decorators, introducing specialized decorators for better type safety. Update usage examples for `@CognitoAccessUser` and `@CognitoIdUser`, and clarify the functionality of GraphQL decorators. Include runtime validation details and error handling for token type mismatches.

Changes:
- Revise descriptions and examples for `@CognitoUser`, `@CognitoAccessUser`, and `@CognitoIdUser` decorators.
- Add GraphQL support documentation for `@GqlCognitoAccessUser` and `@GqlCognitoIdUser`.
- Improve clarity on token retrieval patterns and error handling.

Resolves #1445

245 of 272 branches covered (90.07%)

Branch coverage included in aggregate %.

34 of 38 new or added lines in 7 files covered. (89.47%)

465 of 490 relevant lines covered (94.9%)

9.2 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
50.0
packages/core/lib/interfaces/cognito-module.options.ts
2
75.0
-15.48% packages/graphql/lib/user/cognito-user.decorator.ts
Jobs
ID Job ID Ran Files Coverage
1 18258395424.1 05 Oct 2025 12:00PM UTC 60
93.18
GitHub Action Run
Source Files on build 18258395424
  • Tree
  • List 60
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 7f0fc39c on github
  • Prev Build on main
  • Next Build on main
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc