runline 0.35.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/errors.d.ts +3 -3
- package/dist/auth/errors.js +3 -3
- package/dist/credentials/aws-plugin.d.ts +82 -0
- package/dist/credentials/aws-plugin.js +184 -0
- package/dist/credentials/aws.d.ts +52 -0
- package/dist/credentials/aws.js +312 -0
- package/dist/credentials/broker.d.ts +11 -0
- package/dist/{plugins/_shared/credentialAdapter.js → credentials/broker.js} +96 -45
- package/dist/credentials/plugin.d.ts +255 -0
- package/dist/{plugins/_shared/credentials.js → credentials/plugin.js} +11 -10
- package/dist/credentials/policy.d.ts +11 -3
- package/dist/credentials/policy.js +22 -3
- package/dist/credentials/registry.d.ts +14 -0
- package/dist/credentials/registry.js +55 -2
- package/dist/credentials/sigv4.d.ts +47 -0
- package/dist/credentials/sigv4.js +145 -0
- package/dist/credentials/transport.d.ts +9 -0
- package/dist/credentials/transport.js +111 -27
- package/dist/credentials/types.d.ts +70 -4
- package/dist/index.d.ts +8 -2
- package/dist/index.js +5 -1
- package/dist/plugins/_shared/googleAuth.js +3 -5
- package/dist/plugins/_shared/googleCredentials.js +1 -2
- package/dist/plugins/_shared/mediaFile.js +4 -1
- package/dist/plugins/_shared/microsoftAuth.js +3 -5
- package/dist/plugins/_shared/microsoftCredentials.js +1 -2
- package/dist/plugins/_shared/shiftCloud.js +1 -2
- package/dist/plugins/_shared/shiftCredentials.js +1 -2
- package/dist/plugins/actionNetwork/src/credentials.js +1 -1
- package/dist/plugins/actionNetwork/src/index.js +1 -1
- package/dist/plugins/activeCampaign/src/credentials.js +1 -1
- package/dist/plugins/activeCampaign/src/index.js +1 -1
- package/dist/plugins/adalo/src/credentials.js +1 -1
- package/dist/plugins/adalo/src/index.js +1 -1
- package/dist/plugins/affinity/src/credentials.js +1 -1
- package/dist/plugins/affinity/src/index.js +1 -1
- package/dist/plugins/agentMail/src/credentials.js +1 -1
- package/dist/plugins/agentMail/src/shared.js +1 -2
- package/dist/plugins/agileCrm/src/credentials.js +1 -1
- package/dist/plugins/agileCrm/src/index.js +1 -1
- package/dist/plugins/airtable/src/credentials.js +1 -1
- package/dist/plugins/airtable/src/index.js +1 -1
- package/dist/plugins/airtop/src/credentials.js +1 -1
- package/dist/plugins/airtop/src/index.js +1 -1
- package/dist/plugins/apiTemplateIo/src/credentials.js +1 -1
- package/dist/plugins/apiTemplateIo/src/index.js +1 -1
- package/dist/plugins/asana/src/credentials.js +1 -1
- package/dist/plugins/asana/src/index.js +1 -1
- package/dist/plugins/autopilot/src/credentials.js +1 -1
- package/dist/plugins/autopilot/src/index.js +1 -1
- package/dist/plugins/bambooHr/src/credentials.js +1 -1
- package/dist/plugins/bambooHr/src/index.js +1 -1
- package/dist/plugins/bannerbear/src/credentials.js +1 -1
- package/dist/plugins/bannerbear/src/index.js +1 -1
- package/dist/plugins/baserow/src/credentials.js +1 -1
- package/dist/plugins/baserow/src/index.js +1 -1
- package/dist/plugins/beeminder/src/credentials.js +1 -1
- package/dist/plugins/beeminder/src/index.js +1 -1
- package/dist/plugins/bitly/src/credentials.js +1 -1
- package/dist/plugins/bitly/src/index.js +1 -1
- package/dist/plugins/bitwarden/src/credentials.js +1 -1
- package/dist/plugins/bitwarden/src/index.js +1 -1
- package/dist/plugins/box/src/credentials.js +1 -1
- package/dist/plugins/box/src/index.js +1 -1
- package/dist/plugins/brandfetch/src/credentials.js +1 -1
- package/dist/plugins/brandfetch/src/index.js +1 -1
- package/dist/plugins/brevo/src/credentials.js +1 -1
- package/dist/plugins/brevo/src/index.js +1 -1
- package/dist/plugins/bubble/src/credentials.js +1 -1
- package/dist/plugins/bubble/src/index.js +1 -1
- package/dist/plugins/chargebee/src/credentials.js +1 -1
- package/dist/plugins/chargebee/src/index.js +1 -1
- package/dist/plugins/circleci/src/credentials.js +1 -1
- package/dist/plugins/circleci/src/index.js +1 -1
- package/dist/plugins/ciscoWebex/src/credentials.js +1 -1
- package/dist/plugins/ciscoWebex/src/index.js +1 -1
- package/dist/plugins/clearbit/src/credentials.js +1 -1
- package/dist/plugins/clearbit/src/index.js +1 -1
- package/dist/plugins/clickup/src/credentials.js +1 -1
- package/dist/plugins/clickup/src/index.js +1 -1
- package/dist/plugins/clockify/src/credentials.js +1 -1
- package/dist/plugins/clockify/src/index.js +1 -1
- package/dist/plugins/cloudflare/src/credentials.js +1 -1
- package/dist/plugins/cloudflare/src/index.js +1 -1
- package/dist/plugins/cockpit/src/credentials.js +1 -1
- package/dist/plugins/cockpit/src/index.js +1 -1
- package/dist/plugins/coda/src/credentials.js +1 -1
- package/dist/plugins/coda/src/index.js +1 -1
- package/dist/plugins/coingecko/src/credentials.js +1 -1
- package/dist/plugins/coingecko/src/index.js +1 -1
- package/dist/plugins/contentful/src/credentials.js +1 -1
- package/dist/plugins/contentful/src/index.js +1 -1
- package/dist/plugins/convertkit/src/credentials.js +1 -1
- package/dist/plugins/convertkit/src/index.js +1 -1
- package/dist/plugins/copper/src/credentials.js +1 -1
- package/dist/plugins/copper/src/index.js +1 -1
- package/dist/plugins/cortex/src/credentials.js +1 -1
- package/dist/plugins/cortex/src/index.js +1 -1
- package/dist/plugins/currents/src/credentials.js +1 -1
- package/dist/plugins/currents/src/index.js +1 -1
- package/dist/plugins/customerIo/src/credentials.js +1 -1
- package/dist/plugins/customerIo/src/index.js +1 -1
- package/dist/plugins/databricks/src/credentials.js +1 -1
- package/dist/plugins/databricks/src/index.js +1 -1
- package/dist/plugins/deepl/src/credentials.js +1 -1
- package/dist/plugins/deepl/src/index.js +1 -1
- package/dist/plugins/demio/src/credentials.js +1 -1
- package/dist/plugins/demio/src/index.js +1 -1
- package/dist/plugins/dhl/src/credentials.js +1 -1
- package/dist/plugins/dhl/src/index.js +1 -1
- package/dist/plugins/discord/src/credentials.js +1 -1
- package/dist/plugins/discord/src/index.js +1 -1
- package/dist/plugins/discourse/src/credentials.js +1 -1
- package/dist/plugins/discourse/src/index.js +1 -1
- package/dist/plugins/disqus/src/credentials.js +1 -1
- package/dist/plugins/disqus/src/index.js +1 -1
- package/dist/plugins/drift/src/credentials.js +1 -1
- package/dist/plugins/drift/src/index.js +1 -1
- package/dist/plugins/dropbox/src/credentials.js +1 -1
- package/dist/plugins/dropbox/src/index.js +1 -1
- package/dist/plugins/dropcontact/src/credentials.js +1 -1
- package/dist/plugins/dropcontact/src/index.js +1 -1
- package/dist/plugins/egoi/src/credentials.js +1 -1
- package/dist/plugins/egoi/src/index.js +1 -1
- package/dist/plugins/elasticsearch/src/credentials.js +1 -1
- package/dist/plugins/elasticsearch/src/index.js +1 -1
- package/dist/plugins/elevenlabs/src/credentials.js +1 -1
- package/dist/plugins/elevenlabs/src/shared.js +2 -4
- package/dist/plugins/elevenlabs/src/workflows.js +1 -1
- package/dist/plugins/emelia/src/credentials.js +1 -1
- package/dist/plugins/emelia/src/index.js +1 -1
- package/dist/plugins/erpnext/src/credentials.js +1 -1
- package/dist/plugins/erpnext/src/index.js +1 -1
- package/dist/plugins/facebookGraph/src/credentials.js +1 -1
- package/dist/plugins/facebookGraph/src/index.js +1 -2
- package/dist/plugins/fal/src/credentials.js +1 -1
- package/dist/plugins/fal/src/shared.js +1 -1
- package/dist/plugins/freshdesk/src/credentials.js +1 -1
- package/dist/plugins/freshdesk/src/index.js +1 -1
- package/dist/plugins/freshservice/src/credentials.js +1 -1
- package/dist/plugins/freshservice/src/index.js +1 -1
- package/dist/plugins/freshworksCrm/src/credentials.js +1 -1
- package/dist/plugins/freshworksCrm/src/index.js +1 -1
- package/dist/plugins/getresponse/src/credentials.js +1 -1
- package/dist/plugins/getresponse/src/index.js +1 -1
- package/dist/plugins/gett/src/credentials.js +1 -2
- package/dist/plugins/gett/src/index.js +1 -1
- package/dist/plugins/gett/src/login.js +1 -1
- package/dist/plugins/gett/src/session.js +1 -1
- package/dist/plugins/gett/src/shared.js +1 -2
- package/dist/plugins/ghost/src/credentials.js +1 -1
- package/dist/plugins/ghost/src/index.js +1 -1
- package/dist/plugins/github/src/credentials.js +1 -1
- package/dist/plugins/github/src/index.js +1 -1
- package/dist/plugins/gitlab/src/credentials.js +1 -1
- package/dist/plugins/gitlab/src/index.js +1 -1
- package/dist/plugins/gmail/src/index.js +1 -1
- package/dist/plugins/gong/src/credentials.js +1 -1
- package/dist/plugins/gong/src/index.js +1 -1
- package/dist/plugins/googleAppsScript/src/index.js +12 -1
- package/dist/plugins/googleCalendar/src/index.js +1 -1
- package/dist/plugins/googleContacts/src/index.js +1 -1
- package/dist/plugins/googleDocs/src/shared.js +1 -1
- package/dist/plugins/googleDrive/src/index.js +1 -1
- package/dist/plugins/googleImage/src/credentials.js +1 -1
- package/dist/plugins/googleImage/src/index.js +1 -1
- package/dist/plugins/googleSheets/src/index.js +1 -1
- package/dist/plugins/googleSlides/src/index.js +1 -1
- package/dist/plugins/googleTasks/src/index.js +1 -1
- package/dist/plugins/gotify/src/credentials.js +1 -1
- package/dist/plugins/gotify/src/index.js +1 -1
- package/dist/plugins/gotowebinar/src/credentials.js +1 -1
- package/dist/plugins/gotowebinar/src/index.js +1 -1
- package/dist/plugins/grafana/src/credentials.js +1 -1
- package/dist/plugins/grafana/src/index.js +1 -1
- package/dist/plugins/graphql/src/credentials.js +1 -1
- package/dist/plugins/graphql/src/index.js +1 -1
- package/dist/plugins/grist/src/credentials.js +1 -1
- package/dist/plugins/grist/src/index.js +1 -1
- package/dist/plugins/halopsa/src/credentials.js +1 -2
- package/dist/plugins/halopsa/src/index.js +1 -1
- package/dist/plugins/harvest/src/credentials.js +1 -1
- package/dist/plugins/harvest/src/index.js +1 -1
- package/dist/plugins/helpscout/src/credentials.js +1 -1
- package/dist/plugins/helpscout/src/index.js +1 -1
- package/dist/plugins/highlevel/src/credentials.js +1 -1
- package/dist/plugins/highlevel/src/index.js +1 -1
- package/dist/plugins/homeAssistant/src/credentials.js +1 -1
- package/dist/plugins/homeAssistant/src/index.js +1 -1
- package/dist/plugins/hubspot/src/credentials.js +1 -1
- package/dist/plugins/hubspot/src/index.js +1 -1
- package/dist/plugins/humanticAi/src/credentials.js +1 -1
- package/dist/plugins/humanticAi/src/index.js +1 -1
- package/dist/plugins/hunter/src/credentials.js +1 -1
- package/dist/plugins/hunter/src/index.js +1 -1
- package/dist/plugins/intercom/src/credentials.js +1 -1
- package/dist/plugins/intercom/src/index.js +1 -1
- package/dist/plugins/iterable/src/credentials.js +1 -1
- package/dist/plugins/iterable/src/index.js +1 -1
- package/dist/plugins/jenkins/src/credentials.js +1 -1
- package/dist/plugins/jenkins/src/index.js +1 -1
- package/dist/plugins/jira/src/credentials.js +1 -1
- package/dist/plugins/jira/src/index.js +1 -1
- package/dist/plugins/keap/src/credentials.js +1 -1
- package/dist/plugins/keap/src/index.js +1 -1
- package/dist/plugins/kobotoolbox/src/credentials.js +1 -1
- package/dist/plugins/kobotoolbox/src/index.js +1 -1
- package/dist/plugins/lemlist/src/credentials.js +1 -1
- package/dist/plugins/lemlist/src/index.js +1 -1
- package/dist/plugins/linear/src/credentials.js +1 -1
- package/dist/plugins/linear/src/shared.js +1 -1
- package/dist/plugins/lingvanex/src/credentials.js +1 -1
- package/dist/plugins/lingvanex/src/index.js +1 -1
- package/dist/plugins/linkedin/src/credentials.js +1 -1
- package/dist/plugins/linkedin/src/index.js +1 -1
- package/dist/plugins/lonescale/src/credentials.js +1 -1
- package/dist/plugins/lonescale/src/index.js +1 -1
- package/dist/plugins/magento/src/credentials.js +1 -1
- package/dist/plugins/magento/src/index.js +1 -1
- package/dist/plugins/mailcheck/src/credentials.js +1 -1
- package/dist/plugins/mailcheck/src/index.js +1 -1
- package/dist/plugins/mailchimp/src/credentials.js +1 -1
- package/dist/plugins/mailchimp/src/index.js +1 -1
- package/dist/plugins/mailerlite/src/credentials.js +1 -1
- package/dist/plugins/mailerlite/src/index.js +1 -1
- package/dist/plugins/mailgun/src/credentials.js +1 -1
- package/dist/plugins/mailgun/src/index.js +1 -1
- package/dist/plugins/mailjet/src/credentials.js +1 -1
- package/dist/plugins/mailjet/src/index.js +1 -1
- package/dist/plugins/mandrill/src/credentials.js +1 -1
- package/dist/plugins/mandrill/src/index.js +1 -1
- package/dist/plugins/marketstack/src/credentials.js +1 -1
- package/dist/plugins/marketstack/src/index.js +1 -1
- package/dist/plugins/matrix/src/credentials.js +1 -1
- package/dist/plugins/matrix/src/index.js +1 -1
- package/dist/plugins/mattermost/src/credentials.js +1 -1
- package/dist/plugins/mattermost/src/index.js +1 -1
- package/dist/plugins/mautic/src/credentials.js +1 -1
- package/dist/plugins/mautic/src/index.js +1 -1
- package/dist/plugins/medium/src/credentials.js +1 -1
- package/dist/plugins/medium/src/index.js +1 -1
- package/dist/plugins/messagebird/src/credentials.js +1 -1
- package/dist/plugins/messagebird/src/index.js +1 -1
- package/dist/plugins/metabase/src/credentials.js +1 -1
- package/dist/plugins/metabase/src/index.js +1 -1
- package/dist/plugins/microsoftFiles/src/index.js +10 -1
- package/dist/plugins/misp/src/credentials.js +1 -1
- package/dist/plugins/misp/src/index.js +1 -1
- package/dist/plugins/mocean/src/credentials.js +1 -1
- package/dist/plugins/mocean/src/index.js +1 -1
- package/dist/plugins/monday/src/credentials.js +1 -1
- package/dist/plugins/monday/src/index.js +1 -1
- package/dist/plugins/monicaCrm/src/credentials.js +1 -1
- package/dist/plugins/monicaCrm/src/index.js +1 -1
- package/dist/plugins/msg91/src/credentials.js +1 -1
- package/dist/plugins/msg91/src/index.js +1 -1
- package/dist/plugins/nasa/src/credentials.js +1 -1
- package/dist/plugins/nasa/src/index.js +1 -1
- package/dist/plugins/netlify/src/credentials.js +1 -1
- package/dist/plugins/netlify/src/index.js +1 -1
- package/dist/plugins/netscalerAdc/src/credentials.js +1 -1
- package/dist/plugins/netscalerAdc/src/index.js +1 -1
- package/dist/plugins/nextcloud/src/credentials.js +1 -2
- package/dist/plugins/nextcloud/src/index.js +1 -1
- package/dist/plugins/nocodb/src/credentials.js +1 -1
- package/dist/plugins/nocodb/src/index.js +1 -1
- package/dist/plugins/notion/src/credentials.js +1 -1
- package/dist/plugins/notion/src/index.js +1 -1
- package/dist/plugins/npm/src/credentials.js +1 -1
- package/dist/plugins/npm/src/index.js +1 -1
- package/dist/plugins/odoo/src/credentials.js +1 -1
- package/dist/plugins/odoo/src/index.js +1 -2
- package/dist/plugins/okta/src/credentials.js +1 -1
- package/dist/plugins/okta/src/index.js +1 -2
- package/dist/plugins/oneSimpleApi/src/credentials.js +1 -1
- package/dist/plugins/oneSimpleApi/src/index.js +1 -1
- package/dist/plugins/onfleet/src/credentials.js +1 -1
- package/dist/plugins/onfleet/src/index.js +1 -1
- package/dist/plugins/openai/src/credentials.js +1 -1
- package/dist/plugins/openai/src/index.js +1 -1
- package/dist/plugins/openweathermap/src/credentials.js +1 -1
- package/dist/plugins/openweathermap/src/index.js +1 -1
- package/dist/plugins/oura/src/credentials.js +1 -1
- package/dist/plugins/oura/src/index.js +1 -1
- package/dist/plugins/paddle/src/credentials.js +1 -1
- package/dist/plugins/paddle/src/index.js +1 -1
- package/dist/plugins/pagerduty/src/credentials.js +1 -1
- package/dist/plugins/pagerduty/src/index.js +1 -1
- package/dist/plugins/parallel/src/credentials.js +1 -1
- package/dist/plugins/parallel/src/index.js +15 -1
- package/dist/plugins/paypal/src/credentials.js +1 -1
- package/dist/plugins/paypal/src/index.js +1 -1
- package/dist/plugins/peekalink/src/credentials.js +1 -1
- package/dist/plugins/peekalink/src/index.js +1 -1
- package/dist/plugins/phantombuster/src/credentials.js +1 -1
- package/dist/plugins/phantombuster/src/index.js +1 -1
- package/dist/plugins/philipsHue/src/credentials.js +1 -1
- package/dist/plugins/philipsHue/src/index.js +1 -1
- package/dist/plugins/pipedrive/src/credentials.js +1 -1
- package/dist/plugins/pipedrive/src/index.js +1 -1
- package/dist/plugins/plaud/src/shared.js +1 -2
- package/dist/plugins/plivo/src/credentials.js +1 -1
- package/dist/plugins/plivo/src/index.js +1 -1
- package/dist/plugins/posthog/src/credentials.js +1 -1
- package/dist/plugins/posthog/src/index.js +1 -1
- package/dist/plugins/profitwell/src/credentials.js +1 -1
- package/dist/plugins/profitwell/src/index.js +1 -1
- package/dist/plugins/pushbullet/src/credentials.js +1 -1
- package/dist/plugins/pushbullet/src/index.js +1 -1
- package/dist/plugins/pushcut/src/credentials.js +1 -1
- package/dist/plugins/pushcut/src/index.js +1 -1
- package/dist/plugins/pushover/src/credentials.js +1 -1
- package/dist/plugins/pushover/src/index.js +1 -1
- package/dist/plugins/quickbase/src/credentials.js +1 -1
- package/dist/plugins/quickbase/src/index.js +1 -1
- package/dist/plugins/quickbooks/src/credentials.js +1 -1
- package/dist/plugins/quickbooks/src/index.js +1 -1
- package/dist/plugins/raindrop/src/credentials.js +1 -1
- package/dist/plugins/raindrop/src/index.js +1 -1
- package/dist/plugins/recraft/src/credentials.js +1 -1
- package/dist/plugins/recraft/src/index.js +1 -1
- package/dist/plugins/reddit/src/credentials.js +1 -1
- package/dist/plugins/reddit/src/index.js +1 -1
- package/dist/plugins/replicate/src/credentials.js +1 -1
- package/dist/plugins/replicate/src/index.js +1 -1
- package/dist/plugins/rocketchat/src/credentials.js +1 -1
- package/dist/plugins/rocketchat/src/index.js +1 -1
- package/dist/plugins/rundeck/src/credentials.js +1 -1
- package/dist/plugins/rundeck/src/index.js +1 -1
- package/dist/plugins/salesforce/src/credentials.js +1 -2
- package/dist/plugins/salesforce/src/shared.js +1 -2
- package/dist/plugins/salesforce/src/sobjects.js +1 -1
- package/dist/plugins/salesmate/src/credentials.js +1 -1
- package/dist/plugins/salesmate/src/index.js +1 -1
- package/dist/plugins/securityScorecard/src/credentials.js +1 -1
- package/dist/plugins/securityScorecard/src/index.js +1 -1
- package/dist/plugins/segment/src/credentials.js +1 -1
- package/dist/plugins/segment/src/index.js +1 -1
- package/dist/plugins/sendgrid/src/credentials.js +1 -1
- package/dist/plugins/sendgrid/src/index.js +1 -2
- package/dist/plugins/sendy/src/credentials.js +1 -1
- package/dist/plugins/sendy/src/index.js +1 -1
- package/dist/plugins/sentry/src/credentials.js +1 -1
- package/dist/plugins/sentry/src/index.js +1 -1
- package/dist/plugins/servicenow/src/credentials.js +1 -1
- package/dist/plugins/servicenow/src/index.js +1 -1
- package/dist/plugins/shiftAtlas/src/graph.js +2 -1
- package/dist/plugins/shiftAtlas/src/shared.js +1 -1
- package/dist/plugins/shiftBwm/src/shared.js +2 -4
- package/dist/plugins/shiftCrm/src/access.js +2 -1
- package/dist/plugins/shiftCrm/src/accounts.js +2 -1
- package/dist/plugins/shiftCrm/src/imports.js +2 -1
- package/dist/plugins/shiftCrm/src/opportunities.js +2 -1
- package/dist/plugins/shiftCrm/src/people.js +2 -1
- package/dist/plugins/shiftCrm/src/records.js +2 -1
- package/dist/plugins/shiftCrm/src/shared.js +1 -1
- package/dist/plugins/shiftCrm/src/tasks.js +2 -1
- package/dist/plugins/shiftObjects/src/objects.js +2 -1
- package/dist/plugins/shiftOcr/src/index.js +2 -1
- package/dist/plugins/shiftPages/src/pages.js +2 -1
- package/dist/plugins/shiftPages/src/shared.js +3 -2
- package/dist/plugins/shiftTranscription/src/shared.js +1 -1
- package/dist/plugins/shiftTranscription/src/transcription.js +2 -1
- package/dist/plugins/shiftWork/src/issue-views.js +2 -1
- package/dist/plugins/shiftWork/src/issues.js +2 -1
- package/dist/plugins/shiftWork/src/projects.js +2 -1
- package/dist/plugins/shiftWork/src/shared.js +1 -1
- package/dist/plugins/shopify/src/credentials.js +1 -1
- package/dist/plugins/shopify/src/index.js +1 -1
- package/dist/plugins/signl4/src/credentials.js +1 -1
- package/dist/plugins/signl4/src/index.js +1 -1
- package/dist/plugins/slack/src/credentials.js +1 -1
- package/dist/plugins/slack/src/index.js +1 -1
- package/dist/plugins/sms77/src/credentials.js +1 -1
- package/dist/plugins/sms77/src/index.js +1 -1
- package/dist/plugins/splunk/src/credentials.js +1 -1
- package/dist/plugins/splunk/src/index.js +1 -1
- package/dist/plugins/spotify/src/credentials.js +1 -1
- package/dist/plugins/spotify/src/index.js +1 -1
- package/dist/plugins/stackby/src/credentials.js +1 -1
- package/dist/plugins/stackby/src/index.js +1 -1
- package/dist/plugins/steel/src/auth.js +1 -1
- package/dist/plugins/steel/src/browser.js +1 -1
- package/dist/plugins/steel/src/captchas.js +1 -1
- package/dist/plugins/steel/src/extensions.js +1 -1
- package/dist/plugins/steel/src/files.js +1 -1
- package/dist/plugins/steel/src/profiles.js +1 -1
- package/dist/plugins/steel/src/sessions.js +1 -1
- package/dist/plugins/steel/src/shared.js +1 -1
- package/dist/plugins/storyblok/src/credentials.js +1 -1
- package/dist/plugins/storyblok/src/index.js +1 -1
- package/dist/plugins/strapi/src/credentials.js +1 -1
- package/dist/plugins/strapi/src/index.js +1 -1
- package/dist/plugins/strava/src/credentials.js +1 -1
- package/dist/plugins/strava/src/index.js +1 -1
- package/dist/plugins/stripe/src/credentials.js +1 -1
- package/dist/plugins/stripe/src/index.js +1 -1
- package/dist/plugins/supabase/src/credentials.js +1 -1
- package/dist/plugins/supabase/src/index.js +1 -1
- package/dist/plugins/syncromsp/src/credentials.js +1 -1
- package/dist/plugins/syncromsp/src/index.js +1 -1
- package/dist/plugins/tapfiliate/src/credentials.js +1 -1
- package/dist/plugins/tapfiliate/src/index.js +1 -1
- package/dist/plugins/telegram/src/credentials.js +1 -1
- package/dist/plugins/telegram/src/index.js +1 -1
- package/dist/plugins/thehive/src/credentials.js +1 -1
- package/dist/plugins/thehive/src/index.js +1 -1
- package/dist/plugins/thehiveProject/src/credentials.js +1 -1
- package/dist/plugins/thehiveProject/src/index.js +1 -1
- package/dist/plugins/todoist/src/credentials.js +1 -1
- package/dist/plugins/todoist/src/index.js +1 -1
- package/dist/plugins/together/src/credentials.js +1 -1
- package/dist/plugins/together/src/index.js +1 -1
- package/dist/plugins/travisci/src/credentials.js +1 -1
- package/dist/plugins/travisci/src/index.js +1 -1
- package/dist/plugins/trello/src/credentials.js +1 -1
- package/dist/plugins/trello/src/index.js +1 -1
- package/dist/plugins/twake/src/credentials.js +1 -1
- package/dist/plugins/twake/src/index.js +1 -1
- package/dist/plugins/twilio/src/credentials.js +1 -1
- package/dist/plugins/twilio/src/index.js +1 -1
- package/dist/plugins/twist/src/credentials.js +1 -1
- package/dist/plugins/twist/src/index.js +1 -1
- package/dist/plugins/twitter/src/credentials.js +1 -1
- package/dist/plugins/twitter/src/index.js +1 -1
- package/dist/plugins/typesafe/src/credentials.js +1 -1
- package/dist/plugins/typesafe/src/shared.js +1 -1
- package/dist/plugins/unleashedSoftware/src/credentials.js +1 -1
- package/dist/plugins/unleashedSoftware/src/index.js +1 -1
- package/dist/plugins/uplead/src/credentials.js +1 -1
- package/dist/plugins/uplead/src/index.js +1 -1
- package/dist/plugins/uproc/src/credentials.js +1 -1
- package/dist/plugins/uproc/src/index.js +1 -1
- package/dist/plugins/uptimerobot/src/credentials.js +1 -1
- package/dist/plugins/uptimerobot/src/index.js +1 -1
- package/dist/plugins/urlscanio/src/credentials.js +1 -1
- package/dist/plugins/urlscanio/src/index.js +1 -1
- package/dist/plugins/vercel/src/credentials.js +1 -1
- package/dist/plugins/vercel/src/deployments.js +1 -1
- package/dist/plugins/vercel/src/env.js +1 -1
- package/dist/plugins/vercel/src/projects.js +1 -1
- package/dist/plugins/vercel/src/shared.js +1 -2
- package/dist/plugins/vero/src/credentials.js +1 -1
- package/dist/plugins/vero/src/index.js +1 -1
- package/dist/plugins/vonage/src/credentials.js +1 -1
- package/dist/plugins/vonage/src/index.js +1 -1
- package/dist/plugins/wekan/src/credentials.js +1 -1
- package/dist/plugins/wekan/src/index.js +1 -1
- package/dist/plugins/wolt/src/account.js +1 -1
- package/dist/plugins/wolt/src/credentials.js +1 -1
- package/dist/plugins/wolt/src/index.js +1 -1
- package/dist/plugins/wolt/src/shared.js +1 -2
- package/dist/plugins/woocommerce/src/credentials.js +1 -1
- package/dist/plugins/woocommerce/src/index.js +1 -1
- package/dist/plugins/wordpress/src/credentials.js +1 -1
- package/dist/plugins/wordpress/src/index.js +1 -1
- package/dist/plugins/xai/src/credentials.js +1 -1
- package/dist/plugins/xai/src/index.js +1 -1
- package/dist/plugins/xero/src/credentials.js +1 -1
- package/dist/plugins/xero/src/index.js +1 -1
- package/dist/plugins/yourls/src/credentials.js +1 -1
- package/dist/plugins/yourls/src/index.js +1 -1
- package/dist/plugins/zammad/src/credentials.js +1 -1
- package/dist/plugins/zammad/src/index.js +1 -1
- package/dist/plugins/zendesk/src/credentials.js +1 -1
- package/dist/plugins/zendesk/src/index.js +1 -1
- package/dist/plugins/zoho/src/credentials.js +1 -1
- package/dist/plugins/zoho/src/index.js +1 -1
- package/dist/plugins/zoom/src/credentials.js +1 -1
- package/dist/plugins/zoom/src/index.js +1 -1
- package/dist/plugins/zulip/src/credentials.js +1 -1
- package/dist/plugins/zulip/src/index.js +1 -1
- package/package.json +3 -2
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { AuthError
|
|
2
|
+
import { AuthError } from "../auth/errors.js";
|
|
3
|
+
import { awsProfileKey } from "./aws.js";
|
|
4
|
+
import { CredentialRegistry } from "./registry.js";
|
|
5
|
+
import { CredentialTransport } from "./transport.js";
|
|
3
6
|
/**
|
|
4
7
|
* Where one action call's authenticated requests go: the host's broker
|
|
5
8
|
* when it supplies one — the credentials then live with the host, and no
|
|
6
9
|
* local signer is built — else this process signs with its own
|
|
7
|
-
* connection, from the plugin's declaration.
|
|
10
|
+
* connection, from the plugin's declaration. Plugin-side: the host-side
|
|
11
|
+
* `credentialBroker` option is what supplies `ctx.credentials`.
|
|
8
12
|
*/
|
|
9
|
-
export function
|
|
13
|
+
export function brokerFor(ctx, declaration) {
|
|
10
14
|
if (ctx.credentials)
|
|
11
15
|
return ctx.credentials;
|
|
12
16
|
const { binding, transport } = localSigner(ctx, declaration);
|
|
@@ -18,7 +22,7 @@ export function credentialBroker(ctx, declaration) {
|
|
|
18
22
|
}
|
|
19
23
|
/**
|
|
20
24
|
* Everything a stored token was issued under. A config whose selection
|
|
21
|
-
* hashes differently
|
|
25
|
+
* hashes differently cannot use tokens issued for this one. A
|
|
22
26
|
* token of a declared grant was issued under the grant — its method,
|
|
23
27
|
* client and token endpoint (Microsoft's names the tenant) — not the
|
|
24
28
|
* plugin that asked, so every plugin of the grant hashes alike and shares
|
|
@@ -37,36 +41,76 @@ function authorityOf(selection) {
|
|
|
37
41
|
endpoint: auth.definition.refresh,
|
|
38
42
|
}
|
|
39
43
|
: selection;
|
|
40
|
-
return createHash("sha256")
|
|
41
|
-
.update(JSON.stringify(issuedUnder))
|
|
42
|
-
.digest("hex");
|
|
44
|
+
return createHash("sha256").update(JSON.stringify(issuedUnder)).digest("hex");
|
|
43
45
|
}
|
|
44
46
|
/**
|
|
45
|
-
* A
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
47
|
+
* A stored secret's structured shape (a static secret's parts, or an AWS
|
|
48
|
+
* access key) from the flat fields and fixed values the declaration
|
|
49
|
+
* names, joined in order where a part concatenates them. Absent when a
|
|
50
|
+
* required part's field is missing, so the transport refuses it as
|
|
51
|
+
* invalid_credentials before any IO; a missing optional part is left out.
|
|
50
52
|
*/
|
|
51
53
|
function staticSecret(current, sources, optional) {
|
|
52
54
|
if (!sources)
|
|
53
55
|
return undefined;
|
|
54
56
|
const secret = {};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
continue sources;
|
|
62
|
-
return undefined;
|
|
63
|
-
}
|
|
64
|
-
joined += value;
|
|
65
|
-
}
|
|
66
|
-
secret[key] = joined;
|
|
57
|
+
for (const [key, source] of Object.entries(sources)) {
|
|
58
|
+
const joined = joinedPart(current, source);
|
|
59
|
+
if (joined !== undefined)
|
|
60
|
+
secret[key] = joined;
|
|
61
|
+
else if (!optional.includes(key))
|
|
62
|
+
return undefined;
|
|
67
63
|
}
|
|
68
64
|
return secret;
|
|
69
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* One part of a static secret: its field or fixed value, or the pieces it
|
|
68
|
+
* concatenates joined in order. Absent when any field it reads is missing
|
|
69
|
+
* or not a string.
|
|
70
|
+
*/
|
|
71
|
+
function joinedPart(current, source) {
|
|
72
|
+
let joined = "";
|
|
73
|
+
for (const part of "concat" in source ? source.concat : [source]) {
|
|
74
|
+
const value = "value" in part ? part.value : current[part.field];
|
|
75
|
+
if (typeof value !== "string")
|
|
76
|
+
return undefined;
|
|
77
|
+
joined += value;
|
|
78
|
+
}
|
|
79
|
+
return joined;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* How an issued credential is stored flat: an OAuth grant as its token
|
|
83
|
+
* fields, a role session as `awsSession`, each stamped with the authority
|
|
84
|
+
* (`expected`) it was issued under. Only those two are ever renewed and
|
|
85
|
+
* written back.
|
|
86
|
+
*/
|
|
87
|
+
function writeBack(auth, expected) {
|
|
88
|
+
if (auth.kind === "awsSigV4" && auth.assumeRole) {
|
|
89
|
+
const { sessionField } = auth.assumeRole;
|
|
90
|
+
return (patch) => {
|
|
91
|
+
const session = patch[sessionField];
|
|
92
|
+
if (!session?.sessionToken)
|
|
93
|
+
throw new AuthError("invalid_credentials");
|
|
94
|
+
return { awsSession: { ...session, binding: expected } };
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
if (auth.kind !== "oauth2")
|
|
98
|
+
throw new AuthError("invalid_definition");
|
|
99
|
+
return (patch, current) => {
|
|
100
|
+
const grant = patch[auth.field];
|
|
101
|
+
if (!grant?.tokens.accessToken)
|
|
102
|
+
throw new AuthError("invalid_credentials");
|
|
103
|
+
return {
|
|
104
|
+
accessToken: grant.tokens.accessToken,
|
|
105
|
+
accessTokenExpiresAt: grant.tokens.expiresAt,
|
|
106
|
+
refreshToken: grant.tokens.refreshToken ?? current.refreshToken,
|
|
107
|
+
authTokenScope: grant.tokens.scope,
|
|
108
|
+
authTokenType: grant.tokens.tokenType,
|
|
109
|
+
authTokenRevision: grant.revision,
|
|
110
|
+
authTokenBinding: expected,
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
}
|
|
70
114
|
/**
|
|
71
115
|
* This process signing with its own connection. Flat CLI/env storage is a
|
|
72
116
|
* projection, not a second token cache or refresh engine.
|
|
@@ -79,7 +123,7 @@ function localSigner(ctx, declaration) {
|
|
|
79
123
|
const auth = definition.methods[method].authentication;
|
|
80
124
|
const identity = { name: ctx.connection.name, plugin: ctx.connection.plugin };
|
|
81
125
|
const expected = authorityOf(selection);
|
|
82
|
-
const project = (current) => {
|
|
126
|
+
const project = async (current) => {
|
|
83
127
|
if (authorityOf(declaration(current)) !== expected)
|
|
84
128
|
throw new AuthError("binding_changed");
|
|
85
129
|
if (auth.kind === "none")
|
|
@@ -88,6 +132,27 @@ function localSigner(ctx, declaration) {
|
|
|
88
132
|
const secret = staticSecret(current, selection.localSecret, auth.optionalParts ?? []);
|
|
89
133
|
return secret ? { [auth.field]: secret } : {};
|
|
90
134
|
}
|
|
135
|
+
if (auth.kind === "awsSigV4") {
|
|
136
|
+
const key = selection.awsProfile
|
|
137
|
+
? await awsProfileKey(selection.awsProfile)
|
|
138
|
+
: staticSecret(current, selection.localSecret, ["sessionToken"]);
|
|
139
|
+
const cached = current.awsSession;
|
|
140
|
+
const sessionField = auth.assumeRole?.sessionField;
|
|
141
|
+
return {
|
|
142
|
+
...(key ? { [auth.field]: key } : {}),
|
|
143
|
+
...(sessionField && cached?.binding === expected
|
|
144
|
+
? {
|
|
145
|
+
[sessionField]: {
|
|
146
|
+
accessKeyId: cached.accessKeyId,
|
|
147
|
+
secretAccessKey: cached.secretAccessKey,
|
|
148
|
+
sessionToken: cached.sessionToken,
|
|
149
|
+
expiresAt: cached.expiresAt,
|
|
150
|
+
revision: cached.revision,
|
|
151
|
+
},
|
|
152
|
+
}
|
|
153
|
+
: {}),
|
|
154
|
+
};
|
|
155
|
+
}
|
|
91
156
|
const compatible = current.authTokenBinding === undefined ||
|
|
92
157
|
current.authTokenBinding === expected;
|
|
93
158
|
const tokens = {
|
|
@@ -114,9 +179,9 @@ function localSigner(ctx, declaration) {
|
|
|
114
179
|
: createHash("sha256").update(JSON.stringify(tokens)).digest("hex");
|
|
115
180
|
return { [auth.field]: { tokens, revision } };
|
|
116
181
|
};
|
|
117
|
-
const snapshot = () => ({
|
|
182
|
+
const snapshot = async () => ({
|
|
118
183
|
...identity,
|
|
119
|
-
config: project(ctx.connection.config),
|
|
184
|
+
config: await project(ctx.connection.config),
|
|
120
185
|
});
|
|
121
186
|
const binding = {
|
|
122
187
|
type: definition.id,
|
|
@@ -127,31 +192,17 @@ function localSigner(ctx, declaration) {
|
|
|
127
192
|
...(selection.resourceOwner
|
|
128
193
|
? { resourceOwner: selection.resourceOwner }
|
|
129
194
|
: {}),
|
|
195
|
+
...(selection.awsRole ? { awsRole: selection.awsRole } : {}),
|
|
130
196
|
connection: {
|
|
131
197
|
async read() {
|
|
132
198
|
return snapshot();
|
|
133
199
|
},
|
|
134
200
|
async update(change) {
|
|
135
|
-
|
|
136
|
-
if (auth.kind !== "oauth2")
|
|
137
|
-
throw new AuthError("invalid_definition");
|
|
201
|
+
const flatten = writeBack(auth, expected);
|
|
138
202
|
await ctx.updateConnection(async (current) => {
|
|
139
|
-
const projected = project(current);
|
|
203
|
+
const projected = await project(current);
|
|
140
204
|
const patch = typeof change === "function" ? await change(projected) : change;
|
|
141
|
-
|
|
142
|
-
return;
|
|
143
|
-
const grant = patch[auth.field];
|
|
144
|
-
if (!grant?.tokens.accessToken)
|
|
145
|
-
throw new AuthError("invalid_credentials");
|
|
146
|
-
return {
|
|
147
|
-
accessToken: grant.tokens.accessToken,
|
|
148
|
-
accessTokenExpiresAt: grant.tokens.expiresAt,
|
|
149
|
-
refreshToken: grant.tokens.refreshToken ?? current.refreshToken,
|
|
150
|
-
authTokenScope: grant.tokens.scope,
|
|
151
|
-
authTokenType: grant.tokens.tokenType,
|
|
152
|
-
authTokenRevision: grant.revision,
|
|
153
|
-
authTokenBinding: expected,
|
|
154
|
-
};
|
|
205
|
+
return patch ? flatten(patch, current) : undefined;
|
|
155
206
|
});
|
|
156
207
|
return snapshot();
|
|
157
208
|
},
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plugin side of the credential broker, public to every plugin —
|
|
3
|
+
* bundled or custom: one declaration factory for static keys, one stored
|
|
4
|
+
* grant shape for OAuth methods, one way to turn public config into an
|
|
5
|
+
* HTTPS target, one request path.
|
|
6
|
+
*/
|
|
7
|
+
import * as t from "typebox";
|
|
8
|
+
import type { ActionContext } from "../plugin/types.js";
|
|
9
|
+
import type { CredentialDeclaration, CredentialProbe, CredentialTarget, HttpMethod, LocalSecretPart, SecretPlacement } from "./types.js";
|
|
10
|
+
/**
|
|
11
|
+
* The stored shape of an OAuth method: one optional revisioned grant in the
|
|
12
|
+
* `grant` field, absent until the first issuance.
|
|
13
|
+
*/
|
|
14
|
+
export declare const grantSchema: t.TObject<{
|
|
15
|
+
grant: t.TOptional<t.TObject<{
|
|
16
|
+
tokens: t.TObject<{
|
|
17
|
+
accessToken: t.TOptional<t.TString>;
|
|
18
|
+
refreshToken: t.TOptional<t.TString>;
|
|
19
|
+
expiresAt: t.TOptional<t.TInteger>;
|
|
20
|
+
scope: t.TOptional<t.TString>;
|
|
21
|
+
tokenType: t.TOptional<t.TString>;
|
|
22
|
+
metadata: t.TOptional<t.TRecord<"^.*$", t.TString>>;
|
|
23
|
+
}>;
|
|
24
|
+
revision: t.TString;
|
|
25
|
+
}>>;
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* A flat config field, a fixed value such as Freshdesk's "X" password, or
|
|
29
|
+
* the two joined in order, such as Zendesk's `{email}/token` username.
|
|
30
|
+
*/
|
|
31
|
+
type LocalSource = string | {
|
|
32
|
+
value: string;
|
|
33
|
+
} | {
|
|
34
|
+
concat: LocalSecretPart[];
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* How the secret is placed: a shorthand for a common single-secret case,
|
|
38
|
+
* or the general form of named parts and their placements. The kind names
|
|
39
|
+
* the method, so a stored selection keeps its method name.
|
|
40
|
+
*/
|
|
41
|
+
type StaticAuth = {
|
|
42
|
+
kind: "bearer";
|
|
43
|
+
} | {
|
|
44
|
+
kind: "apiKey";
|
|
45
|
+
header: string;
|
|
46
|
+
prefix?: string;
|
|
47
|
+
} | {
|
|
48
|
+
kind: "queryKey";
|
|
49
|
+
param: string;
|
|
50
|
+
} | {
|
|
51
|
+
kind: "basic";
|
|
52
|
+
} | {
|
|
53
|
+
kind: "static";
|
|
54
|
+
parts: string[];
|
|
55
|
+
optionalParts?: string[];
|
|
56
|
+
placements: SecretPlacement[];
|
|
57
|
+
};
|
|
58
|
+
export interface StaticCredentialSpec {
|
|
59
|
+
/** Credential type id; one per provider, shared by its plugins. */
|
|
60
|
+
id: string;
|
|
61
|
+
auth: StaticAuth;
|
|
62
|
+
/**
|
|
63
|
+
* Where a CLI connection keeps each part: `secret` for the single-secret
|
|
64
|
+
* shorthands, `username` and `password` for basic, and one entry per
|
|
65
|
+
* part for the general form.
|
|
66
|
+
*/
|
|
67
|
+
local: Record<string, LocalSource>;
|
|
68
|
+
/** Fixed targets, or targets built from public config (hosts, account paths). */
|
|
69
|
+
targets: Record<string, CredentialTarget> | ((config: Readonly<Record<string, unknown>>) => Record<string, CredentialTarget>);
|
|
70
|
+
probe?: CredentialProbe;
|
|
71
|
+
/**
|
|
72
|
+
* The credential is optional: a connection signs when it holds the flat
|
|
73
|
+
* secret fields (the CLI) or says `authenticated: true` in its public
|
|
74
|
+
* config (a host that stores the credential), and otherwise sends its
|
|
75
|
+
* requests unsigned through a `none` method — held to the same targets,
|
|
76
|
+
* or to targets of its own where the provider serves unsigned requests
|
|
77
|
+
* elsewhere.
|
|
78
|
+
*/
|
|
79
|
+
optional?: true | {
|
|
80
|
+
targets: Record<string, CredentialTarget>;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* A static-key plugin's declaration. The secret lives in one structured
|
|
85
|
+
* `credential` field — `{ secret }`, `{ username, password }` for basic, or
|
|
86
|
+
* the general form's named parts — and the method is named for the auth
|
|
87
|
+
* kind, so every static declaration has the same shape. A host stores the
|
|
88
|
+
* structured field; the CLI's flat fields are named by `local`.
|
|
89
|
+
*/
|
|
90
|
+
export declare function staticCredential(spec: StaticCredentialSpec): CredentialDeclaration;
|
|
91
|
+
/**
|
|
92
|
+
* An HTTPS base URL from public config, with `path` appended beneath it.
|
|
93
|
+
* Anything else — plain HTTP, embedded credentials, a query or fragment —
|
|
94
|
+
* is invalid_credentials: the connection cannot be signed as configured.
|
|
95
|
+
*/
|
|
96
|
+
export declare function httpsBase(value: unknown, path: string): string;
|
|
97
|
+
/** One DNS label from public config, for `https://{label}.provider.com/` hosts. */
|
|
98
|
+
export declare function hostLabel(value: unknown): string;
|
|
99
|
+
/**
|
|
100
|
+
* One of a config field's documented values — a region, an environment,
|
|
101
|
+
* a hosting mode — or `fallback` when the field is absent. Anything else
|
|
102
|
+
* is invalid_credentials, never mapped to a default: a mistyped value
|
|
103
|
+
* would otherwise send the credential to another host.
|
|
104
|
+
*/
|
|
105
|
+
export declare function configChoice<const C extends string>(value: unknown, choices: readonly C[], fallback: C): C;
|
|
106
|
+
/**
|
|
107
|
+
* A boolean config field, as a boolean or the string a CLI or environment
|
|
108
|
+
* variable gives (`"true"`, `"false"`); false when absent. Anything else
|
|
109
|
+
* is invalid_credentials, as for `configChoice`: a mistyped sandbox or
|
|
110
|
+
* SSL flag must not read as false and reach the live host.
|
|
111
|
+
*/
|
|
112
|
+
export declare function configFlag(value: unknown): boolean;
|
|
113
|
+
/**
|
|
114
|
+
* An ID or name as exactly one path segment, the one encoder every plugin
|
|
115
|
+
* uses. A value that is not one segment is refused rather than encoded: an
|
|
116
|
+
* empty value would address the parent collection (`items/`), a dot segment
|
|
117
|
+
* a sibling, and a separator more than one segment.
|
|
118
|
+
*/
|
|
119
|
+
export declare function pathSegment(value: unknown): string;
|
|
120
|
+
/**
|
|
121
|
+
* A slash-separated name the API addresses as a sub-path — a model's
|
|
122
|
+
* `owner/name`, a file path, a nested job — each segment by `pathSegment`,
|
|
123
|
+
* its slashes kept.
|
|
124
|
+
*/
|
|
125
|
+
export declare function pathSegments(value: unknown): string;
|
|
126
|
+
/**
|
|
127
|
+
* A slashed name as exactly one segment, its slashes encoded
|
|
128
|
+
* (`@scope/pkg` → `%40scope%2Fpkg`), for a target that declares
|
|
129
|
+
* `encodedSlashes`. An empty or dot piece, or a backslash, is refused.
|
|
130
|
+
*/
|
|
131
|
+
export declare function slashEncodedSegment(value: unknown): string;
|
|
132
|
+
export interface CredentialCall {
|
|
133
|
+
target: string;
|
|
134
|
+
/** Relative to the target's base URL; may carry its own query. */
|
|
135
|
+
path: string;
|
|
136
|
+
method?: HttpMethod;
|
|
137
|
+
/** Appended to the path's query. Arrays repeat the key; null and undefined are skipped. */
|
|
138
|
+
query?: Record<string, unknown>;
|
|
139
|
+
/** Serialized as the JSON body, with a JSON Content-Type. */
|
|
140
|
+
json?: unknown;
|
|
141
|
+
/** Serialized as a form body, by the query's rules, with a form Content-Type. */
|
|
142
|
+
form?: Record<string, unknown>;
|
|
143
|
+
body?: string | Uint8Array;
|
|
144
|
+
headers?: Record<string, string>;
|
|
145
|
+
/** COPY and MOVE: the destination path beneath the same target. */
|
|
146
|
+
destination?: string;
|
|
147
|
+
/**
|
|
148
|
+
* The provider's deduplication key, for a target that declares
|
|
149
|
+
* `idempotency`: the transport sets the declared header itself and
|
|
150
|
+
* refuses the request on any other target or method.
|
|
151
|
+
*/
|
|
152
|
+
idempotencyKey?: string;
|
|
153
|
+
}
|
|
154
|
+
/** The one authenticated request path: the host's broker, else the local signer. */
|
|
155
|
+
export declare function credentialRequest(ctx: ActionContext, declaration: CredentialDeclaration, call: CredentialCall): Promise<Response>;
|
|
156
|
+
/**
|
|
157
|
+
* A step that writes a grant into the connection — an owner login run
|
|
158
|
+
* against the provider — happens only where the grant lives: this process,
|
|
159
|
+
* signing with its own connection. Under a host that keeps the grant, setup
|
|
160
|
+
* is the host's, and the step refuses before any request.
|
|
161
|
+
*/
|
|
162
|
+
export declare function refuseUnderHost(ctx: ActionContext): void;
|
|
163
|
+
/**
|
|
164
|
+
* A socket target's URL for this connection, from the broker: signed by
|
|
165
|
+
* the local signer, or a relay the host controls. A broker that serves no
|
|
166
|
+
* sockets refuses as unsupported_operation.
|
|
167
|
+
*/
|
|
168
|
+
export declare function credentialSocketUrl(ctx: ActionContext, declaration: CredentialDeclaration, call: {
|
|
169
|
+
target: string;
|
|
170
|
+
path: string;
|
|
171
|
+
query?: Record<string, unknown>;
|
|
172
|
+
}): Promise<string>;
|
|
173
|
+
/**
|
|
174
|
+
* A provider error identifier worth handing back — an error code, a field
|
|
175
|
+
* path — as a plain name. Anything else is not a name and is dropped, so
|
|
176
|
+
* the code and field slots of a failure never carry free text.
|
|
177
|
+
*/
|
|
178
|
+
export declare function errorIdentifier(value: unknown): string | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* How a failed request reads: its HTTP status when the status is the
|
|
181
|
+
* failure, and the identifiers a provider returns for correcting the call
|
|
182
|
+
* — its error `code` and the offending `param`. No free text from a failed
|
|
183
|
+
* response reaches it: that is where a provider may echo the credential.
|
|
184
|
+
*/
|
|
185
|
+
export declare function failureMessage(plugin: string, status: number | undefined, detail?: {
|
|
186
|
+
code?: string;
|
|
187
|
+
param?: string;
|
|
188
|
+
}): string;
|
|
189
|
+
/**
|
|
190
|
+
* A successful response whose answer reports failure — Slack's `ok: false`,
|
|
191
|
+
* an OCS status, a GraphQL `errors` entry — by the provider's code, the
|
|
192
|
+
* field at fault and its message. The answer is 2xx data the plugin
|
|
193
|
+
* already holds, so the message stays for the caller to act on, reduced
|
|
194
|
+
* to one line of at most 300 characters.
|
|
195
|
+
*/
|
|
196
|
+
export declare function answerFailed(plugin: string, detail: {
|
|
197
|
+
code?: unknown;
|
|
198
|
+
param?: unknown;
|
|
199
|
+
message?: unknown;
|
|
200
|
+
}): Error;
|
|
201
|
+
/** A GraphQL answer's `errors`, read by `answerFailed` from the first entry. */
|
|
202
|
+
export declare function graphqlFailed(plugin: string, errors: unknown): Error;
|
|
203
|
+
/** A failed request, reported by status alone. */
|
|
204
|
+
export declare function requestFailed(plugin: string, status: number): Error;
|
|
205
|
+
/** What a provider's error envelope names, before it is reduced to identifiers. */
|
|
206
|
+
export interface ErrorEnvelope {
|
|
207
|
+
code?: unknown;
|
|
208
|
+
/** One field path, or several (joined in order). */
|
|
209
|
+
param?: unknown;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* A failed response by its status and the identifiers its error envelope
|
|
213
|
+
* names. `read` picks the code and param out of the parsed JSON body, in
|
|
214
|
+
* the provider's own shape; only what `errorIdentifier` accepts is kept,
|
|
215
|
+
* so a provider's messages never reach the error. A body that is not JSON
|
|
216
|
+
* reports the status alone. The status rides on the error for callers
|
|
217
|
+
* that branch on it.
|
|
218
|
+
*/
|
|
219
|
+
export declare function responseFailed(plugin: string, response: Response, read: (body: unknown) => ErrorEnvelope): Promise<Error & {
|
|
220
|
+
status: number;
|
|
221
|
+
}>;
|
|
222
|
+
/** A request that must succeed, for callers that read the Response itself (headers, text, bytes). */
|
|
223
|
+
export declare function credentialOk(ctx: ActionContext, declaration: CredentialDeclaration, plugin: string, call: CredentialCall): Promise<Response>;
|
|
224
|
+
/** What a JSON request answers for an empty (or 204) response. */
|
|
225
|
+
export type EmptyAnswer = {
|
|
226
|
+
success: true;
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* A successful response's JSON. `T` is the caller's statement of the
|
|
230
|
+
* answer's shape, unchecked, as for any parsed JSON; without one it is
|
|
231
|
+
* `unknown`. An empty answer is `EmptyAnswer`, so a caller whose endpoint
|
|
232
|
+
* can answer empty includes it in `T`. Every JSON request path reads its
|
|
233
|
+
* answer here, so they cannot disagree about empty or malformed bodies.
|
|
234
|
+
*/
|
|
235
|
+
export declare function jsonAnswer<T = unknown>(response: Response): Promise<T>;
|
|
236
|
+
/**
|
|
237
|
+
* A successful response's JSON when its Content-Type says JSON; any other
|
|
238
|
+
* body — a text "OK", nothing at all — is an acknowledgement,
|
|
239
|
+
* `EmptyAnswer`. For APIs whose writes answer without JSON.
|
|
240
|
+
*/
|
|
241
|
+
export declare function jsonOrAcknowledged<T = unknown>(response: Response): Promise<T | EmptyAnswer>;
|
|
242
|
+
/** A JSON request that must succeed; its answer is read by `jsonAnswer`. */
|
|
243
|
+
export declare function credentialJson<T = unknown>(ctx: ActionContext, declaration: CredentialDeclaration, plugin: string, call: CredentialCall): Promise<T>;
|
|
244
|
+
/**
|
|
245
|
+
* A next-page URL the API returned, as a path beneath the declared target
|
|
246
|
+
* it will be signed for. Anything outside that target's exact origin and
|
|
247
|
+
* path prefix is refused rather than followed with the credential attached.
|
|
248
|
+
*/
|
|
249
|
+
export declare function pathWithin(ctx: ActionContext, declaration: CredentialDeclaration, target: string, value: string): string;
|
|
250
|
+
/** FormData as the buffered bytes the transport accepts, with its boundary. */
|
|
251
|
+
export declare function multipartBody(form: FormData): Promise<{
|
|
252
|
+
body: Uint8Array<ArrayBuffer>;
|
|
253
|
+
contentType: string;
|
|
254
|
+
}>;
|
|
255
|
+
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { AuthError, OAuthGrantSchema, staticSecretSchema, } from "runline";
|
|
2
|
-
import * as t from "typebox";
|
|
3
|
-
import { credentialBroker } from "./credentialAdapter.js";
|
|
4
1
|
/**
|
|
5
|
-
* The plugin side of the credential broker,
|
|
6
|
-
* declaration factory for static keys, one stored
|
|
7
|
-
* methods, one way to turn public config into an
|
|
8
|
-
* request path.
|
|
2
|
+
* The plugin side of the credential broker, public to every plugin —
|
|
3
|
+
* bundled or custom: one declaration factory for static keys, one stored
|
|
4
|
+
* grant shape for OAuth methods, one way to turn public config into an
|
|
5
|
+
* HTTPS target, one request path.
|
|
9
6
|
*/
|
|
7
|
+
import * as t from "typebox";
|
|
8
|
+
import { AuthError } from "../auth/errors.js";
|
|
9
|
+
import { brokerFor } from "./broker.js";
|
|
10
|
+
import { OAuthGrantSchema, staticSecretSchema } from "./registry.js";
|
|
10
11
|
/**
|
|
11
12
|
* The stored shape of an OAuth method: one optional revisioned grant in the
|
|
12
13
|
* `grant` field, absent until the first issuance.
|
|
@@ -213,7 +214,7 @@ export function credentialRequest(ctx, declaration, call) {
|
|
|
213
214
|
}
|
|
214
215
|
: undefined;
|
|
215
216
|
const payload = body?.body ?? call.body;
|
|
216
|
-
return
|
|
217
|
+
return brokerFor(ctx, declaration).request({
|
|
217
218
|
target: call.target,
|
|
218
219
|
path: withQuery(call.path, call.query),
|
|
219
220
|
method: call.method ?? "GET",
|
|
@@ -247,7 +248,7 @@ export function refuseUnderHost(ctx) {
|
|
|
247
248
|
* sockets refuses as unsupported_operation.
|
|
248
249
|
*/
|
|
249
250
|
export async function credentialSocketUrl(ctx, declaration, call) {
|
|
250
|
-
const broker =
|
|
251
|
+
const broker = brokerFor(ctx, declaration);
|
|
251
252
|
if (!broker.socketUrl)
|
|
252
253
|
throw new AuthError("unsupported_operation");
|
|
253
254
|
return broker.socketUrl({
|
|
@@ -297,7 +298,7 @@ export function answerFailed(plugin, detail) {
|
|
|
297
298
|
param: identifierOf(detail.param),
|
|
298
299
|
});
|
|
299
300
|
const text = typeof detail.message === "string"
|
|
300
|
-
? detail.message.replace(/[\
|
|
301
|
+
? detail.message.replace(/[\p{Cc}\s]+/gu, " ").trim()
|
|
301
302
|
: "";
|
|
302
303
|
const line = text.length > 300 ? `${text.slice(0, 300)}…` : text;
|
|
303
304
|
return new Error(line ? `${head}: ${line}` : head);
|
|
@@ -9,6 +9,12 @@ export declare const TRANSPORT_HEADERS: readonly string[];
|
|
|
9
9
|
/** The most any target may declare, and any host may allow, per request. */
|
|
10
10
|
export declare const TARGET_TIMEOUT_LIMIT_MS: number;
|
|
11
11
|
export declare const TARGET_RESPONSE_LIMIT_BYTES: number;
|
|
12
|
+
/**
|
|
13
|
+
* A secret sent exactly as it is (a token in a header, a key in a query,
|
|
14
|
+
* a signature's credential): printable ASCII with no whitespace. Anything
|
|
15
|
+
* else is refused as invalid_credentials before it reaches a request.
|
|
16
|
+
*/
|
|
17
|
+
export declare function secret(value: unknown): string;
|
|
12
18
|
/** A positive integer no larger than `limit`. */
|
|
13
19
|
export declare function bounded(value: unknown, limit: number): boolean;
|
|
14
20
|
export declare function headerName(name: string): string;
|
|
@@ -22,9 +28,11 @@ export declare function placementsFor(auth: Extract<CredentialAuthentication, {
|
|
|
22
28
|
/** Headers a method's authentication sets on `target`, lowercased; callers never set them. */
|
|
23
29
|
export declare function injectedHeaders(auth: CredentialAuthentication, target: string): string[];
|
|
24
30
|
/**
|
|
25
|
-
* Query parameters a method's authentication
|
|
26
|
-
*
|
|
27
|
-
*
|
|
31
|
+
* Query parameters a method's authentication owns on `target`, so callers
|
|
32
|
+
* never set them: the parameters a static method places, a body part's
|
|
33
|
+
* included (it reaches the query when a request has no body), and for
|
|
34
|
+
* SigV4 those of a presigned URL, which a header-signed request never
|
|
35
|
+
* carries.
|
|
28
36
|
*/
|
|
29
37
|
export declare function injectedParams(auth: CredentialAuthentication, target: string): string[];
|
|
30
38
|
/** Body fields a method's authentication sets on `target`; callers never set them. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AuthError } from "../auth/errors.js";
|
|
2
|
+
import { SIGV4_HEADERS, SIGV4_QUERY_PARAMETERS } from "./sigv4.js";
|
|
2
3
|
export const HTTP_METHODS = [
|
|
3
4
|
"GET",
|
|
4
5
|
"HEAD",
|
|
@@ -22,6 +23,18 @@ export const TRANSPORT_HEADERS = [
|
|
|
22
23
|
/** The most any target may declare, and any host may allow, per request. */
|
|
23
24
|
export const TARGET_TIMEOUT_LIMIT_MS = 60 * 60_000;
|
|
24
25
|
export const TARGET_RESPONSE_LIMIT_BYTES = 1024 * 1024 * 1024;
|
|
26
|
+
/**
|
|
27
|
+
* A secret sent exactly as it is (a token in a header, a key in a query,
|
|
28
|
+
* a signature's credential): printable ASCII with no whitespace. Anything
|
|
29
|
+
* else is refused as invalid_credentials before it reaches a request.
|
|
30
|
+
*/
|
|
31
|
+
export function secret(value) {
|
|
32
|
+
if (typeof value !== "string" ||
|
|
33
|
+
!value ||
|
|
34
|
+
[...value].some((char) => char.charCodeAt(0) <= 32 || char.charCodeAt(0) > 126))
|
|
35
|
+
throw new AuthError("invalid_credentials");
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
25
38
|
/** A positive integer no larger than `limit`. */
|
|
26
39
|
export function bounded(value, limit) {
|
|
27
40
|
return (Number.isSafeInteger(value) &&
|
|
@@ -104,6 +117,8 @@ export function injectedHeaders(auth, target) {
|
|
|
104
117
|
return [];
|
|
105
118
|
if (auth.kind === "oauth2")
|
|
106
119
|
return ["authorization"];
|
|
120
|
+
if (auth.kind === "awsSigV4")
|
|
121
|
+
return [...SIGV4_HEADERS];
|
|
107
122
|
return placementsFor(auth, target).flatMap((placement) => placement.in === "header" ||
|
|
108
123
|
placement.in === "jwt" ||
|
|
109
124
|
placement.in === "querySignature"
|
|
@@ -113,11 +128,15 @@ export function injectedHeaders(auth, target) {
|
|
|
113
128
|
: []);
|
|
114
129
|
}
|
|
115
130
|
/**
|
|
116
|
-
* Query parameters a method's authentication
|
|
117
|
-
*
|
|
118
|
-
*
|
|
131
|
+
* Query parameters a method's authentication owns on `target`, so callers
|
|
132
|
+
* never set them: the parameters a static method places, a body part's
|
|
133
|
+
* included (it reaches the query when a request has no body), and for
|
|
134
|
+
* SigV4 those of a presigned URL, which a header-signed request never
|
|
135
|
+
* carries.
|
|
119
136
|
*/
|
|
120
137
|
export function injectedParams(auth, target) {
|
|
138
|
+
if (auth.kind === "awsSigV4")
|
|
139
|
+
return [...SIGV4_QUERY_PARAMETERS];
|
|
121
140
|
if (auth.kind !== "static")
|
|
122
141
|
return [];
|
|
123
142
|
return placementsFor(auth, target).flatMap((placement) => placement.in === "query" || placement.in === "body" ? [placement.name] : []);
|
|
@@ -29,6 +29,20 @@ export declare const OAuthGrantSchema: t.TObject<{
|
|
|
29
29
|
}>;
|
|
30
30
|
revision: t.TString;
|
|
31
31
|
}>;
|
|
32
|
+
/** Stored shape of an AWS access key; a session's carries its token. */
|
|
33
|
+
export declare const AwsAccessKeySchema: t.TObject<{
|
|
34
|
+
accessKeyId: t.TString;
|
|
35
|
+
secretAccessKey: t.TString;
|
|
36
|
+
sessionToken: t.TOptional<t.TString>;
|
|
37
|
+
}>;
|
|
38
|
+
/** Stored shape of an assumed role's session. */
|
|
39
|
+
export declare const AwsSessionSchema: t.TObject<{
|
|
40
|
+
accessKeyId: t.TString;
|
|
41
|
+
secretAccessKey: t.TString;
|
|
42
|
+
sessionToken: t.TString;
|
|
43
|
+
expiresAt: t.TInteger;
|
|
44
|
+
revision: t.TString;
|
|
45
|
+
}>;
|
|
32
46
|
/** No implicit defaults, provider inference, executable expressions, or replacement. */
|
|
33
47
|
export declare class CredentialRegistry {
|
|
34
48
|
private readonly types;
|