update
This commit is contained in:
parent
1ce37a91ce
commit
b15fa3f709
15
docs/docs.go
15
docs/docs.go
@ -1002,7 +1002,7 @@ const docTemplate = `{
|
||||
],
|
||||
"properties": {
|
||||
"user_id": {
|
||||
"$ref": "#/definitions/user.ID"
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -1219,7 +1219,7 @@ const docTemplate = `{
|
||||
"type": "string"
|
||||
},
|
||||
"user_id": {
|
||||
"$ref": "#/definitions/user.ID"
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -1236,7 +1236,7 @@ const docTemplate = `{
|
||||
"type": "string"
|
||||
},
|
||||
"user_id": {
|
||||
"$ref": "#/definitions/user.ID"
|
||||
"type": "string"
|
||||
},
|
||||
"workspace": {
|
||||
"$ref": "#/definitions/entity.Workspace"
|
||||
@ -1294,15 +1294,6 @@ const docTemplate = `{
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"user.ID": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"anonymous"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"AnonymousUser"
|
||||
]
|
||||
}
|
||||
},
|
||||
"securityDefinitions": {
|
||||
|
@ -993,7 +993,7 @@
|
||||
],
|
||||
"properties": {
|
||||
"user_id": {
|
||||
"$ref": "#/definitions/user.ID"
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -1210,7 +1210,7 @@
|
||||
"type": "string"
|
||||
},
|
||||
"user_id": {
|
||||
"$ref": "#/definitions/user.ID"
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -1227,7 +1227,7 @@
|
||||
"type": "string"
|
||||
},
|
||||
"user_id": {
|
||||
"$ref": "#/definitions/user.ID"
|
||||
"type": "string"
|
||||
},
|
||||
"workspace": {
|
||||
"$ref": "#/definitions/entity.Workspace"
|
||||
@ -1285,15 +1285,6 @@
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"user.ID": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"anonymous"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"AnonymousUser"
|
||||
]
|
||||
}
|
||||
},
|
||||
"securityDefinitions": {
|
||||
|
@ -2,7 +2,7 @@ definitions:
|
||||
dto.AddWorkspaceMemberRequest:
|
||||
properties:
|
||||
user_id:
|
||||
$ref: '#/definitions/user.ID'
|
||||
type: string
|
||||
required:
|
||||
- user_id
|
||||
type: object
|
||||
@ -145,7 +145,7 @@ definitions:
|
||||
updated_at:
|
||||
type: string
|
||||
user_id:
|
||||
$ref: '#/definitions/user.ID'
|
||||
type: string
|
||||
type: object
|
||||
entity.WorkspaceMember:
|
||||
properties:
|
||||
@ -156,7 +156,7 @@ definitions:
|
||||
updated_at:
|
||||
type: string
|
||||
user_id:
|
||||
$ref: '#/definitions/user.ID'
|
||||
type: string
|
||||
workspace:
|
||||
$ref: '#/definitions/entity.Workspace'
|
||||
workspace_id:
|
||||
@ -194,12 +194,6 @@ definitions:
|
||||
message:
|
||||
type: string
|
||||
type: object
|
||||
user.ID:
|
||||
enum:
|
||||
- anonymous
|
||||
type: string
|
||||
x-enum-varnames:
|
||||
- AnonymousUser
|
||||
info:
|
||||
contact: {}
|
||||
title: API Docs
|
||||
|
@ -5,8 +5,8 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// AnonymousUser 调试模式下的用户
|
||||
const AnonymousUser ID = "anonymous"
|
||||
// AnonymousUser 调试模式下的用户,这里使用 string 是防止 swag go 解析为 enum
|
||||
const AnonymousUser string = "anonymous"
|
||||
|
||||
type Token struct {
|
||||
Aud string `json:"aud"`
|
||||
|
@ -71,7 +71,7 @@ func (a *Service) SetUser(ctx context.Context, user *user.User) context.Context
|
||||
}
|
||||
|
||||
func (a *Service) parseUserJWT(tokenType constants.JwtTokenTypes, jwtToken string) (*user.User, error) {
|
||||
var sub = user.AnonymousUser
|
||||
var sub = user.ID(user.AnonymousUser)
|
||||
var jwtIdToken = new(user.User)
|
||||
|
||||
if a.config.Debug.Enabled {
|
||||
|
Loading…
Reference in New Issue
Block a user