forked from baron/baron-sso
클라이언트 생성일 표시 기능 추가
This commit is contained in:
@@ -306,6 +306,7 @@ func (h *DevHandler) CreateClient(c *fiber.Ctx) error {
|
|||||||
metadata = map[string]interface{}{}
|
metadata = map[string]interface{}{}
|
||||||
}
|
}
|
||||||
metadata["status"] = status
|
metadata["status"] = status
|
||||||
|
metadata["created_at"] = time.Now().Format(time.RFC3339)
|
||||||
|
|
||||||
tokenAuthMethod := strings.TrimSpace(valueOr(req.TokenEndpointAuthMethod, ""))
|
tokenAuthMethod := strings.TrimSpace(valueOr(req.TokenEndpointAuthMethod, ""))
|
||||||
if tokenAuthMethod == "" {
|
if tokenAuthMethod == "" {
|
||||||
@@ -683,10 +684,17 @@ func generateRandomSecret(length int) (string, error) {
|
|||||||
|
|
||||||
func (h *DevHandler) mapClientSummary(client domain.HydraClient) clientSummary {
|
func (h *DevHandler) mapClientSummary(client domain.HydraClient) clientSummary {
|
||||||
status := "active"
|
status := "active"
|
||||||
|
var createdAt *time.Time
|
||||||
|
|
||||||
if client.Metadata != nil {
|
if client.Metadata != nil {
|
||||||
if value, ok := client.Metadata["status"].(string); ok && strings.ToLower(value) == "inactive" {
|
if value, ok := client.Metadata["status"].(string); ok && strings.ToLower(value) == "inactive" {
|
||||||
status = "inactive"
|
status = "inactive"
|
||||||
}
|
}
|
||||||
|
if value, ok := client.Metadata["created_at"].(string); ok {
|
||||||
|
if t, err := time.Parse(time.RFC3339, value); err == nil {
|
||||||
|
createdAt = &t
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
clientType := "private"
|
clientType := "private"
|
||||||
@@ -732,6 +740,7 @@ func (h *DevHandler) mapClientSummary(client domain.HydraClient) clientSummary {
|
|||||||
Name: name,
|
Name: name,
|
||||||
Type: clientType,
|
Type: clientType,
|
||||||
Status: status,
|
Status: status,
|
||||||
|
CreatedAt: createdAt,
|
||||||
RedirectURIs: client.RedirectURIs,
|
RedirectURIs: client.RedirectURIs,
|
||||||
Scopes: scopes,
|
Scopes: scopes,
|
||||||
ClientSecret: clientSecret,
|
ClientSecret: clientSecret,
|
||||||
|
|||||||
Reference in New Issue
Block a user