Skip to content

Commit

Permalink
feat: validate backboneUrl on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Magnus-Kuhn committed Sep 24, 2024
1 parent 68a322d commit 32c5326
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/transport/src/core/Transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ export class Transport {
throw TransportCoreErrors.general.baseUrlNotSet().logWith(log);
}

if (this._config.baseUrl.includes("|")) {
throw TransportCoreErrors.general.invalidBaseUrl().logWith(log);
}

if (this._config.supportedDatawalletVersion < 1) {
throw new TransportError("The given supported datawallet version is invalid. The value must be 1 or higher.");
}
Expand Down
4 changes: 4 additions & 0 deletions packages/transport/src/core/TransportCoreErrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ class General {
return new CoreError("error.transport.general.baseUrlNotSet", "The baseUrl was not set.");
}

public invalidBaseUrl() {
return new CoreError("error.transport.general.invalidBaseUrl", "The baseUrl is invalid since it contains a vertical bar |.");
}

public platformClientSecretNotSet() {
return new CoreError("error.transport.general.platformClientSecretNotSet", "The platform clientSecret was not set.");
}
Expand Down

0 comments on commit 32c5326

Please sign in to comment.