UNPKG

@infosel-sdk/core

Version:

Core SDK for Infosel financial services platform. Provides essential infrastructure for authentication, HTTP/GraphQL communication, storage management, and error handling.

55 lines (54 loc) 1.64 kB
import { AuthConfiguration, AuthCredentials, AuthType, Environment, ValidationResult } from './auth_configuration'; import Token from '../entities/token'; export declare class AuthConfigurationBuilder { private config; private validator; /** * Sets the authentication type */ withType(type: AuthType): AuthConfigurationBuilder; /** * Sets the realm for authentication */ withRealm(realm: string): AuthConfigurationBuilder; /** * Sets the environment (qa or prod) */ withEnvironment(environment: Environment): AuthConfigurationBuilder; /** * Sets the client ID (optional, defaults per auth type) */ withClientId(clientId: string): AuthConfigurationBuilder; /** * Sets the credentials for KeyCloak authentication */ withCredentials(credentials: AuthCredentials): AuthConfigurationBuilder; /** * Sets the token for token-based authentication */ withToken(token: Token): AuthConfigurationBuilder; /** * Creates a KeyCloak configuration */ static keyCloak(): AuthConfigurationBuilder; /** * Creates a token-based configuration */ static existingToken(): AuthConfigurationBuilder; /** * Validates the current configuration */ validate(): ValidationResult; /** * Builds the final AuthConfiguration with validation and defaults */ build(): AuthConfiguration; /** * Applies default values based on the auth type */ private applyDefaults; /** * Applies default values to a configuration object */ private applyDefaultsToConfig; }