Compare commits
9 Commits
0fc7d3e9bb
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 64032861e0 | |||
| ec866f2d05 | |||
| 89c126b469 | |||
| 118398fa68 | |||
| 05f4ed5b2a | |||
| ec39ba59be | |||
| cf8466aaf6 | |||
| ef7837b276 | |||
| 4e02b68d8a |
4
.gitignore
vendored
4
.gitignore
vendored
@ -165,4 +165,6 @@ _media/cluster/
|
|||||||
wheelhouse
|
wheelhouse
|
||||||
|
|
||||||
# RS256 을 위한 적용 keys 폴더
|
# RS256 을 위한 적용 keys 폴더
|
||||||
keys
|
keys
|
||||||
|
|
||||||
|
msa-django-auth.code-workspace
|
||||||
@ -1,5 +1,5 @@
|
|||||||
# pull official base image
|
# pull official base image
|
||||||
FROM python:3.10-slim-buster
|
FROM python:3.10-slim-bullseye
|
||||||
|
|
||||||
# set work directory
|
# set work directory
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|||||||
14
README.md
14
README.md
@ -12,6 +12,20 @@ python3 manage.py runserver 0.0.0.0:8000
|
|||||||
gunicorn auth_prj.wsgi:application --bind 0.0.0.0:8000 --workers 3
|
gunicorn auth_prj.wsgi:application --bind 0.0.0.0:8000 --workers 3
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 2025-12-05 TRACE ENDPOINT 변경 ( v0.0.15 )
|
||||||
|
* 변경전 static
|
||||||
|
* 변경후 변수 처리
|
||||||
|
* TRACE_ENDPOINT='test'
|
||||||
|
* TRACE_SERVICE_NAME=''
|
||||||
|
|
||||||
|
## 2025-09-29 jaeger Endpoint 변경 ( v0.0.14 )
|
||||||
|
* 변경전: endpoint="http://jaeger-collector.istio-system:4317",
|
||||||
|
* 변경후: endpoint="http://jaeger-collector.observability.svc.cluster.local:4317",
|
||||||
|
|
||||||
|
## 2025-09-28 RS256변경 적용 ( v0.0.13 )
|
||||||
|
* Docker Build base image 변경.
|
||||||
|
* python:3.10-slim-buster > python:3.10-slim-bullseye
|
||||||
|
|
||||||
## 2025-09-28 RS256변경 적용 ( v0.0.12 )
|
## 2025-09-28 RS256변경 적용 ( v0.0.12 )
|
||||||
* 비대칭키 방식 → Private Key로 서명, Public Key로 검증.
|
* 비대칭키 방식 → Private Key로 서명, Public Key로 검증.
|
||||||
* 토큰 발급 서버는 Private Key만 보관.
|
* 토큰 발급 서버는 Private Key만 보관.
|
||||||
|
|||||||
@ -34,6 +34,9 @@ else:
|
|||||||
|
|
||||||
# SECURITY WARNING: keep the secret key used in production secret!
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||||||
SECRET_KEY = os.environ.get('SECRET_KEY', 'django-insecure-ec9me^z%x7-2vwee5#qq(kvn@^cs!!22_*f-im(320_k5-=0j5')
|
SECRET_KEY = os.environ.get('SECRET_KEY', 'django-insecure-ec9me^z%x7-2vwee5#qq(kvn@^cs!!22_*f-im(320_k5-=0j5')
|
||||||
|
SERVICE_PLATFORM = os.getenv("SERVICE_PLATFORM", "none")
|
||||||
|
TRACE_SERVICE_NAME = os.getenv("TRACE_SERVICE_NAME", "msa-django-auth")
|
||||||
|
TRACE_ENDPOINT = os.getenv("TRACE_ENDPOINT", "none")
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = int(os.environ.get('DEBUG', 1))
|
DEBUG = int(os.environ.get('DEBUG', 1))
|
||||||
|
|||||||
@ -27,14 +27,22 @@ if not settings.DEBUG:
|
|||||||
trace.set_tracer_provider(
|
trace.set_tracer_provider(
|
||||||
TracerProvider(
|
TracerProvider(
|
||||||
resource=Resource.create({
|
resource=Resource.create({
|
||||||
"service.name": "msa-django-auth",
|
"service.platform": settings.SERVICE_PLATFORM,
|
||||||
|
# "service.name": "msa-django-auth",
|
||||||
|
"service.name": settings.TRACE_SERVICE_NAME,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
otlp_exporter = OTLPSpanExporter(
|
otlp_exporter = OTLPSpanExporter(
|
||||||
endpoint="http://jaeger-collector.istio-system:4317",
|
# endpoint="http://jaeger-collector.istio-system:4317",
|
||||||
|
# endpoint="jaeger-collector.observability.svc.cluster.local:4317",
|
||||||
|
endpoint=settings.TRACE_ENDPOINT,
|
||||||
insecure=True,
|
insecure=True,
|
||||||
|
headers={
|
||||||
|
"X-Scope-OrgID": settings.SERVICE_PLATFORM,
|
||||||
|
"X-Service": settings.TRACE_SERVICE_NAME
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
trace.get_tracer_provider().add_span_processor(
|
trace.get_tracer_provider().add_span_processor(
|
||||||
|
|||||||
@ -27,6 +27,7 @@ class CustomTokenObtainPairSerializer(TokenObtainPairSerializer):
|
|||||||
token["name"] = user.name
|
token["name"] = user.name
|
||||||
token["grade"] = user.grade
|
token["grade"] = user.grade
|
||||||
token["email"] = user.email # 선택적으로 추가 가능
|
token["email"] = user.email # 선택적으로 추가 가능
|
||||||
|
token["sub"] = user.email # 선택적으로 추가 가능
|
||||||
|
|
||||||
# Kong JWT 플러그인용 issuer 정보 추가
|
# Kong JWT 플러그인용 issuer 정보 추가
|
||||||
token["iss"] = "msa-user"
|
token["iss"] = "msa-user"
|
||||||
|
|||||||
Reference in New Issue
Block a user