Skip to content

Commit ed9fdfb

Browse files
test(support): add deleteUserPfx helper to remove user certificate
Add deleteUserPfx() to playwright/support/nc-provisioning.ts to send DELETE /ocs/v2.php/apps/libresign/api/v1/account/pfx authenticated as the target user. This ensures tests that require the certificate creation flow always start from a clean state. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 39e2dfe commit ed9fdfb

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

playwright/support/nc-provisioning.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,19 @@ type OpenSslCertNames = {
143143
L?: string
144144
}
145145

146+
/**
147+
* Deletes the PFX certificate of a user so the next signing attempt
148+
* starts without an existing certificate.
149+
* Equivalent to: DELETE /ocs/v2.php/apps/libresign/api/v1/account/pfx
150+
*/
151+
export async function deleteUserPfx(
152+
request: APIRequestContext,
153+
userId: string,
154+
password: string,
155+
): Promise<void> {
156+
await ocsRequest(request, 'DELETE', '/apps/libresign/api/v1/account/pfx', userId, password)
157+
}
158+
146159
/**
147160
* Configures the OpenSSL certificate engine.
148161
* Equivalent to: `occ libresign:configure:openssl --cn=... --c=... ...`

0 commit comments

Comments
 (0)