Skip to content
Open
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
6 changes: 3 additions & 3 deletions quality/cypress/plugins/log-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ interface hasBusinessLogArgs {

export const hasBusinessLog = async (
args: hasBusinessLogArgs,
): Promise<number> => {
): Promise<string> => {
const { event, containerName } = args;
const stringifiedEvent = JSON.stringify(event);
const command = `${dockerLogsCommand(containerName)} | tsx ${EXEC_TOOL_PATH} /dev/stdin '${stringifiedEvent}'`;

let exitCode = 0;
let exitCode: string | undefined = "UNKNOWN";
try {
await asyncExec(command);
} catch (err) {
exitCode = err.code;
exitCode = (err as NodeJS.ErrnoException).code ?? "UNKNOWN";
}
return exitCode;
};
Expand Down
80 changes: 40 additions & 40 deletions quality/cypress/support/api/dto/get-discovery.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,156 +3,156 @@ import { IsArray, IsBoolean, IsString, MinLength } from "class-validator";
export class GetDiscoveryDto {
@IsString({ each: true })
@IsArray()
readonly acr_values_supported: string[];
readonly acr_values_supported!: string[];

@IsString()
@MinLength(1)
readonly authorization_endpoint: string;
readonly authorization_endpoint!: string;

@IsBoolean()
readonly claims_parameter_supported: boolean;
readonly claims_parameter_supported!: boolean;

@IsString({ each: true })
@IsArray()
readonly claims_supported: string[];
readonly claims_supported!: string[];

@IsString({ each: true })
@IsArray()
readonly code_challenge_methods_supported: string[];
readonly code_challenge_methods_supported!: string[];

@IsString()
@MinLength(1)
readonly end_session_endpoint: string;
readonly end_session_endpoint!: string;

@IsString({ each: true })
@IsArray()
readonly grant_types_supported: string[];
readonly grant_types_supported!: string[];

@IsString({ each: true })
@IsArray()
readonly id_token_signing_alg_values_supported: string[];
readonly id_token_signing_alg_values_supported!: string[];

@IsString()
@MinLength(1)
readonly introspection_endpoint: string;
readonly introspection_endpoint!: string;

@IsString({ each: true })
@IsArray()
readonly introspection_endpoint_auth_methods_supported: string[];
readonly introspection_endpoint_auth_methods_supported!: string[];

@IsString({ each: true })
@IsArray()
readonly introspection_endpoint_auth_signing_alg_values_supported: string[];
readonly introspection_endpoint_auth_signing_alg_values_supported!: string[];

@IsString({ each: true })
@IsArray()
readonly introspection_signing_alg_values_supported: string[];
readonly introspection_signing_alg_values_supported!: string[];

@IsString({ each: true })
@IsArray()
readonly introspection_encryption_alg_values_supported: string[];
readonly introspection_encryption_alg_values_supported!: string[];

@IsString({ each: true })
@IsArray()
readonly introspection_encryption_enc_values_supported: string[];
readonly introspection_encryption_enc_values_supported!: string[];

@IsString()
@MinLength(1)
readonly issuer: string;
readonly issuer!: string;

@IsString()
@MinLength(1)
readonly jwks_uri: string;
readonly jwks_uri!: string;

@IsBoolean()
readonly authorization_response_iss_parameter_supported: boolean;
readonly authorization_response_iss_parameter_supported!: boolean;

@IsString({ each: true })
@IsArray()
readonly response_modes_supported: string[];
readonly response_modes_supported!: string[];

@IsString({ each: true })
@IsArray()
readonly response_types_supported: string[];
readonly response_types_supported!: string[];

@IsString({ each: true })
@IsArray()
readonly scopes_supported: string[];
readonly scopes_supported!: string[];

@IsString({ each: true })
@IsArray()
readonly subject_types_supported: string[];
readonly subject_types_supported!: string[];

@IsString({ each: true })
@IsArray()
readonly token_endpoint_auth_methods_supported: string[];
readonly token_endpoint_auth_methods_supported!: string[];

@IsString({ each: true })
@IsArray()
readonly token_endpoint_auth_signing_alg_values_supported: string[];
readonly token_endpoint_auth_signing_alg_values_supported!: string[];

@IsString()
@MinLength(1)
readonly token_endpoint: string;
readonly token_endpoint!: string;

@IsString({ each: true })
@IsArray()
readonly request_object_signing_alg_values_supported: string[];
readonly request_object_signing_alg_values_supported!: string[];

@IsBoolean()
readonly request_parameter_supported: boolean;
readonly request_parameter_supported!: boolean;

@IsBoolean()
readonly request_uri_parameter_supported: boolean;
readonly request_uri_parameter_supported!: boolean;

@IsBoolean()
readonly require_request_uri_registration: boolean;
readonly require_request_uri_registration!: boolean;

@IsString()
@MinLength(1)
readonly userinfo_endpoint: string;
readonly userinfo_endpoint!: string;

@IsString({ each: true })
@IsArray()
readonly userinfo_signing_alg_values_supported: string[];
readonly userinfo_signing_alg_values_supported!: string[];

@IsString()
@MinLength(1)
readonly revocation_endpoint: string;
readonly revocation_endpoint!: string;

@IsString({ each: true })
@IsArray()
readonly revocation_endpoint_auth_methods_supported: string[];
readonly revocation_endpoint_auth_methods_supported!: string[];

@IsString({ each: true })
@IsArray()
readonly revocation_endpoint_auth_signing_alg_values_supported: string[];
readonly revocation_endpoint_auth_signing_alg_values_supported!: string[];

@IsString({ each: true })
@IsArray()
readonly claim_types_supported: string[];
readonly claim_types_supported!: string[];

@IsString({ each: true })
@IsArray()
readonly id_token_encryption_alg_values_supported: string[];
readonly id_token_encryption_alg_values_supported!: string[];

@IsString({ each: true })
@IsArray()
readonly id_token_encryption_enc_values_supported: string[];
readonly id_token_encryption_enc_values_supported!: string[];

@IsString({ each: true })
@IsArray()
readonly userinfo_encryption_alg_values_supported: string[];
readonly userinfo_encryption_alg_values_supported!: string[];

@IsString({ each: true })
@IsArray()
readonly userinfo_encryption_enc_values_supported: string[];
readonly userinfo_encryption_enc_values_supported!: string[];

@IsString({ each: true })
@IsArray()
readonly request_object_encryption_alg_values_supported: string[];
readonly request_object_encryption_alg_values_supported!: string[];

@IsString({ each: true })
@IsArray()
readonly request_object_encryption_enc_values_supported: string[];
readonly request_object_encryption_enc_values_supported!: string[];
}
22 changes: 11 additions & 11 deletions quality/cypress/support/api/dto/post-token-introspection.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,52 +11,52 @@ import {

export class ValidTokenIntrospection {
@IsBoolean()
readonly active: boolean;
readonly active!: boolean;

@IsString()
@MinLength(1)
readonly sub: string;
readonly sub!: string;

@IsString()
@MinLength(1)
readonly client_id: string;
readonly client_id!: string;

@IsNumber()
@IsPositive()
readonly exp: number;
readonly exp!: number;

@IsNumber()
@IsPositive()
readonly iat: number;
readonly iat!: number;

@IsString()
@MinLength(1)
readonly iss: string;
readonly iss!: string;

@IsString()
@MinLength(1)
readonly scope: string;
readonly scope!: string;

@IsString()
@MinLength(1)
readonly token_type: string;
readonly token_type!: string;
}

class ExpiredTokenIntrospection {
@IsBoolean()
readonly active: boolean;
readonly active!: boolean;
}

export class GetTokenIntrospectionValidTokenDto {
@IsObject()
@ValidateNested()
@Type(() => ValidTokenIntrospection)
readonly token_introspection: ValidTokenIntrospection;
readonly token_introspection!: ValidTokenIntrospection;
}

export class GetTokenIntrospectionExpiredTokenDto {
@IsObject()
@ValidateNested()
@Type(() => ExpiredTokenIntrospection)
readonly token_introspection: ExpiredTokenIntrospection;
readonly token_introspection!: ExpiredTokenIntrospection;
}
16 changes: 9 additions & 7 deletions quality/cypress/support/api/steps/api-jwt-steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Then(
/^(?:le |l')(entête du JWE|entête du JWS|payload du JWT) a (\d+) propriétés?$/,
function (jwtPart: string, count: number) {
cy.get("@jwt")
.its(jwtPartsMap[jwtPart])
.its(jwtPartsMap[jwtPart as keyof typeof jwtPartsMap])
.then((part) => Object.keys(part))
.should("have.length", count);
},
Expand All @@ -23,15 +23,17 @@ Then(
Then(
/^(?:le |l')(entête du JWE|entête du JWS|payload du JWT) a une propriété "([^"]+)"$/,
function (jwtPart: string, property: string) {
cy.get("@jwt").its(jwtPartsMap[jwtPart]).should("have.property", property);
cy.get("@jwt")
.its(jwtPartsMap[jwtPart as keyof typeof jwtPartsMap])
.should("have.property", property);
},
);

Then(
/^(?:le |l')(entête du JWE|entête du JWS|payload du JWT) n'a pas de propriété "([^"]+)"$/,
function (jwtPart: string, property: string) {
cy.get("@jwt")
.its(jwtPartsMap[jwtPart])
.its(jwtPartsMap[jwtPart as keyof typeof jwtPartsMap])
.should("not.have.property", property);
},
);
Expand All @@ -40,7 +42,7 @@ Then(
/^(?:le |l')(entête du JWE|entête du JWS|payload du JWT) a une propriété "([^"]+)" égale à "([^"]+)"$/,
function (jwtPart: string, property: string, value: string) {
cy.get("@jwt")
.its(jwtPartsMap[jwtPart])
.its(jwtPartsMap[jwtPart as keyof typeof jwtPartsMap])
.its(property)
.should("equal", value);
},
Expand All @@ -50,7 +52,7 @@ Then(
/^(?:le |l')(entête du JWE|entête du JWS|payload du JWT) a une propriété "([^"]+)" égale à (\d+)$/,
function (jwtPart: string, property: string, value: number) {
cy.get("@jwt")
.its(jwtPartsMap[jwtPart])
.its(jwtPartsMap[jwtPart as keyof typeof jwtPartsMap])
.its(property)
.should("equal", value);
},
Expand All @@ -61,7 +63,7 @@ Then(
function (jwtPart: string, property: string, value: string) {
const booleanValue = value === "true";
cy.get("@jwt")
.its(jwtPartsMap[jwtPart])
.its(jwtPartsMap[jwtPart as keyof typeof jwtPartsMap])
.its(property)
.should("equal", booleanValue);
},
Expand All @@ -71,7 +73,7 @@ Then(
/^(?:le |l')(entête du JWE|entête du JWS|payload du JWT) a une propriété "([^"]+)" contenant "([^"]+)"$/,
function (jwtPart: string, property: string, value: string) {
cy.get("@jwt")
.its(jwtPartsMap[jwtPart])
.its(jwtPartsMap[jwtPart as keyof typeof jwtPartsMap])
.its(property)
.should("include", value);
},
Expand Down
16 changes: 8 additions & 8 deletions quality/cypress/support/api/steps/api-request-steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@ Given("je prépare une requête {string}", function (requestKey: string) {
Given(
"je retire le paramètre {string} de la requête",
function (property: string) {
expect(this.apiRequest.qs[property]).to.exist;
delete this.apiRequest.qs[property];
expect((this.apiRequest!.qs as Record<string, unknown>)[property]).to.exist;
delete (this.apiRequest!.qs as Record<string, unknown>)[property];
},
);

Given(
"je mets {string} dans le paramètre {string} de la requête",
function (value: string, property: string) {
this.apiRequest.qs[property] = value;
(this.apiRequest!.qs as Record<string, unknown>)[property] = value;
},
);

Given("je retire {string} du corps de la requête", function (property: string) {
expect(this.apiRequest.body[property]).to.exist;
delete this.apiRequest.body[property];
expect((this.apiRequest!.body as Record<string, unknown>)[property]).to.exist;
delete (this.apiRequest!.body as Record<string, unknown>)[property];
});

Given(
"je mets {string} dans la propriété {string} du corps de la requête",
function (value: string, property: string) {
this.apiRequest.body[property] = value;
(this.apiRequest!.body as Record<string, unknown>)[property] = value;
},
);

Expand All @@ -47,15 +47,15 @@ Given(
cy.get(`@api:${dataKey}`)
.should("exist")
.then((value) => {
this.apiRequest.body[property] = value;
(this.apiRequest!.body as Record<string, unknown>)[property] = value;
});
},
);

Given(
"je configure la requête pour ne pas suivre les redirections",
function () {
this.apiRequest.followRedirect = false;
this.apiRequest!.followRedirect = false;
},
);

Expand Down
Loading
Loading