Skip to content
Snippets Groups Projects
Commit 55890b1f authored by Zdravko Iliev's avatar Zdravko Iliev
Browse files

fix: invitations/accept with shortInvitiationUrl fails with wrong validation

parent 96e4b373
No related branches found
No related tags found
1 merge request!54fix: invitations/accept with shortInvitiationUrl fails with wrong validation
Pipeline #68337 waiting for manual action with stages
in 11 minutes and 38 seconds
# OCM ENGINE - AGENT
# OCM ENGINE - AGENT
Agent service is a wrapper around @ocm-engine/askar library.
......
......@@ -44,9 +44,11 @@ export class RestController {
async acceptInvitation(
@Body() createInvitationDto: CreateInvitationResponseDto,
) {
return this.agentService.acceptInvitation(
createInvitationDto.invitationUrl,
);
const url =
createInvitationDto.invitationUrl ||
createInvitationDto.shortInvitationUrl;
return this.agentService.acceptInvitation(url);
}
@Get("/connections")
......
import { IsString, ValidateIf } from "class-validator";
export class CreateInvitationResponseDto {
/**
* Example of long invitation url
* @example "http://0.0.0.0:8001?oob=eyJAdHlwZSI6Imh0dHBzOi8vZGlkY29tbS5vcmcvb3V0LW9mLWJhbmQvMS4xL2ludml0YXRpb24iLCJAaWQiOiIzYWExNGIzNC04YTk5LTQxY2UtYTY3NC1jODUxYmVhMTIxMWEiLCJsYWJlbCI6IkRFeGNWYXNkX0FHRU5UXzQ1IiwiYWNjZXB0IjpbImRpZGNvbW0vYWlwMSIsImRpZGNvbW0vYWlwMjtlbnY9cmZjMTkiXSwiaGFuZHNoYWtlX3Byb3RvY29scyI6WyJodHRwczovL2RpZGNvbW0ub3JnL2RpZGV4Y2hhbmdlLzEuMCIsImh0dHBzOi8vZGlkY29tbS5vcmcvY29ubmVjdGlvbnMvMS4wIl0sInNlcnZpY2VzIjpbeyJpZCI6IiNpbmxpbmUtMCIsInNlcnZpY2VFbmRwb2ludCI6Imh0dHA6Ly8wLjAuMC4wOjgwMDEiLCJ0eXBlIjoiZGlkLWNvbW11bmljYXRpb24iLCJyZWNpcGllbnRLZXlzIjpbImRpZDprZXk6ejZNa3VFcHllc1pNa3k0a1BpQzhEOEplZERlcm55YTFuaTREMUF3ZmdnWWt6YmR4Il0sInJvdXRpbmdLZXlzIjpbXX1dfQ"
*/
@IsString()
@ValidateIf((o) => o.shortInvitationUrl === undefined)
public invitationUrl: string;
/**
*
* @example "http://0.0.0.0:8001/invitations/85a7c179-122b-4d2d-9a86-d92ad31cef2b"
*/
@IsString()
@ValidateIf((o) => o.invitationUrl === undefined)
public shortInvitationUrl: string;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment