Skip to content

Commit

Permalink
oauth2 adjusts.
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Nov 13, 2022
1 parent 42019fb commit 8d326e0
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ Object {
<addNotNullConstraint columnName=\\"password_hash\\"
columnDataType=\\"varchar(60)\\"
tableName=\\"jhi_user\\"/>
<loadData
file=\\"config/liquibase/data/authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"name\\" type=\\"string\\"/>
</loadData>
<loadData
file=\\"config/liquibase/data/user.csv\\"
separator=\\";\\"
Expand All @@ -92,21 +99,14 @@ Object {
<column name=\\"activated\\" type=\\"boolean\\"/>
<column name=\\"created_date\\" type=\\"timestamp\\"/>
</loadData>
<dropDefaultValue tableName=\\"jhi_user\\" columnName=\\"created_date\\" columnDataType=\\"\${datetimeType}\\"/>
<loadData
file=\\"config/liquibase/data/authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"name\\" type=\\"string\\"/>
</loadData>
<loadData
file=\\"config/liquibase/data/user_authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_user_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"user_id\\" type=\\"numeric\\"/>
</loadData>
<dropDefaultValue tableName=\\"jhi_user\\" columnName=\\"created_date\\" columnDataType=\\"\${datetimeType}\\"/>
</changeSet>
<changeSet author=\\"jhipster\\" id=\\"00000000000002\\" context=\\"test\\">
Expand Down Expand Up @@ -402,6 +402,13 @@ Object {
<addNotNullConstraint columnName=\\"password_hash\\"
columnDataType=\\"varchar(60)\\"
tableName=\\"jhi_user\\"/>
<loadData
file=\\"config/liquibase/data/authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"name\\" type=\\"string\\"/>
</loadData>
<loadData
file=\\"config/liquibase/data/user.csv\\"
separator=\\";\\"
Expand All @@ -411,21 +418,14 @@ Object {
<column name=\\"activated\\" type=\\"boolean\\"/>
<column name=\\"created_date\\" type=\\"timestamp\\"/>
</loadData>
<dropDefaultValue tableName=\\"jhi_user\\" columnName=\\"created_date\\" columnDataType=\\"\${datetimeType}\\"/>
<loadData
file=\\"config/liquibase/data/authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"name\\" type=\\"string\\"/>
</loadData>
<loadData
file=\\"config/liquibase/data/user_authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_user_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"user_id\\" type=\\"numeric\\"/>
</loadData>
<dropDefaultValue tableName=\\"jhi_user\\" columnName=\\"created_date\\" columnDataType=\\"\${datetimeType}\\"/>
</changeSet>
<changeSet author=\\"jhipster\\" id=\\"00000000000002\\" context=\\"test\\">
Expand Down Expand Up @@ -739,6 +739,13 @@ Object {
<addNotNullConstraint columnName=\\"password_hash\\"
columnDataType=\\"varchar(60)\\"
tableName=\\"jhi_user\\"/>
<loadData
file=\\"config/liquibase/data/authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"name\\" type=\\"string\\"/>
</loadData>
<loadData
file=\\"config/liquibase/data/user.csv\\"
separator=\\";\\"
Expand All @@ -748,21 +755,14 @@ Object {
<column name=\\"activated\\" type=\\"boolean\\"/>
<column name=\\"created_date\\" type=\\"timestamp\\"/>
</loadData>
<dropDefaultValue tableName=\\"jhi_user\\" columnName=\\"created_date\\" columnDataType=\\"\${datetimeType}\\"/>
<loadData
file=\\"config/liquibase/data/authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"name\\" type=\\"string\\"/>
</loadData>
<loadData
file=\\"config/liquibase/data/user_authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_user_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"user_id\\" type=\\"numeric\\"/>
</loadData>
<dropDefaultValue tableName=\\"jhi_user\\" columnName=\\"created_date\\" columnDataType=\\"\${datetimeType}\\"/>
</changeSet>
<changeSet author=\\"jhipster\\" id=\\"00000000000002\\" context=\\"test\\">
Expand Down Expand Up @@ -1059,6 +1059,13 @@ Object {
<addNotNullConstraint columnName=\\"password_hash\\"
columnDataType=\\"varchar(60)\\"
tableName=\\"jhi_user\\"/>
<loadData
file=\\"config/liquibase/data/authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"name\\" type=\\"string\\"/>
</loadData>
<loadData
file=\\"config/liquibase/data/user.csv\\"
separator=\\";\\"
Expand All @@ -1068,21 +1075,14 @@ Object {
<column name=\\"activated\\" type=\\"boolean\\"/>
<column name=\\"created_date\\" type=\\"timestamp\\"/>
</loadData>
<dropDefaultValue tableName=\\"jhi_user\\" columnName=\\"created_date\\" columnDataType=\\"\${datetimeType}\\"/>
<loadData
file=\\"config/liquibase/data/authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"name\\" type=\\"string\\"/>
</loadData>
<loadData
file=\\"config/liquibase/data/user_authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_user_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"user_id\\" type=\\"numeric\\"/>
</loadData>
<dropDefaultValue tableName=\\"jhi_user\\" columnName=\\"created_date\\" columnDataType=\\"\${datetimeType}\\"/>
</changeSet>
<changeSet author=\\"jhipster\\" id=\\"00000000000002\\" context=\\"test\\">
Expand Down Expand Up @@ -1458,6 +1458,13 @@ Object {
<addNotNullConstraint columnName=\\"password_hash\\"
columnDataType=\\"varchar(60)\\"
tableName=\\"jhi_user\\"/>
<loadData
file=\\"config/liquibase/data/authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"name\\" type=\\"string\\"/>
</loadData>
<loadData
file=\\"config/liquibase/data/user.csv\\"
separator=\\";\\"
Expand All @@ -1467,21 +1474,14 @@ Object {
<column name=\\"activated\\" type=\\"boolean\\"/>
<column name=\\"created_date\\" type=\\"timestamp\\"/>
</loadData>
<dropDefaultValue tableName=\\"jhi_user\\" columnName=\\"created_date\\" columnDataType=\\"\${datetimeType}\\"/>
<loadData
file=\\"config/liquibase/data/authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"name\\" type=\\"string\\"/>
</loadData>
<loadData
file=\\"config/liquibase/data/user_authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_user_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"user_id\\" type=\\"numeric\\"/>
</loadData>
<dropDefaultValue tableName=\\"jhi_user\\" columnName=\\"created_date\\" columnDataType=\\"\${datetimeType}\\"/>
</changeSet>
<changeSet author=\\"jhipster\\" id=\\"00000000000002\\" context=\\"test\\">
Expand Down Expand Up @@ -1637,6 +1637,13 @@ Object {
<addNotNullConstraint columnName=\\"password_hash\\"
columnDataType=\\"varchar(60)\\"
tableName=\\"jhi_user\\"/>
<loadData
file=\\"config/liquibase/data/authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"name\\" type=\\"string\\"/>
</loadData>
<loadData
file=\\"config/liquibase/data/user.csv\\"
separator=\\";\\"
Expand All @@ -1646,21 +1653,14 @@ Object {
<column name=\\"activated\\" type=\\"boolean\\"/>
<column name=\\"created_date\\" type=\\"timestamp\\"/>
</loadData>
<dropDefaultValue tableName=\\"jhi_user\\" columnName=\\"created_date\\" columnDataType=\\"\${datetimeType}\\"/>
<loadData
file=\\"config/liquibase/data/authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"name\\" type=\\"string\\"/>
</loadData>
<loadData
file=\\"config/liquibase/data/user_authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_user_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"user_id\\" type=\\"numeric\\"/>
</loadData>
<dropDefaultValue tableName=\\"jhi_user\\" columnName=\\"created_date\\" columnDataType=\\"\${datetimeType}\\"/>
</changeSet>
<changeSet author=\\"jhipster\\" id=\\"00000000000002\\" context=\\"test\\">
Expand Down Expand Up @@ -1849,6 +1849,13 @@ Object {
<addNotNullConstraint columnName=\\"password_hash\\"
columnDataType=\\"varchar(60)\\"
tableName=\\"jhi_user\\"/>
<loadData
file=\\"config/liquibase/data/authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"name\\" type=\\"string\\"/>
</loadData>
<loadData
file=\\"config/liquibase/data/user.csv\\"
separator=\\";\\"
Expand All @@ -1858,21 +1865,14 @@ Object {
<column name=\\"activated\\" type=\\"boolean\\"/>
<column name=\\"created_date\\" type=\\"timestamp\\"/>
</loadData>
<dropDefaultValue tableName=\\"jhi_user\\" columnName=\\"created_date\\" columnDataType=\\"\${datetimeType}\\"/>
<loadData
file=\\"config/liquibase/data/authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"name\\" type=\\"string\\"/>
</loadData>
<loadData
file=\\"config/liquibase/data/user_authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_user_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"user_id\\" type=\\"numeric\\"/>
</loadData>
<dropDefaultValue tableName=\\"jhi_user\\" columnName=\\"created_date\\" columnDataType=\\"\${datetimeType}\\"/>
</changeSet>
<changeSet author=\\"jhipster\\" id=\\"00000000000002\\" context=\\"test\\">
Expand Down Expand Up @@ -2122,6 +2122,13 @@ Object {
<addNotNullConstraint columnName=\\"password_hash\\"
columnDataType=\\"varchar(60)\\"
tableName=\\"jhi_user\\"/>
<loadData
file=\\"config/liquibase/data/authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"name\\" type=\\"string\\"/>
</loadData>
<loadData
file=\\"config/liquibase/data/user.csv\\"
separator=\\";\\"
Expand All @@ -2131,21 +2138,14 @@ Object {
<column name=\\"activated\\" type=\\"boolean\\"/>
<column name=\\"created_date\\" type=\\"timestamp\\"/>
</loadData>
<dropDefaultValue tableName=\\"jhi_user\\" columnName=\\"created_date\\" columnDataType=\\"\${datetimeType}\\"/>
<loadData
file=\\"config/liquibase/data/authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"name\\" type=\\"string\\"/>
</loadData>
<loadData
file=\\"config/liquibase/data/user_authority.csv\\"
separator=\\";\\"
tableName=\\"jhi_user_authority\\"
usePreparedStatements=\\"true\\">
<column name=\\"user_id\\" type=\\"numeric\\"/>
</loadData>
<dropDefaultValue tableName=\\"jhi_user\\" columnName=\\"created_date\\" columnDataType=\\"\${datetimeType}\\"/>
</changeSet>
<changeSet author=\\"jhipster\\" id=\\"00000000000002\\" context=\\"test\\">
Expand Down
6 changes: 3 additions & 3 deletions generators/liquibase/files.mts
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ export const liquibaseFiles: WriteFileSection<LiquibaseGenerator, SpringBootAppl
{
condition: generator => Boolean(generator.generateUserManagement),
path: SERVER_MAIN_RES_DIR,
templates: ['config/liquibase/data/user.csv'],
templates: ['config/liquibase/data/user.csv', 'config/liquibase/data/user_authority.csv'],
},
{
condition: generator => Boolean(generator.generateUserManagement),
condition: generator => Boolean(generator.generateBuiltInAuthorityEntity),
path: SERVER_MAIN_RES_DIR,
templates: ['config/liquibase/data/authority.csv', 'config/liquibase/data/user_authority.csv'],
templates: ['config/liquibase/data/authority.csv'],
},
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -133,23 +133,24 @@ _%>
referencedColumnNames="id"
referencedTableName="<%= user.entityTableName %>"/>
<%_ } _%>
<%_ if (generateUserManagement) { _%>
<%_ if (generateBuiltInAuthorityEntity) { _%>
<loadData
file="config/liquibase/data/authority.csv"
separator=";"
tableName="<%= jhiTablePrefix %>_authority"
usePreparedStatements="true">
<column name="name" type="string"/>
</loadData>
<%_ if (!authenticationTypeOauth2) { _%>
<%_ } _%>
<%_ if (generateUserManagement) { _%>
<loadData
file="config/liquibase/data/user.csv"
separator=";"
tableName="<%= user.entityTableName %>"
usePreparedStatements="true">
<%_ if (prodDatabaseTypePostgres) { _%>
<%_ if (prodDatabaseTypePostgres) { _%>
<column name="id" type="<%= idField.loadColumnType %>"/>
<%_ } _%>
<%_ } _%>
<column name="activated" type="boolean"/>
<column name="created_date" type="timestamp"/>
</loadData>
Expand All @@ -160,9 +161,8 @@ _%>
usePreparedStatements="true">
<column name="user_id" type="<%= idField.loadColumnType %>"/>
</loadData>
<%_ } _%>
<dropDefaultValue tableName="<%= user.entityTableName %>" columnName="created_date" columnDataType="${datetimeType}"/>
<%_ } _%>
<dropDefaultValue tableName="<%= user.entityTableName %>" columnName="created_date" columnDataType="${datetimeType}"/>
<%_ } _%>
</changeSet>

Expand Down
3 changes: 3 additions & 0 deletions generators/server/__snapshots__/elasticsearch.spec.mts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2397,6 +2397,9 @@ Object {
"src/main/java/com/package/config/WebConfigurer.java": Object {
"stateCleared": "modified",
},
"src/main/java/com/package/config/dbmigrations/InitialSetupMigration.java": Object {
"stateCleared": "modified",
},
"src/main/java/com/package/config/dbmigrations/package-info.java": Object {
"stateCleared": "modified",
},
Expand Down
Loading

0 comments on commit 8d326e0

Please sign in to comment.