Skip to content

Commit

Permalink
fix: changes to security-jwt config
Browse files Browse the repository at this point in the history
Close: #238

Close: #237
  • Loading branch information
sdelamo committed May 22, 2020
1 parent b0b9f0b commit 1d94ef4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ public void processSelectedFeatures(FeatureContext featureContext) {

@Override
public void apply(GeneratorContext generatorContext) {
generatorContext.getConfiguration().put("micronaut.security.endpoints.login.enabled", true);
generatorContext.getConfiguration().put("micronaut.security.endpoints.oauth.enabled", true);
generatorContext.getConfiguration().put("micronaut.security.authentication", "bearer");
generatorContext.getConfiguration().put("micronaut.security.token.jwt.signatures.secret.generator.secret", "\"${JWT_GENERATOR_SIGNATURE_SECRET:pleaseChangeThisSecretForANewOne}\"");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ class SecurityJTWSpec extends BeanContextSpec {
GeneratorContext commandContext = buildGeneratorContext(['security-jwt'])

then:
commandContext.configuration.get('micronaut.security.endpoints.login.enabled'.toString()) == true
commandContext.configuration.get('micronaut.security.endpoints.oauth.enabled'.toString()) == true
!commandContext.configuration.containsKey('micronaut.security.endpoints.login.enabled')
!commandContext.configuration.containsKey('micronaut.security.endpoints.logout.enabled')
commandContext.configuration.containsKey('micronaut.security.authentication')
commandContext.configuration.get('micronaut.security.authentication') == 'bearer'
commandContext.configuration.get('micronaut.security.token.jwt.signatures.secret.generator.secret'.toString()) == '"${JWT_GENERATOR_SIGNATURE_SECRET:pleaseChangeThisSecretForANewOne}"'
}
}

0 comments on commit 1d94ef4

Please sign in to comment.