From 38a493d18145bbaaffa4a1f5a91e1deb41ec5e28 Mon Sep 17 00:00:00 2001 From: Kirill Date: Thu, 24 Oct 2024 19:18:32 +0300 Subject: [PATCH 1/4] Remove VK and Yandex links and labels on the login and register pages. --- resources/view/login.html | 8 -------- resources/view/unauth/register.html | 9 +-------- src/main/resources/application.yaml | 24 ------------------------ 3 files changed, 1 insertion(+), 40 deletions(-) diff --git a/resources/view/login.html b/resources/view/login.html index 8765ca8ff..d49ce5691 100644 --- a/resources/view/login.html +++ b/resources/view/login.html @@ -48,14 +48,6 @@

Sign in

type="button"> - - - - - - diff --git a/resources/view/unauth/register.html b/resources/view/unauth/register.html index 2ba955045..63c5c8bc3 100644 --- a/resources/view/unauth/register.html +++ b/resources/view/unauth/register.html @@ -77,14 +77,7 @@

Registration

type="button"> - - - - - - + diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 7fcba1570..d9660eb05 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -61,20 +61,6 @@ spring: scope: - email - profile - vk: - client-id: 51562377 - client-secret: jNM1YHQy1362Mqs49wUN - client-name: Vkontakte - redirect-uri: "{baseUrl}/login/oauth2/code/{registrationId}" - client-authentication-method: client_secret_post - authorization-grant-type: authorization_code - scope: email - yandex: - client-id: 2f3395214ba84075956b76a34b231985 - client-secret: ed236c501e444a609b0f419e5e88f1e1 - client-name: Yandex - redirect-uri: "{baseUrl}/login/oauth2/code/{registrationId}" - authorization-grant-type: authorization_code gitlab: client-id: b8520a3266089063c0d8261cce36971defa513f5ffd9f9b7a3d16728fc83a494 client-secret: e72c65320cf9d6495984a37b0f9cc03ec46be0bb6f071feaebbfe75168117004 @@ -83,16 +69,6 @@ spring: authorization-grant-type: authorization_code scope: read_user provider: - vk: - authorization-uri: https://oauth.vk.com/authorize - token-uri: https://oauth.vk.com/access_token - user-info-uri: https://api.vk.com/method/users.get?v=8.1 - user-name-attribute: response - yandex: - authorization-uri: https://oauth.yandex.ru/authorize - token-uri: https://oauth.yandex.ru/token - user-info-uri: https://login.yandex.ru/info - user-name-attribute: login gitlab: authorization-uri: https://gitlab.com/oauth/authorize token-uri: https://gitlab.com/oauth/token From f2e706ae5868bcefa989e6139af476ecd3089b12 Mon Sep 17 00:00:00 2001 From: Kirill Date: Thu, 24 Oct 2024 20:30:07 +0300 Subject: [PATCH 2/4] Remove VK and Yandex links and labels on the login and register pages. --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index f6c152c68..0e23fb071 100644 --- a/pom.xml +++ b/pom.xml @@ -97,6 +97,7 @@ org.projectlombok lombok true + 1.18.30 org.mapstruct From abec27c7686e8b39e5b58703fd75681889ee25da Mon Sep 17 00:00:00 2001 From: Kirill Date: Thu, 24 Oct 2024 20:34:22 +0300 Subject: [PATCH 3/4] Remove sensitive DB, OAuth2 and mail settings information --- src/main/resources/application.yaml | 46 ++--------------------------- 1 file changed, 2 insertions(+), 44 deletions(-) diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index d9660eb05..be8319782 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -8,6 +8,8 @@ app: max-pool-size: 100 spring: + config: + import: optional:application-secrets.yaml init: mode: never jpa: @@ -25,10 +27,6 @@ spring: default_batch_fetch_size: 20 # https://stackoverflow.com/questions/21257819/what-is-the-difference-between-hibernate-jdbc-fetch-size-and-hibernate-jdbc-batc jdbc.batch_size: 20 - datasource: - url: jdbc:postgresql://localhost:5432/jira - username: jira - password: JiraRush liquibase: changeLog: "classpath:db/changelog.sql" @@ -46,50 +44,10 @@ spring: cache-names: users caffeine.spec: maximumSize=10000,expireAfterAccess=5m - security: - oauth2: - client: - registration: - github: - client-id: 3d0d8738e65881fff266 - client-secret: 0f97031ce6178b7dfb67a6af587f37e222a16120 - scope: - - email - google: - client-id: 329113642700-f8if6pu68j2repq3ef6umd5jgiliup60.apps.googleusercontent.com - client-secret: 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 - scope: - - email - - profile - gitlab: - client-id: b8520a3266089063c0d8261cce36971defa513f5ffd9f9b7a3d16728fc83a494 - client-secret: e72c65320cf9d6495984a37b0f9cc03ec46be0bb6f071feaebbfe75168117004 - client-name: GitLab - redirect-uri: "{baseUrl}/login/oauth2/code/{registrationId}" - authorization-grant-type: authorization_code - scope: read_user - provider: - gitlab: - authorization-uri: https://gitlab.com/oauth/authorize - token-uri: https://gitlab.com/oauth/token - user-info-uri: https://gitlab.com/api/v4/user - user-name-attribute: email - sql: init: mode: always - mail: - properties: - mail: - smtp: - starttls: - enable: true - auth: true - host: smtp.gmail.com - username: jira4jr@gmail.com - password: zdfzsrqvgimldzyj - port: 587 thymeleaf.check-template-location: false mvc.throw-exception-if-no-handler-found: true From c1d2d3b85c3e71d985ae5fb144e8a85567a07403 Mon Sep 17 00:00:00 2001 From: Kirill Date: Thu, 24 Oct 2024 20:35:00 +0300 Subject: [PATCH 4/4] Create file. Transfer sensitive DB, OAuth2 and mail settings information from "application.yaml". --- src/main/resources/application-secrets.yaml | 46 +++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/main/resources/application-secrets.yaml diff --git a/src/main/resources/application-secrets.yaml b/src/main/resources/application-secrets.yaml new file mode 100644 index 000000000..beaf7793d --- /dev/null +++ b/src/main/resources/application-secrets.yaml @@ -0,0 +1,46 @@ +spring: + datasource: + url: jdbc:postgresql://localhost:5432/jira + username: jira + password: JiraRush + + security: + oauth2: + client: + registration: + github: + client-id: 3d0d8738e65881fff266 + client-secret: 0f97031ce6178b7dfb67a6af587f37e222a16120 + scope: + - email + google: + client-id: 329113642700-f8if6pu68j2repq3ef6umd5jgiliup60.apps.googleusercontent.com + client-secret: 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 + scope: + - email + - profile + gitlab: + client-id: b8520a3266089063c0d8261cce36971defa513f5ffd9f9b7a3d16728fc83a494 + client-secret: e72c65320cf9d6495984a37b0f9cc03ec46be0bb6f071feaebbfe75168117004 + client-name: GitLab + redirect-uri: "{baseUrl}/login/oauth2/code/{registrationId}" + authorization-grant-type: authorization_code + scope: read_user + provider: + gitlab: + authorization-uri: https://gitlab.com/oauth/authorize + token-uri: https://gitlab.com/oauth/token + user-info-uri: https://gitlab.com/api/v4/user + user-name-attribute: email + + mail: + properties: + mail: + smtp: + starttls: + enable: true + auth: true + host: smtp.gmail.com + username: jira4jr@gmail.com + password: zdfzsrqvgimldzyj + port: 587