Lines 1-32javascript
1import { FaableApi } from './FaableApi.js';
2import { apikey_strategy } from './strategies/apikey.strategy.js';
3import { getIDToken } from '@actions/core';
4import { oidc_strategy } from './strategies/oidc.strategy.js';
5import { bearer_strategy } from './strategies/bearer.strategy.js';
6import { CredentialsStore } from '../lib/CredentialsStore.js';
7import { loadLiveCredentials } from './session.js';
8import { log } from '../log.js';
10const context = async (targetAppId) => {
12 // Auth resolution: FAABLE_TOKEN → OIDC (CI) → local `faable login` credentials.
13 if (process.env.FAABLE_TOKEN) {
14 // Token in environment
15 const token = process.env.FAABLE_TOKEN;
16 api = FaableApi.create({ authStrategy: bearer_strategy, auth: { token } });
18 else if (process.env.GITHUB_ACTIONS === "true") {
19 // Github actions environment
21 const idToken = process.env.FAABLE_ID_TOKEN || (await getIDToken("https://faable.com"));
22 // targetAppId disambiguates a monorepo (several apps, one repo) in the
HighSandbox Evasion Gated Capability
Source gates dangerous network, credential, or execution behavior behind CI, host, platform, time, or geo fingerprint checks.
dist/api/context.jsView on unpkg · L12 23 // OIDC exchange — from `faable deploy <app_id>`.
24 api = FaableApi.create({
25 authStrategy: oidc_strategy,
26 auth: { idToken, appId: targetAppId },
30 console.error("Error fetching token, configure 'permissions: id-token: write'");