Skip to content

plugfn v0.3.0

Choose a tag to compare

@thyaravind thyaravind released this 27 Nov 20:18
· 98 commits to dev since this release
0cb1cb1
  • Webhook-triggered workflows bind each verified delivery to the signing authority, tenant, connection, and workflow event. HTTP and SDK ingress verify the original bytes, and GitHub derives the installation and event from the signed body. PlugFn rechecks the binding before dispatch and during execution. Providers configured in workflowBindings require original webhook bytes and enabled signature verification for SDK delivery, including standalone listeners for those providers.
  • Schema version 9 gives workflow deliveries a distinct receipt key and stores their scope. The provider and scoped receipt identity are immutable. From the host app with the upgraded PlugFn dependency and migration config, run npm install --save-dev @superfunctions/cli@0.2.2 typescript and npx superfunctions generate-migration plugfn. The default config is superfunctions.config.js. Pass --config <path> for another JavaScript or JSON config, and compile TypeScript configs to JavaScript first. Apply the generated migration with your adapter's migration runner before deploying upgraded HTTP or SDK ingress and retry workers, even if bindings are disabled. Upgrade every retry worker before enabling bindings. Verify and backfill the workflow row's tenantId and the stored trigger's connectionId, rehydrate workflow triggers, and configure the GitHub App webhook subscriptions and installation resolver. See the core upgrade guide and GitHub App setup.
  • Standalone retries and legacy redelivery deduplication keep their existing behavior. The standalone worker skips scoped attempts, which must be resubmitted through verified ingress. For GitHub Apps, request redelivery manually or through the GitHub API. For SDK resubmission, provide the original verification inputs. An in-flight delivery can invoke its listener twice when bindings are enabled. Use durable, scoped idempotency keys for listener effects. PLUG-8 tracks the retry and deduplication redesign, including historical trigger aliases and replay-context storage.
  • Adds authorized consumer-scoped API-key, JWT, and basic connections. OAuth callbacks can verify the expected owner before exchanging the code, action cache keys bind to the credential and granted scopes, and HTTP requests configured with redirect: 'error' reject redirects.
  • Adds the data-only defineScopeGrammar API for normalizing credential scopes and checking whether a request fits an allowed envelope. See Credential scope envelopes.
  • Uses @superfunctions/oauth-flow@0.1.2 with the same patched @superfunctions/oauth-storage@0.1.2 token vault in registry installs.
  • Upgrade to @plugfn/providers@0.0.4 for the GitHub webhook verification changes and its exact plugfn@0.3.0 dependency. @plugfn/client@0.0.3 pins the same core version. @plugfn/cli@0.0.5 updates its @clifn/core dependency to 0.7.0.
  • Schema version 8 widens plugfn_sync_jobs.claim_token from 64 to 768 characters. The migration command above upgrades databases at version 7; on MySQL it widens the column with one MODIFY COLUMN that keeps existing rows and the unique idx_plugfn_sync_jobs_claim_token index. The version 9 migration skips the widening when the column is already 768 characters and applies any missing version 9 webhook schema changes. MySQL prerequisite: plugfn_sync_jobs must be an InnoDB table with the DYNAMIC row format, the default since MySQL 5.7.9, on MySQL 8.0 or later (or MariaDB 10.3 or later) with the default 16 KiB (or larger) innodb_page_size, because the full 768-character unique key needs 3,072 bytes: COMPACT and REDUNDANT limit an index key part to 767 bytes, a COMPRESSED table's KEY_BLOCK_SIZE limits its index records, older servers may run with innodb_large_prefix off, and smaller pages lower the key limit. The CLI refuses the migration before any DDL when the key would not fit or when it cannot determine the table's key limit: on a COMPACT, REDUNDANT or COMPRESSED table (or another engine), run ALTER TABLE plugfn_sync_jobs ENGINE=InnoDB ROW_FORMAT=DYNAMIC first; on an older server, upgrade it first; with 8 KiB (1,536-byte key limit) or 4 KiB (768-byte) pages no row format fits the utf8mb4 key, and innodb_page_size cannot change on an existing instance.