Skip to content

Commit

Permalink
add jwt reflect and resource config to support jwt authentication type
Browse files Browse the repository at this point in the history
closes #48
  • Loading branch information
atomfrede committed Aug 19, 2022
1 parent 2b991ab commit ad29327
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
6 changes: 6 additions & 0 deletions generators/server/__snapshots__/generator.spec.mjs.snap
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,12 @@ Object {
"src/main/resources/.h2.server.properties": Object {
"stateCleared": "modified",
},
"src/main/resources/META-INF/native-image/jwt/reflect-config.json": Object {
"stateCleared": "modified",
},
"src/main/resources/META-INF/native-image/jwt/resource-config.json": Object {
"stateCleared": "modified",
},
"src/main/resources/META-INF/native-image/liquibase/reflect-config.json": Object {
"stateCleared": "modified",
},
Expand Down
12 changes: 12 additions & 0 deletions generators/server/generator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,18 @@ logging:
);
},

async jwt({ application: { authenticationTypeOauth2 } }) {
if (authenticationTypeOauth2) return;
await this.copyTemplate(
'src/main/resources/META-INF/native-image/jwt/reflect-config.json',
'src/main/resources/META-INF/native-image/jwt/reflect-config.json'
);
await this.copyTemplate(
'src/main/resources/META-INF/native-image/jwt/resource-config.json',
'src/main/resources/META-INF/native-image/jwt/resource-config.json'
);
},

async liquibase({ application: { databaseTypeSql } }) {
if (!databaseTypeSql) return;
await this.copyTemplate(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[
{
"name": "io.jsonwebtoken.impl.compression.GzipCompressionCodec",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "io.jsonwebtoken.impl.compression.DeflateCompressionCodec",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "io.jsonwebtoken.impl.DefaultJwtParserBuilder",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "io.jsonwebtoken.impl.DefaultJwtBuilder",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"resources": [
{
"pattern": "META-INF/services/io.jsonwebtoken.CompressionCodec"
},
{
"pattern": "META-INF/services/io.jsonwebtoken.io.Deserializer"
},
{
"pattern": "META-INF/services/io.jsonwebtoken.io.Serializer"
}
]
}

0 comments on commit ad29327

Please sign in to comment.