Foundry
Palantir Foundry emulation with OAuth 2.0, current-user lookup, and compute-module runtime plus contour job routes.
OAuth and Current User Endpoints
GET /multipass/api/oauth2/authorize- authorization endpoint (shows user picker)POST /multipass/api/oauth2/authorize/callback- internal user-picker form callbackPOST /multipass/api/oauth2/token- token exchange (authorization code, refresh token, client credentials)GET /api/v2/admin/users/getCurrent- current user lookup
Authorization Code Flow
- Redirect the user to
/multipass/api/oauth2/authorizewithclient_id,redirect_uri,response_type=code,scope,state, and optional PKCE parameters - The emulator renders a seeded user picker
- On selection, the emulator redirects to
redirect_uriwithcodeandstate - Exchange the code at
POST /multipass/api/oauth2/token
PKCE and Refresh Tokens
PKCE supports S256. Include code_challenge and code_challenge_method on authorize, then send code_verifier to the token endpoint.
offline_access returns a refresh token. Refresh token exchange rotates the refresh token.
Client Credentials
grant_type=client_credentials returns an access token only. The emulator creates or reuses a service principal whose username matches client_id.
Current User
GET /api/v2/admin/users/getCurrent requires a bearer token with the api:admin-read scope.
Auth code and refresh flows return a seeded human principal. Client credentials returns the service principal.
Compute Module Endpoints
POST /_emulate/foundry/compute-modules/runtimes- create or reset a runtime session and return runtime URLs plusModule-Auth-TokenGET /_emulate/foundry/compute-modules/runtimes/:runtimeId/job- runtime poll route that returnscomputeModuleJobV1or204 No ContentPOST /_emulate/foundry/compute-modules/runtimes/:runtimeId/schemas- runtime schema uploadPOST /_emulate/foundry/compute-modules/runtimes/:runtimeId/results/:jobId- runtime result uploadPOST /contour-backend-multiplexer/api/module-group-multiplexer/compute-modules/jobs/execute- sync contour execute routePOST /contour-backend-multiplexer/api/module-group-multiplexer/deployed-apps/jobs- async contour submit routeGET /contour-backend-multiplexer/api/module-group-multiplexer/jobs/:jobId/status- async contour status routePUT /contour-backend-multiplexer/api/module-group-multiplexer/jobs/result/v2- async contour raw result fetch
Compute Module Flow
- Create a runtime session with
POST /_emulate/foundry/compute-modules/runtimes - Boot a real compute-module container with the returned URLs and
Module-Auth-Token - Submit sync or async contour jobs with bearer auth
- Read raw
application/octet-streamresults without delimiter rewriting
Compute Module Seed Config
foundry:
compute_modules:
deployed_apps:
- deployed_app_rid: ri.foundry.main.deployed-app.agent-loop
branch: master
runtime_id: agent-loop
display_name: Agent Loop
active: true
runtimes:
- runtime_id: agent-loop
module_auth_token: local-module-auth-token