Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N21-2133 New SHD Authentication #5202

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/server/src/modules/oauth-provider/api/dto/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export { ConsentResponse } from './response/consent.response';
export { RedirectResponse } from './response/redirect.response';
export { OidcContextResponse } from './response/oidc-context.response';
export { ConsentSessionResponse } from './response/consent-session.response';
export { LoginResponse } from './response/login.response';
export { OauthProviderLoginResponse } from './response/oauth-provider-login.response';
export { OAuthRejectableBody } from './request/oauth-rejectable.body';
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { ApiProperty } from '@nestjs/swagger';
import { OauthClientResponse } from './oauth-client.response';
import { OidcContextResponse } from './oidc-context.response';

export class LoginResponse {
constructor(props: LoginResponse) {
export class OauthProviderLoginResponse {
constructor(props: OauthProviderLoginResponse) {
this.client = props.client;
this.client_id = props.client_id;
this.challenge = props.challenge;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ import {
ProviderOauthClient,
ProviderRedirectResponse,
} from '../../domain';
import { ConsentResponse, ConsentSessionResponse, LoginResponse, OauthClientResponse, RedirectResponse } from '../dto';
import {
ConsentResponse,
ConsentSessionResponse,
OauthClientResponse,
OauthProviderLoginResponse,
RedirectResponse,
} from '../dto';

@Injectable()
export class OauthProviderResponseMapper {
Expand Down Expand Up @@ -40,8 +46,8 @@ export class OauthProviderResponseMapper {
return response;
}

public static mapLoginResponse(providerLoginResponse: ProviderLoginResponse): LoginResponse {
const response: LoginResponse = new LoginResponse({
public static mapLoginResponse(providerLoginResponse: ProviderLoginResponse): OauthProviderLoginResponse {
const response: OauthProviderLoginResponse = new OauthProviderLoginResponse({
client_id: providerLoginResponse.client.client_id,
...providerLoginResponse,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import {
IdParams,
ListOauthClientsParams,
LoginRequestBody,
LoginResponse,
OauthClientCreateBody,
OauthClientResponse,
OauthClientUpdateBody,
OauthProviderLoginResponse,
RedirectResponse,
RevokeConsentParams,
} from './dto';
Expand Down Expand Up @@ -113,10 +113,10 @@ export class OauthProviderController {
}

@Get('loginRequest/:challenge')
public async getLoginRequest(@Param() params: ChallengeParams): Promise<LoginResponse> {
public async getLoginRequest(@Param() params: ChallengeParams): Promise<OauthProviderLoginResponse> {
const loginResponse: ProviderLoginResponse = await this.oauthProviderLoginFlowUc.getLoginRequest(params.challenge);

const mapped: LoginResponse = OauthProviderResponseMapper.mapLoginResponse(loginResponse);
const mapped: OauthProviderLoginResponse = OauthProviderResponseMapper.mapLoginResponse(loginResponse);

return mapped;
}
Expand Down
Loading