-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from ecolink-JOIN/feature/login
Feat: 로그인 로직 추가
- Loading branch information
Showing
41 changed files
with
1,069 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,99 +1,107 @@ | ||
buildscript { | ||
ext { | ||
queryDslVersion = "5.0.0" | ||
} | ||
ext { | ||
queryDslVersion = "5.0.0" | ||
} | ||
} | ||
|
||
plugins { | ||
id 'java' | ||
id 'org.springframework.boot' version '3.3.2' | ||
id 'io.spring.dependency-management' version '1.1.6' | ||
id 'java' | ||
id 'org.springframework.boot' version '3.3.2' | ||
id 'io.spring.dependency-management' version '1.1.6' | ||
} | ||
|
||
group = 'com.join' | ||
version = '0.0.1-SNAPSHOT' | ||
|
||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
} | ||
|
||
configurations { | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenCentral() | ||
} | ||
|
||
ext { | ||
set('springCloudVersion', "2022.0.4") | ||
set('springCloudVersion', "2022.0.4") | ||
} | ||
|
||
dependencies { | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-data-redis' | ||
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' | ||
implementation 'org.springframework.boot:spring-boot-starter-security' | ||
implementation 'org.springframework.boot:spring-boot-starter-validation' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'org.springframework.session:spring-session-data-redis' | ||
compileOnly 'org.projectlombok:lombok' | ||
runtimeOnly 'com.mysql:mysql-connector-j' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testImplementation 'org.springframework.security:spring-security-test' | ||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher' | ||
annotationProcessor "jakarta.persistence:jakarta.persistence-api" | ||
|
||
//Spring Docs(swagger) | ||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0' | ||
|
||
//AWS S3 SDK | ||
implementation platform('com.amazonaws:aws-java-sdk-bom:1.11.1000') | ||
implementation 'com.amazonaws:aws-java-sdk-s3' | ||
|
||
// Utils | ||
implementation 'com.google.guava:guava:28.2-jre' | ||
implementation 'org.apache.commons:commons-lang3:3.9' | ||
|
||
|
||
//QueryDSL | ||
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta' | ||
annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta" | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-data-redis' | ||
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' | ||
implementation 'org.springframework.boot:spring-boot-starter-security' | ||
implementation 'org.springframework.boot:spring-boot-starter-validation' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'org.springframework.session:spring-session-data-redis' | ||
compileOnly 'org.projectlombok:lombok' | ||
runtimeOnly 'com.mysql:mysql-connector-j' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testImplementation 'org.springframework.security:spring-security-test' | ||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher' | ||
annotationProcessor "jakarta.persistence:jakarta.persistence-api" | ||
|
||
//Spring Docs(swagger) | ||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0' | ||
|
||
//AWS S3 SDK | ||
implementation platform('com.amazonaws:aws-java-sdk-bom:1.11.1000') | ||
implementation 'com.amazonaws:aws-java-sdk-s3' | ||
|
||
// Utils | ||
implementation 'com.google.guava:guava:28.2-jre' | ||
implementation 'org.apache.commons:commons-lang3:3.9' | ||
|
||
// MapStruct | ||
implementation 'org.mapstruct:mapstruct:1.4.2.Final' | ||
annotationProcessor "org.mapstruct:mapstruct-processor:1.4.2.Final" | ||
annotationProcessor( | ||
'org.projectlombok:lombok', | ||
'org.projectlombok:lombok-mapstruct-binding:0.1.0' | ||
) | ||
|
||
|
||
//QueryDSL | ||
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta' | ||
annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta" | ||
} | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
useJUnitPlatform() | ||
} | ||
|
||
dependencyManagement { | ||
imports { | ||
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" | ||
} | ||
imports { | ||
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" | ||
} | ||
} | ||
|
||
tasks.named('bootBuildImage') { | ||
builder = 'paketobuildpacks/builder-jammy-base:latest' | ||
builder = 'paketobuildpacks/builder-jammy-base:latest' | ||
} | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
useJUnitPlatform() | ||
} | ||
|
||
def querydslDir = "$buildDir/generated/querydsl" | ||
|
||
sourceSets { | ||
main.java.srcDirs += [ querydslDir ] | ||
main.java.srcDirs += [querydslDir] | ||
} | ||
|
||
tasks.withType(JavaCompile) { | ||
options.annotationProcessorGeneratedSourcesDirectory = file(querydslDir) | ||
options.annotationProcessorGeneratedSourcesDirectory = file(querydslDir) | ||
} | ||
|
||
clean.doLast { | ||
file(querydslDir).deleteDir() | ||
file(querydslDir).deleteDir() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/main/java/com/join/core/auth/domain/AuthenticationToken.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.join.core.auth.domain; | ||
|
||
import java.util.Collection; | ||
|
||
import org.springframework.security.authentication.AbstractAuthenticationToken; | ||
import org.springframework.security.core.GrantedAuthority; | ||
|
||
public class AuthenticationToken extends AbstractAuthenticationToken { | ||
|
||
private final UserPrincipal principal; | ||
|
||
private AuthenticationToken(UserPrincipal principal, Collection<? extends GrantedAuthority> authorities) { | ||
super(authorities); | ||
this.principal = principal; | ||
} | ||
|
||
public AuthenticationToken(UserInfo.SigIn sigIn) { | ||
this(UserPrincipal.of(sigIn), sigIn.getAuthorities()); | ||
} | ||
|
||
@Override | ||
public Object getCredentials() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Object getPrincipal() { | ||
return this.principal; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) | ||
return true; | ||
if (!(o instanceof AuthenticationToken that)) | ||
return false; | ||
if (!super.equals(o)) | ||
return false; | ||
|
||
return principal.equals(that.principal); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int result = super.hashCode(); | ||
result = 31 * result + principal.hashCode(); | ||
return result; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.