forked from baron/baron-sso
backend code-check 오류 수정
This commit is contained in:
@@ -1144,6 +1144,7 @@ func buildOidcClaimsFromTraits(traits map[string]any, scopes []string, tenantID
|
|||||||
|
|
||||||
return claims
|
return claims
|
||||||
}
|
}
|
||||||
|
|
||||||
func withOidcSessionMetadata(claims map[string]any, sessionID string) map[string]any {
|
func withOidcSessionMetadata(claims map[string]any, sessionID string) map[string]any {
|
||||||
if claims == nil {
|
if claims == nil {
|
||||||
claims = map[string]any{}
|
claims = map[string]any{}
|
||||||
|
|||||||
@@ -265,4 +265,3 @@ func TestGetConsentRequest_Skip_DynamicClaims(t *testing.T) {
|
|||||||
assert.Equal(t, "Security", capturedClaims["department"])
|
assert.Equal(t, "Security", capturedClaims["department"])
|
||||||
assert.Equal(t, "Officer", capturedClaims["position"])
|
assert.Equal(t, "Officer", capturedClaims["position"])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,19 @@ func (m *mockConsentRepo) ListBySubject(ctx context.Context, subject string) ([]
|
|||||||
}
|
}
|
||||||
return results, nil
|
return results, nil
|
||||||
}
|
}
|
||||||
func (m *mockConsentRepo) Delete(ctx context.Context, clientID, subject string) error { return nil }
|
|
||||||
|
func (m *mockConsentRepo) Find(ctx context.Context, clientID, subject string) (*domain.ClientConsent, error) {
|
||||||
|
for _, consent := range m.consents {
|
||||||
|
if consent.ClientID == clientID && consent.Subject == subject {
|
||||||
|
found := consent
|
||||||
|
return &found, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *mockConsentRepo) Delete(ctx context.Context, subject, clientID string) error { return nil }
|
||||||
|
|
||||||
func (m *mockConsentRepo) List(ctx context.Context, clientID string, limit, offset int) ([]domain.ClientConsentWithTenantInfo, int64, error) {
|
func (m *mockConsentRepo) List(ctx context.Context, clientID string, limit, offset int) ([]domain.ClientConsentWithTenantInfo, int64, error) {
|
||||||
results := make([]domain.ClientConsentWithTenantInfo, 0, len(m.consents))
|
results := make([]domain.ClientConsentWithTenantInfo, 0, len(m.consents))
|
||||||
for _, consent := range m.consents {
|
for _, consent := range m.consents {
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ func (h *UserHandler) GetUser(c *fiber.Ctx) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return c.JSON(h.mapIdentitySummary(c.Context(), *identity))
|
return c.JSON(h.mapIdentitySummary(c.Context(), *identity))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *UserHandler) CreateUser(c *fiber.Ctx) error {
|
func (h *UserHandler) CreateUser(c *fiber.Ctx) error {
|
||||||
if h.OryProvider == nil || h.KratosAdmin == nil {
|
if h.OryProvider == nil || h.KratosAdmin == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user