1
0
forked from baron/baron-sso

backend code-check 오류 수정

This commit is contained in:
2026-04-24 14:59:40 +09:00
parent 7fd750b587
commit 081cd6739a
4 changed files with 15 additions and 3 deletions

View File

@@ -1144,6 +1144,7 @@ func buildOidcClaimsFromTraits(traits map[string]any, scopes []string, tenantID
return claims
}
func withOidcSessionMetadata(claims map[string]any, sessionID string) map[string]any {
if claims == nil {
claims = map[string]any{}

View File

@@ -265,4 +265,3 @@ func TestGetConsentRequest_Skip_DynamicClaims(t *testing.T) {
assert.Equal(t, "Security", capturedClaims["department"])
assert.Equal(t, "Officer", capturedClaims["position"])
}

View File

@@ -154,7 +154,19 @@ func (m *mockConsentRepo) ListBySubject(ctx context.Context, subject string) ([]
}
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) {
results := make([]domain.ClientConsentWithTenantInfo, 0, len(m.consents))
for _, consent := range m.consents {

View File

@@ -323,7 +323,7 @@ func (h *UserHandler) GetUser(c *fiber.Ctx) error {
}
return c.JSON(h.mapIdentitySummary(c.Context(), *identity))
}
}
func (h *UserHandler) CreateUser(c *fiber.Ctx) error {
if h.OryProvider == nil || h.KratosAdmin == nil {