Open 201311113 opened 1 year ago
70031002425122 우체국
4665183671639344
510824
8:07 cfBSfyGzjELnjuoIqWELub:APA91bF2U-hcXcxGxlUzzfIEe-HuJ1s-F1lruQxLzkpH0iv85ezn3Y9l5LIuXGJDqGKgibHWvib4HuXCHLRbobOorvQCpNgVUSERHQDvoVp46_1vCpaHEWf5tC6bMHLPKcraxtmhwLNT
2023-11-28 20:15:07
tw2-messaging-documentdb.cluster-ccjjhsxk7y2z.ap-northeast-2.docdb.amazonaws.com
travelwallet
feA2#e#P3afP
ec_EeiPXqk5atNOFkHupoC:APA91bGVMms7QxIPDdV4B7IgjFxGnq_5RzqhycxCS5D_gpwducLizDRwqTaDxeX_vcc_MT6dkES170iw0ocQk8F4NIZBghJAhEvoQSInRyXd6-Kr6gGQ_BLpSN1ayop1hPLGDt9j5Z-e
number.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\1,').reverse
장종범 (0929) 1657513
aZWgW9eYGMfFsCb4JUyRtg==$4AucvXa09ubb2lYZSZswFg==$1$2$1$3, aZWgW9eYGMfFsCb4JUyRtg==$A+bL15l+gvcAcDFNVI6JHw== aZWgW9eYGMfFsCb4JUyRtg==$7$0$7, aZWgW9eYGMfFsCb4JUyRtg==$0$1
서울 은평구 연서로16길 8-2 석영빌라" travel-wallet(prod)> id.address_detail => "303호
01079238264
4028780046668783 469
Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
Kotlin: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
springdoc: swagger-ui: path: docs/swagger-ui
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui")
data class Response
fun blockUser( userId: Long ): Response<>{ return Response(code = 2000, message = "", data = null) }
No server chosen by com.mongodb.reactivestreams.client.internal.ClientSessionHelper$$Lambda$3071/0x0000000801b929d8@4c82d917 from cluster description ClusterDescription{type=UNKNOWN, connectionMode=SINGLE, serverDescriptions=[ServerDescription{address=tw2-messaging-documentdb.cluster-ccjjhsxk7y2z.ap-northeast-2.docdb.amazonaws.com:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketWriteException: Exception sending message}, caused by {io.netty.channel.StacklessClosedChannelException}}]}. Waiting for 30000 ms before timing out
4028780099621804
2812
644
No server chosen by com.mongodb.reactivestreams.client.internal.ClientSessionHelper$$Lambda$3428/0x0000000801c50480@47f9b6da from cluster description ClusterDescription{type=UNKNOWN, connectionMode=SINGLE, serverDescriptions=[ServerDescription{address=tw2-messaging-documentdb.cluster-ccjjhsxk7y2z.ap-northeast-2.docdb.amazonaws.com:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketWriteException: Exception sending message}, caused by {io.netty.channel.StacklessClosedChannelException}}]}. Waiting for 30000 ms before timing out
q3t6w9z$C&F)J@NcRfUjWnZr4u7x!A%D
4665186882681336
189
2811
@ParameterObject @PageableDefault(page = 0, size = 10) pageable: Pageable
fun mongoClient(): MongoClient{
val connectionString = ConnectionString("mongodb://travelwallet:2RE0oMs.o+^G,sdV@tw-dev-messaging-documentdb.cluster-cogohrcbmdks.ap-northeast-2.docdb.amazonaws.com:27017")
val settings = MongoClientSettings.builder()
.applyConnectionString(connectionString)
.applyToConnectionPoolSettings {builder ->
builder.minSize(10)
.maxSize(100)
.maintenanceFrequency(10, TimeUnit.MILLISECONDS)
.maintenanceInitialDelay(11,TimeUnit.MILLISECONDS)
.maxConnectionIdleTime(120, TimeUnit.SECONDS)
.maxWaitTime(15, TimeUnit.MILLISECONDS)
}.build()
return MongoClients.create(settings)
}
; nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.time.LocalDateTime` from String "2023-12-22T17:13:26.845+09:00": Failed to deserialize java.time.LocalDateTime: (java.time.format.DateTimeParseException) Text '2023-12-22T17:13:26.845+09:00' could not be parsed, unparsed text found at index 23
dev rails-db-nlb-dev.t-wal.com:6379 prod rails-db-nlb.travel-wallet.com:6379 로 각각 변경 부탁드립니다~!
https://tw2-travelwallet-service-dev.t-wal.com/ https://tw2-travelwallet-service.travel-wallet.com/ ++ db rdb도 세팅 도메인으로 redis랑 같음
@Repository
abstract class Querydsl4RepositorySupport(private val domainClass: Class<*>) {
private lateinit var querydsl: Querydsl
protected lateinit var em: EntityManager
@Autowired
lateinit var jpaQueryFactory: JPAQueryFactory
@Autowired
fun setEntityManager(em: EntityManager) {
val entityInformation =
JpaEntityInformationSupport.getEntityInformation(domainClass, em)
val resolver: SimpleEntityPathResolver = SimpleEntityPathResolver.INSTANCE
val path = resolver.createPath(entityInformation.javaType)
this.em = em
querydsl = Querydsl(em, PathBuilder(path.type, path.metadata))
}
protected fun <T> applyPagination(
pageable: Pageable,
contentQuery: Function1<JPAQueryFactory, JPAQuery<T>>
): Page<T> {
val jpaQuery: JPAQuery<T> = contentQuery.invoke(jpaQueryFactory)
val content: List<T> = querydsl.applyPagination(pageable, jpaQuery).fetch()
return PageableExecutionUtils.getPage(content, pageable, jpaQuery::fetchCount)
}
}
interface IdentificationQueryRepository {
fun findAllWaitingStatusIdentifications()
}
@Repository
class IdentificationQueryRepositoryImpl: IdentificationQueryRepository, Querydsl4RepositorySupport(Identification::class.java){
override fun findAllWaitingStatusIdentifications() {
TODO("Not yet implemented")
}
}
override fun searchUser(
pageable: Pageable,
userId: Long?,
phone: String?,
phoneLast4: String?,
name: String?,
birth: String?,
cardNo: String?,
email: String?,
cardId: Long?
): Page<SearchUserResponse>
val user = QUser.user
val userAdditionalInfo = QUserAdditionalInfo.userAdditionalInfo
val userMigration = QUserMigration.userMigration
val userEmail = QUserAuthEmail.userAuthEmail
val identification = QIdentification.identification
val isMigrated = CaseBuilder()
.`when`(userMigration.isNull.or(userMigration.isMigrated.isFalse)).then(false)
.otherwise(true)
var predicate: BooleanExpression? = null
predicate = predicate?.and(if(userId != null) user.id.eq(userId) else null) ?: if(userId != null) user.id.eq(userId) else null
predicate = predicate?.and(if(phone != null) user.encryptedPhone.eq(phone) else null) ?: if(phone != null) user.encryptedPhone.eq(phone) else null
if (phoneLast4 != null){
val phoneMasking = "010****$phoneLast4"
predicate = predicate?.and(if(phoneLast4 != null) user.phoneMasking.eq(phoneMasking) else null) ?: if(phoneLast4 != null) user.phoneMasking.eq(phoneMasking) else null
}
predicate = predicate?.and(if(name != null) user.name.eq(name) else null) ?: if(name != null) user.name.eq(name) else null
predicate = predicate?.and(if(birth != null) user.dateOfBirth.eq(birth.toLong()) else null) ?: if(birth != null) user.dateOfBirth.eq(birth.toLong()) else null
predicate = predicate?.and(if(email != null) userEmail.email.eq(email) else null) ?: if(email != null) userEmail.email.eq(email) else null
val result = applyPagination(pageable){ jpaQueryFactory ->
jpaQueryFactory
.select(
Projections.constructor(
SearchUserResponse::class.java,
user.id,
user.systemVersion,
isMigrated,
user.name,
user.encryptedPhone,
user.encryptedPhoneIv,
user.phoneMasking,
user.email,
identification.encryptedRrn,
identification.encryptedRrnIv,
user.status,
user.os,
userAdditionalInfo.latestAppVersion,
user.createdAt,
user.lastLogin
)
)
.from(user)
.leftJoin(userMigration).on(user.id.eq(userMigration.userId))
.leftJoin(userAdditionalInfo).on(user.id.eq(userAdditionalInfo.id))
.leftJoin(identification).on(user.id.eq(identification.userId))
.leftJoin(userEmail).on(user.id.eq(userEmail.userId))
.where(predicate)
}
return result
url = "uploads/"+File.basename(identification.card_image.url.split("?", 2).first)
aws = Fog::Storage.new provider: 'AWS', region: 'us-east-1', aws_access_key_id: ENV['MINIO_ACCESS_KEY'], aws_secret_access_key: ENV['MINIO_SECRET_KEY'], endpoint: ENV["MINIO_URL"], path_style: true
option = if identification.image_ver == 0
{}
else
{
'x-amz-server-side-encryption-customer-algorithm' => 'AES256',
'x-amz-server-side-encryption-customer-key' => Rails.application.credentials.minio_sse_key,
'x-amz-server-side-encryption-customer-key-md5' => Rails.application.credentials.minio_sse_md5
}
end
image = aws.directories.get('twidentity').files.get(url, option).attributes[:body]
send_data image, type: 'image/jpeg', disposition: :inline, :filename => File.basename(identification.card_image.path)
{
'x-amz-server-side-encryption-customer-algorithm' => 'AES256',
'x-amz-server-side-encryption-customer-key' => Rails.application.credentials.minio_sse_key,
'x-amz-server-side-encryption-customer-key-md5' => Rails.application.credentials.minio_sse_md5
}
@Configuration
class AwsS3Config {
@Value("\${cloud.aws.credentials.access-key}")
private val accessKey: String? = null
@Value("\${cloud.aws.credentials.secret-key}")
private val secretKey: String? = null
@Value("\${cloud.aws.credentials.end-point}")
private val endPoint: String? = null
@Bean
fun s3ClientForIdentification(): S3Client{
return S3Client.builder()
.region(Region.US_EAST_1)
.endpointOverride(URI(endPoint!!))
.credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create(accessKey, secretKey)))
.build()
}
}
url = "uploads/"+File.basename(identification.card_image.url.split("?", 2).first)
aws = Fog::Storage.new provider: 'AWS', region: 'us-east-1', aws_access_key_id: ENV['MINIO_ACCESS_KEY'], aws_secret_access_key: ENV['MINIO_SECRET_KEY'], endpoint: ENV["MINIO_URL"], path_style: true
option = if identification.image_ver == 0
{}
else
{
'x-amz-server-side-encryption-customer-algorithm' => 'AES256',
'x-amz-server-side-encryption-customer-key' => Rails.application.credentials.minio_sse_key,
'x-amz-server-side-encryption-customer-key-md5' => Rails.application.credentials.minio_sse_md5
}
end
image = aws.directories.get('twidentity').files.get(url, option).attributes[:body]
send_data image, type: 'image/jpeg', disposition: :inline, :filename => File.basename(identification.card_image.path)
url = "uploads/"+File.basename(identification.card_image.url.split("?", 2).first)
aws = Fog::Storage.new provider: 'AWS', region: 'us-east-1', aws_access_key_id: ENV['MINIO_ACCESS_KEY'], aws_secret_access_key: ENV['MINIO_SECRET_KEY'], endpoint: ENV["MINIO_URL"], path_style: true
option = if identification.image_ver == 0
{}
else
{
'x-amz-server-side-encryption-customer-algorithm' => 'AES256',
'x-amz-server-side-encryption-customer-key' => Rails.application.credentials.minio_sse_key,
'x-amz-server-side-encryption-customer-key-md5' => Rails.application.credentials.minio_sse_md5
}
end
image = aws.directories.get('twidentity').files.get(url, option).attributes[:body]
send_data image, type: 'image/jpeg', disposition: :inline, :filename => File.basename(identification.card_image.path)
class Identification < ApplicationRecord
mount_uploader :card_image, PassportImageUploader
validates_integrity_of :card_image
validates_processing_of :card_image
validates_download_of :card_image
.
.
.
class PassportImageUploader < CarrierWave::Uploader::Base
if Rails.env.local? || Rails.env.test?
storage :file
else
storage :fog
end
def extension_whitelist
%w(jpg jpeg gif png enc)
end
def filename
"#{secure_token}.#{file.extension}" if original_filename.present?
end
protected
def secure_token
var = :"@#{mounted_as}_secure_token"
model.instance_variable_get(var) or model.instance_variable_set(var, SecureRandom.uuid)
end
end
software.amazon.awssdk.core.exception.SdkClientException: Unable to execute HTTP request: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at software.amazon.awssdk.core.exception.SdkClientException$BuilderImpl.build(SdkClientException.java:102)
at software.amazon.awssdk.core.exception.SdkClientException.create(SdkClientException.java:47)
at software.amazon.awssdk.core.internal.http.pipeline.stages.utils.RetryableStageHelper.setLastException(RetryableStageHelper.java:211)
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:371)
at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:314)
echo -n | openssl s_client -connect HOST:PORTNUMBER \
| sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/server.crt
keytool -import -trustcacerts -file /tmp/server.crt -alias Server-alias -keystore $JAVA_HOME/jre/lib/security/cacerts
echo | openssl s_client -servername hostname -connect 172.17.13.12:9000 2>/dev/null | openssl x509 -text > server.crt
@Bean
fun s3ClientForIdentification(): S3Client{
return S3Client.builder()
.region(Region.US_EAST_1)
.endpointOverride(URI(endPoint!!))
.credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create(accessKey, secretKey)))
.build()
}
4665183238644399