Member Junction
    Preparing search index...

    Class BaseSignatureProviderAbstract

    Abstract base for all eSignature providers. Concrete drivers (DocuSign, Adobe Sign, …) live in their own packages and register via @RegisterClass(BaseSignatureProvider, '<DriverKey>'), where <DriverKey> matches MJ: Signature Providers.ServerDriverKey. The engine resolves a driver with MJGlobal.Instance.ClassFactory.CreateInstance(BaseSignatureProvider, driverKey) — never new.

    Design contract:

    • Core operations are abstract — every driver must implement them.
    • Optional operations are non-abstract with a "not supported" default, advertised via getSupportedOperations. This mirrors the Communication provider idiom.
    • The provider is stateless w.r.t. credentials: the engine resolves and decrypts credentials, then hands them to initialize. Token refreshes are persisted via the engine-supplied onTokenRefresh callback on SignatureProviderConfig.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    providerKey: string

    Driver key for this provider. MUST equal the @RegisterClass key and MJ: Signature Providers.ServerDriverKey.

    Accessors

    Methods

    • Normalize a provider webhook payload onto our vocabulary. This is the parse step only — it needs no secret, so the engine can call it on a bare driver to discover which envelope an event refers to. Returns null for payloads this driver doesn't handle. Default: not handled.

      Authenticity is checked separately by VerifyWebhookSignature, which runs on a credential-initialized driver.

      Parameters

      • _payload: unknown
      • _headers: Record<string, string>

      Returns NormalizedSignatureEvent

    • Verify the authenticity of an inbound webhook (HMAC / signature). The eSignature webhook endpoint is unauthenticated and mutates signature-request status, so the engine consults this before applying any event under a verify-if-configured policy:

      • Verified → a secret is configured and the signature matched → engine accepts.
      • Failed → a secret is configured but the signature was missing/invalid → reject.
      • NotConfigured → no secret configured → engine accepts (logged), so the endpoint works during setup and tightens to strict automatically once a key is set.

      Default is NotConfigured: a driver that doesn't implement verification has no secret to check. Implementations read their shared secret from this.config (e.g. SignatureProviderConfig.connectHmacKey) — sourced from the account's encrypted credential, never an environment variable.

      Providers verify in whichever way their API prescribes:

      • over the EXACT raw bytes (DocuSign Connect HMAC) — use rawBody;
      • over fields inside the parsed payload (Dropbox Sign event_hash) — use payload.

      Parameters

      • _rawBody: Buffer

        The exact bytes received, for byte-accurate HMAC. Undefined if unavailable.

      • _headers: Record<string, string>

        Inbound headers (may carry the provider signature header).

      • Optional_payload: unknown

        The parsed payload, for providers that sign payload fields rather than bytes.

      Returns WebhookVerificationResult