Compare commits
No commits in common. "main" and "feat/refactor" have entirely different histories.
main
...
feat/refac
1
Makefile
1
Makefile
|
@ -8,7 +8,6 @@ LDFLAGS := -s -w
|
|||
VERSION="v1.0.1"
|
||||
DOCKER_REPO="reg.wang/app-cloudep-permission-service"
|
||||
|
||||
|
||||
.PHONY: test
|
||||
test: # 進行測試
|
||||
go test -v --cover ./...
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# BUILDER #
|
||||
###########
|
||||
|
||||
FROM golang:1.24.0 as builder
|
||||
FROM golang:1.24.0 AS builder
|
||||
|
||||
ARG VERSION
|
||||
ARG BUILT
|
||||
|
|
|
@ -130,6 +130,8 @@ message GetSystemClaimResp {
|
|||
map<string,string> data = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 跟 Token 相關的大小事,這次只回應錯誤,以及結果,不統一規範
|
||||
// 錯誤碼應該在 Biz GW 在做回應,另外我這邊取名字比較通用,
|
||||
// access_token -> token , refresh_token -> one_time_token
|
||||
|
|
|
@ -15,10 +15,6 @@ func (use *additional) GetAll() map[string]string {
|
|||
}
|
||||
|
||||
func (use *additional) Set(key token.Additional, val string) {
|
||||
if use.additional == nil {
|
||||
use.additional = make(map[string]string)
|
||||
}
|
||||
|
||||
use.additional[key.String()] = val
|
||||
}
|
||||
|
||||
|
|
|
@ -450,13 +450,12 @@ func (use *TokenUseCase) newToken(ctx context.Context, req *usecase.GenerateToke
|
|||
RefreshCreateAt: now.UnixNano(),
|
||||
UID: req.UID,
|
||||
}
|
||||
// 故意 data 裡面不會有那些已經有的欄位資訊
|
||||
data := NewAdditional(req.Data)
|
||||
initData := make(map[string]string, 0)
|
||||
for k, v := range req.Data {
|
||||
initData[k] = v
|
||||
}
|
||||
|
||||
// 故意 data 裡面不會有那些已經有的欄位資訊
|
||||
data := NewAdditional(initData)
|
||||
data.Set(dt.ID, token.ID)
|
||||
data.Set(dt.Role, req.Role)
|
||||
data.Set(dt.Scope, req.Scope)
|
||||
|
|
Loading…
Reference in New Issue