Skip to content

Releases: ferrerojosh/nest-keycloak-connect

1.6.1

05 Jul 18:45
1.6.1
8e050b9
Compare
Choose a tag to compare

Minor release.

Changes:

  • Add token validation method (#40, #62)
  • Add policy enforcement mode (enforcing, permissive)
  • Rework module registration (#63)

With this, it is now possible to register the module this way:

Method 1 (keycloak json path + library options)

KeycloakConnectModule.register(`./keycloak.json`, {
  cookieKey: 'KEYCLOAK_JWT',
  logLevels: ['verbose'],
  useNestLogger: false,
  policyEnforcement: PolicyEnforcementMode.ENFORCING,
  tokenValidation: TokenValidation.NONE,
}),

Method 2 (keycloak json path only)

KeycloakConnectModule.register(`./keycloak.json`)

Method 3 (the usual method, merging both keycloak config and library options)

KeycloakConnectModule.register({
  authServerUrl: 'http://localhost:8080/auth',
  realm: 'nest-example',
  clientId: 'nest-api',
  secret: '05c1ff5e-f9ba-4622-98e3-c4c9d280546e',
  // optional if you want to retrieve JWT from cookie
  cookieKey: 'KEYCLOAK_JWT',
  logLevels: ['verbose'],
  useNestLogger: false,
  policyEnforcement: PolicyEnforcementMode.ENFORCING,
  tokenValidation: TokenValidation.NONE,
})

1.6.0

04 Jun 20:08
1.6.0
7e3a0fc
Compare
Choose a tag to compare

A minor update release.

Breaking Changes:

  • @Roles decorator parameters changed, now requires you to pass a parameter object, a quick snippet (#45, thanks @jalorenz):
// Client application roles
@Roles({ roles: ['admin', 'other'], mode: RoleMatchingMode.ALL })
// Realm roles, simply prefix it with realm:
@Roles({ roles: ['realm:admin', 'realm:other'], mode: RoleMatchingMode.ALL })
  • @Roles decorator now defaults to match ANY roles given
  • Remove @AllowAnyRole decorator

Changes:

  • Add option to configure policy enforcement (#55)
  • Fix bug where GraphQL is not supported when using AuthenticatedUser decorator (#57)
  • Add a way to inject a custom logger implementation (#58)
  • Add option to use nest logger, which allows loggers from NestJS app.useLogger respectively (#58)

1.5.3

29 Apr 21:35
1.5.3
7d702ad
Compare
Choose a tag to compare

A minor release for bug fixes:

  • User object should not call userInfo endpoint (#51)
  • Invalid auth/jwt should throw unauthorized instead of forbidden (#53)
  • Add default log level when not defined (#50, thanks @talbx)

1.5.2

16 Apr 06:47
1.5.2
a58b898
Compare
Choose a tag to compare

A minor release.

Changes:

  • Fix loggerProvider not being provided (#47) @CodeOneTwo
  • @EnforcerOptions decorator should now work at controller/route level

1.5.1

13 Apr 15:23
1.5.1
4ec7750
Compare
Choose a tag to compare

Hot fix for routes not marked as @Public allowing non authenticated requests.

1.5.0

12 Apr 18:29
1.5.0
7fe5374
Compare
Choose a tag to compare

A minor feature update.

Changes:

  • Added authenticated user decorator (#43)
  • Improved logging (#41)
  • Fixed a bug where a route marked with @public will fail when unauthenticated

1.4.3

26 Feb 04:14
1.4.3
f6cb306
Compare
Choose a tag to compare
  • Fix: Public decorator with skipAuth = false will allow empty jwt bearer

1.4.2

24 Jan 17:41
1.4.2
f488aab
Compare
Choose a tag to compare

Small change.

Update Keycloak to v12.0

1.4.1

31 Dec 10:41
1.4.1
e57b5a5
Compare
Choose a tag to compare

Quick hot fix.

Changes:

  • Make @nestjs/graphql completely optional.

1.4.0

23 Dec 22:49
Compare
Choose a tag to compare

A minor release.