mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-10-10 11:49:05 +02:00
fix: only return minimal client metadata for public interaction endpoint
This commit is contained in:
@@ -14,12 +14,20 @@ const (
|
||||
)
|
||||
|
||||
type interactionSessionForUser struct {
|
||||
ID string `json:"id"`
|
||||
Scopes []string `json:"scopes"`
|
||||
ScopeInfo []dto.ScopeInfoDto `json:"scopeInfo"`
|
||||
Client dto.OidcClientMetaDataDto `json:"client"`
|
||||
CurrentStep interactionStep `json:"currentStep,omitempty"`
|
||||
RequiredSteps []interactionStep `json:"requiredSteps"`
|
||||
ID string `json:"id"`
|
||||
Scopes []string `json:"scopes"`
|
||||
ScopeInfo []dto.ScopeInfoDto `json:"scopeInfo"`
|
||||
Client interactionClient `json:"client"`
|
||||
CurrentStep interactionStep `json:"currentStep,omitempty"`
|
||||
RequiredSteps []interactionStep `json:"requiredSteps"`
|
||||
}
|
||||
|
||||
type interactionClient struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
HasLogo bool `json:"hasLogo"`
|
||||
HasDarkLogo bool `json:"hasDarkLogo"`
|
||||
ClientType string `json:"clientType"`
|
||||
}
|
||||
|
||||
type completeInteractionRequest struct {
|
||||
@@ -32,7 +40,7 @@ type completeInteractionResponse struct {
|
||||
}
|
||||
|
||||
func newInteractionSessionForUser(interactionSession InteractionSession) (interactionSessionForUser, error) {
|
||||
var client dto.OidcClientMetaDataDto
|
||||
var client interactionClient
|
||||
if err := dto.MapStruct(interactionSession.Client, &client); err != nil {
|
||||
return interactionSessionForUser{}, err
|
||||
}
|
||||
|
||||
@@ -137,11 +137,16 @@ export type InteractionScopeInfo = {
|
||||
description?: string;
|
||||
};
|
||||
|
||||
export type InteractionClient = Pick<
|
||||
OidcClientMetaData,
|
||||
'id' | 'name' | 'hasLogo' | 'hasDarkLogo' | 'clientType'
|
||||
>;
|
||||
|
||||
export type InteractionSession = {
|
||||
id: string;
|
||||
scopes: string[];
|
||||
scopeInfo: InteractionScopeInfo[];
|
||||
client: OidcClientMetaData;
|
||||
client: InteractionClient;
|
||||
currentStep?: InteractionStep;
|
||||
requiredSteps: InteractionStep[];
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import CrossAnimated from '#lib/icons/cross-animated.svelte';
|
||||
import { m } from '#lib/paraglide/messages.js';
|
||||
import appConfigStore from '#lib/stores/application-configuration-store.ts';
|
||||
import type { OidcClientMetaData } from '#lib/types/oidc.type.ts';
|
||||
import type { InteractionClient } from '#lib/types/oidc.type.ts';
|
||||
import { cachedOidcClientLogo } from '#lib/utils/cached-image-util.ts';
|
||||
import { mode } from 'mode-watcher';
|
||||
import { untrack } from 'svelte';
|
||||
@@ -21,7 +21,7 @@
|
||||
}: {
|
||||
success?: boolean;
|
||||
error?: boolean;
|
||||
client?: OidcClientMetaData;
|
||||
client?: InteractionClient;
|
||||
} = $props();
|
||||
|
||||
// Each tile travels this far so they meet in the middle
|
||||
|
||||
Reference in New Issue
Block a user