Options
All
  • Public
  • Public/Protected
  • All
Menu

Module app-router

@dvelop-sdk/app-router

npm (scoped) npm bundle size (scoped) GitHub license

This package contains functionality for the App-Router in the d.velop cloud.

Explore the docs »
Install via npm »
Check us out on GitHub »

Index

Functions

  • validateCloudCenterEventSignature(appSecret: string, params: ValidateCloudCenterEventSignatureParams): void
  • Validate a cloud-center-event-signature against your appSecret.

    The cloud-center-event-signature should be validated for every cloud-center-event. Refer to the d.velop cloud center API for more information.

    throws

    InvalidCloudCenterEventSignatureError indicates that a cloud-center-event had an invalid signature.

    validateCloudCenterEventSignature(
    process.env.APP_SECRET,
    "POST",
    "/myapp/dvelop-cloud-lifecycle-event",
    "",
    {
    "x-dv-signature-algorithm": "DV1-HMAC-SHA256",
    "x-dv-signature-headers": "x-dv-signature-algorithm,x-dv-signature-headers,x-dv-signature-timestamp",
    "x-dv-signature-timestamp": "2019-08-09T08:49:42Z"
    }, {
    "type": "subscribe",
    "tenantId": "id",
    "baseUri": "https://someone.d-velop.cloud"
    },
    "02783453441665bf27aa465cbbac9b98507ae94c54b6be2b1882fe9a05ec104c"
    );

    Parameters

    • appSecret: string
    • params: ValidateCloudCenterEventSignatureParams

    Returns void

  • validateDvelopContext(appSecret: string, context: DvelopContext): void
  • Validate a request-signature against your appSecret.

    The requestSignature should be validated for every request when recieving calls from the d.velop cloud. Refer to the d.velop basics tenant header section for more information.

    validateDvelopContext(process.env.APP_SECRET, {
    systemBaseUri: "https://header.example.com",
    tenantId: "a12be5",
    requestId: "Zjcf28p5aQ6amtbs6s9b9cPyBPdziwUslR2DZqaGUTQ="
    );

    @throws <a href="../classes/app_router.InvalidRequestSignatureError.html">InvalidRequestSignatureError</a> indicates that requestSignature was invalid for given appSecret.

    Parameters

    Returns void

  • validateRequestSignature(appSecret: string, systemBaseUri: string, tenantId: string, requestSignature: string): void

Generated using TypeDoc