zuplo 6.72.3 → 6.72.8
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/docs/analytics/access-and-entitlements.md +27 -34
- package/docs/analytics/overview.md +7 -6
- package/docs/analytics/reference/url-parameters.md +2 -10
- package/docs/analytics/shared-controls.md +3 -10
- package/docs/analytics/tabs/agents.md +3 -3
- package/docs/analytics/tabs/requests.md +2 -4
- package/docs/articles/connect-to-aws-alb-with-mtls.mdx +89 -13
- package/docs/articles/ddos-protection.mdx +2 -2
- package/docs/articles/graphql-security.mdx +2 -1
- package/docs/articles/graphql.mdx +8 -0
- package/docs/articles/limits.mdx +12 -0
- package/docs/articles/local-development-troubleshooting.mdx +12 -3
- package/docs/articles/opentelemetry.mdx +7 -5
- package/docs/articles/securing-backend-mtls.mdx +92 -3
- package/docs/articles/troubleshooting-slow-responses.mdx +4 -3
- package/docs/articles/troubleshooting.md +3 -1
- package/docs/articles/waf-ddos.mdx +1 -24
- package/docs/policies/_index.md +2 -0
- package/docs/policies/akamai-ai-firewall/schema.json +1 -0
- package/docs/policies/akamai-firewall-for-ai-inbound/schema.json +2 -0
- package/docs/policies/akamai-firewall-for-ai-outbound/schema.json +2 -0
- package/docs/policies/amberflo-metering-inbound/schema.json +5 -2
- package/docs/policies/api-key-inbound/schema.json +11 -5
- package/docs/policies/audit-log-inbound/schema.json +2 -0
- package/docs/policies/auth0-jwt-auth-inbound/schema.json +7 -5
- package/docs/policies/authzen-inbound/schema.json +7 -5
- package/docs/policies/axiomatics-authz-inbound/schema.json +14 -6
- package/docs/policies/basic-auth-inbound/schema.json +2 -1
- package/docs/policies/caching-inbound/schema.json +20 -16
- package/docs/policies/clerk-jwt-auth-inbound/schema.json +8 -6
- package/docs/policies/cognito-jwt-auth-inbound/schema.json +7 -5
- package/docs/policies/comet-opik-tracing-inbound/schema.json +1 -0
- package/docs/policies/complex-rate-limit-inbound/schema.json +4 -0
- package/docs/policies/curity-phantom-token-inbound/schema.json +1 -0
- package/docs/policies/data-loss-prevention-inbound/schema.json +15 -12
- package/docs/policies/data-loss-prevention-outbound/schema.json +15 -12
- package/docs/policies/firebase-jwt-inbound/schema.json +7 -5
- package/docs/policies/formdata-to-json-inbound/schema.json +1 -0
- package/docs/policies/galileo-tracing-inbound/schema.json +1 -0
- package/docs/policies/geo-filter-inbound/schema.json +1 -0
- package/docs/policies/graphql-analytics-outbound/schema.json +1 -0
- package/docs/policies/mcp-auth0-oauth-inbound/schema.json +11 -5
- package/docs/policies/mcp-clerk-oauth-inbound/schema.json +81 -0
- package/docs/policies/mcp-cognito-oauth-inbound/schema.json +81 -0
- package/docs/policies/mcp-entra-oauth-inbound/schema.json +81 -0
- package/docs/policies/mcp-google-oauth-inbound/schema.json +81 -0
- package/docs/policies/mcp-keycloak-oauth-inbound/schema.json +81 -0
- package/docs/policies/mcp-logto-oauth-inbound/schema.json +81 -0
- package/docs/policies/mcp-oauth-inbound/schema.json +10 -5
- package/docs/policies/mcp-okta-oauth-inbound/schema.json +81 -0
- package/docs/policies/mcp-onelogin-oauth-inbound/schema.json +81 -0
- package/docs/policies/mcp-ping-oauth-inbound/schema.json +81 -0
- package/docs/policies/mcp-token-exchange-inbound/doc.md +72 -4
- package/docs/policies/mcp-token-exchange-inbound/intro.md +5 -4
- package/docs/policies/mcp-token-exchange-inbound/schema.json +287 -7
- package/docs/policies/mcp-workos-oauth-inbound/schema.json +81 -0
- package/docs/policies/monetization-inbound/schema.json +25 -23
- package/docs/policies/mtls-auth-inbound/schema.json +6 -5
- package/docs/policies/okta-fga-authz-inbound/schema.json +7 -6
- package/docs/policies/okta-jwt-auth-inbound/schema.json +7 -5
- package/docs/policies/open-id-jwt-auth-inbound/schema.json +14 -9
- package/docs/policies/openfga-authz-inbound/schema.json +7 -6
- package/docs/policies/openmeter-inbound/schema.json +23 -19
- package/docs/policies/prompt-injection-outbound/schema.json +6 -5
- package/docs/policies/propel-auth-jwt-inbound/schema.json +10 -8
- package/docs/policies/query-param-to-header-inbound/schema.json +1 -0
- package/docs/policies/quota-inbound/schema.json +9 -6
- package/docs/policies/rate-limit-inbound/schema.json +4 -0
- package/docs/policies/readme-metrics-inbound/schema.json +9 -5
- package/docs/policies/request-size-limit-inbound/schema.json +1 -0
- package/docs/policies/request-validation-inbound/schema.json +8 -6
- package/docs/policies/require-origin-inbound/schema.json +1 -0
- package/docs/policies/semantic-cache-inbound/schema.json +9 -5
- package/docs/policies/set-status-outbound/schema.json +1 -0
- package/docs/policies/set-upstream-api-key-inbound/schema.json +7 -5
- package/docs/policies/stripe-webhook-verification-inbound/schema.json +2 -1
- package/docs/policies/supabase-jwt-auth-inbound/schema.json +7 -5
- package/docs/policies/traffic-splitting-inbound/schema.json +1 -0
- package/docs/policies/upstream-aws-federated-auth-inbound/doc.md +78 -0
- package/docs/policies/upstream-aws-federated-auth-inbound/intro.md +20 -0
- package/docs/policies/upstream-aws-federated-auth-inbound/schema.json +104 -0
- package/docs/policies/upstream-aws-service-auth-inbound/doc.md +89 -0
- package/docs/policies/upstream-aws-service-auth-inbound/intro.md +19 -0
- package/docs/policies/upstream-aws-service-auth-inbound/schema.json +121 -0
- package/docs/policies/upstream-azure-ad-service-auth-inbound/schema.json +7 -5
- package/docs/policies/upstream-firebase-admin-auth-inbound/schema.json +2 -0
- package/docs/policies/upstream-firebase-user-auth-inbound/schema.json +8 -5
- package/docs/policies/upstream-gcp-federated-auth-inbound/doc.md +2 -2
- package/docs/policies/upstream-gcp-federated-auth-inbound/schema.json +8 -4
- package/docs/policies/upstream-gcp-service-auth-inbound/doc.md +3 -3
- package/docs/policies/upstream-gcp-service-auth-inbound/schema.json +8 -3
- package/docs/policies/upstream-zuplo-jwt-auth-inbound/schema.json +39 -15
- package/docs/policies/web-bot-auth-inbound/schema.json +2 -0
- package/docs/policies/xml-to-json-outbound/schema.json +9 -5
- package/package.json +4 -4
- package/docs/articles/zuplo-waf.mdx +0 -156
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Authenticate to AWS upstreams with **no stored AWS keys** using Workload
|
|
2
|
+
Identity Federation. This policy exchanges Zuplo's ambient OIDC identity for an
|
|
3
|
+
IAM role's short-lived temporary credentials via STS AssumeRoleWithWebIdentity,
|
|
4
|
+
and makes them available to the AWS Lambda handler and to custom code, which
|
|
5
|
+
sign upstream requests with AWS Signature Version 4.
|
|
6
|
+
|
|
7
|
+
With this policy, you'll benefit from:
|
|
8
|
+
|
|
9
|
+
- **No Long-Lived Secrets**: No AWS access keys are stored anywhere — the
|
|
10
|
+
gateway proves its identity with a short-lived, audience-bound OIDC token
|
|
11
|
+
- **Least Privilege**: Assume a specific IAM role whose trust policy trusts only
|
|
12
|
+
the Zuplo OIDC identity provider
|
|
13
|
+
- **Automatic Token Management**: Temporary credentials are cached in memory and
|
|
14
|
+
refreshed before they expire
|
|
15
|
+
- **Reusable Credentials**: Resolve credentials once and use them from the AWS
|
|
16
|
+
Lambda handler or your own code via `AwsClient.fromContext(context)`
|
|
17
|
+
|
|
18
|
+
To set this up you configure an IAM OIDC identity provider that trusts Zuplo's
|
|
19
|
+
issuer, and an IAM role whose trust policy permits AssumeRoleWithWebIdentity for
|
|
20
|
+
that provider.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "https://cdn.zuplo.com/policies/runtime/schemas/upstream-aws-federated-auth-inbound.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"title": "Upstream AWS Federated Auth",
|
|
6
|
+
"isDeprecated": false,
|
|
7
|
+
"isPaidAddOn": false,
|
|
8
|
+
"isEnterprise": true,
|
|
9
|
+
"isInternal": false,
|
|
10
|
+
"isBeta": true,
|
|
11
|
+
"isHidden": false,
|
|
12
|
+
"requiresAI": false,
|
|
13
|
+
"products": ["api-gateway"],
|
|
14
|
+
"description": "Resolves AWS credentials with STS AssumeRoleWithWebIdentity using Zuplo's ambient OIDC identity — no AWS keys are stored anywhere. The role's trust policy must trust the Zuplo OIDC identity provider. Resolved credentials are registered on the request context for the AWS Lambda handler and custom code to sign upstream requests with `AwsClient.fromContext`. This policy does not itself sign or forward the request.",
|
|
15
|
+
"deprecatedMessage": "",
|
|
16
|
+
"required": ["handler"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"handler": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"default": {},
|
|
21
|
+
"required": ["export", "module", "options"],
|
|
22
|
+
"properties": {
|
|
23
|
+
"export": {
|
|
24
|
+
"const": "UpstreamAwsFederatedAuthInboundPolicy",
|
|
25
|
+
"description": "The name of the exported type"
|
|
26
|
+
},
|
|
27
|
+
"module": {
|
|
28
|
+
"const": "$import(@zuplo/runtime)",
|
|
29
|
+
"description": "The module containing the policy"
|
|
30
|
+
},
|
|
31
|
+
"options": {
|
|
32
|
+
"title": "UpstreamAwsFederatedAuthInboundPolicyOptions",
|
|
33
|
+
"type": "object",
|
|
34
|
+
"description": "The options for this policy.",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": ["roleArn", "region"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"roleArn": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"examples": ["arn:aws:iam::123456789012:role/zuplo-gateway"],
|
|
41
|
+
"description": "The IAM role to assume with STS AssumeRoleWithWebIdentity. The role's trust policy must trust the Zuplo OIDC identity provider."
|
|
42
|
+
},
|
|
43
|
+
"region": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"examples": ["us-east-1"],
|
|
46
|
+
"description": "The AWS region used for the STS endpoint and as the default signing region for consumers of the resolved credentials."
|
|
47
|
+
},
|
|
48
|
+
"audience": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"default": "sts.amazonaws.com",
|
|
51
|
+
"x-show-example": false,
|
|
52
|
+
"x-advanced": true,
|
|
53
|
+
"description": "The audience ('aud' claim) of the Zuplo-issued OIDC token. Must match a client ID configured on the IAM OIDC identity provider."
|
|
54
|
+
},
|
|
55
|
+
"roleSessionName": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"default": "zuplo-gateway",
|
|
58
|
+
"x-show-example": false,
|
|
59
|
+
"x-advanced": true,
|
|
60
|
+
"description": "The STS role session name recorded in AWS CloudTrail. Must match the pattern \\[\\\\w+=,.@-\\]{2,64}."
|
|
61
|
+
},
|
|
62
|
+
"durationSeconds": {
|
|
63
|
+
"type": "number",
|
|
64
|
+
"default": 3600,
|
|
65
|
+
"x-show-example": false,
|
|
66
|
+
"x-advanced": true,
|
|
67
|
+
"description": "The lifetime in seconds of the temporary credentials requested from STS (900-43200). The assumed role's maximum session duration may further limit this value."
|
|
68
|
+
},
|
|
69
|
+
"stsEndpoint": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"x-show-example": false,
|
|
72
|
+
"x-advanced": true,
|
|
73
|
+
"description": "Overrides the STS endpoint URL. Only needed for non-standard partitions such as AWS GovCloud or AWS China."
|
|
74
|
+
},
|
|
75
|
+
"tokenRetries": {
|
|
76
|
+
"type": "number",
|
|
77
|
+
"default": 3,
|
|
78
|
+
"x-show-example": false,
|
|
79
|
+
"x-advanced": true,
|
|
80
|
+
"description": "The number of times to retry fetching temporary credentials in the event of a failure."
|
|
81
|
+
},
|
|
82
|
+
"expirationOffsetSeconds": {
|
|
83
|
+
"type": "number",
|
|
84
|
+
"default": 300,
|
|
85
|
+
"x-show-example": false,
|
|
86
|
+
"x-advanced": true,
|
|
87
|
+
"description": "The number of seconds before credential expiration at which cached credentials are discarded and refreshed."
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"examples": [
|
|
93
|
+
{
|
|
94
|
+
"export": "UpstreamAwsFederatedAuthInboundPolicy",
|
|
95
|
+
"module": "$import(@zuplo/runtime)",
|
|
96
|
+
"options": {
|
|
97
|
+
"region": "us-east-1",
|
|
98
|
+
"roleArn": "arn:aws:iam::123456789012:role/zuplo-gateway"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
## Overview
|
|
2
|
+
|
|
3
|
+
The Upstream AWS Service Auth policy resolves AWS credentials and registers them
|
|
4
|
+
on the request context. Unlike the other upstream auth policies, it does **not**
|
|
5
|
+
add an `Authorization` header itself — AWS Signature Version 4 signs the exact
|
|
6
|
+
final request (method, host, path, query and body hash), which is only known
|
|
7
|
+
inside the handler. Instead, the AWS Lambda handler and your own code read the
|
|
8
|
+
resolved credentials and sign the requests they build.
|
|
9
|
+
|
|
10
|
+
There are two modes:
|
|
11
|
+
|
|
12
|
+
- **Static credentials** — the configured `accessKeyId` / `secretAccessKey`
|
|
13
|
+
(and optional `sessionToken`) are used directly.
|
|
14
|
+
- **Assumed role** — when `roleArn` is set, the policy calls STS `AssumeRole`
|
|
15
|
+
(signed with the configured keys) and uses the role's short-lived temporary
|
|
16
|
+
credentials. These are cached in memory and refreshed before they expire.
|
|
17
|
+
|
|
18
|
+
## Using the credentials
|
|
19
|
+
|
|
20
|
+
### With the AWS Lambda handler
|
|
21
|
+
|
|
22
|
+
Attach this policy to a route whose handler is `awsLambdaHandler`, and omit the
|
|
23
|
+
handler's own `accessKeyId` / `secretAccessKey`. The handler will use the
|
|
24
|
+
credentials resolved by the policy.
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"paths": {
|
|
29
|
+
"/lambda/{path}*": {
|
|
30
|
+
"x-zuplo-route": {
|
|
31
|
+
"handler": {
|
|
32
|
+
"export": "awsLambdaHandler",
|
|
33
|
+
"module": "$import(@zuplo/runtime)",
|
|
34
|
+
"options": {
|
|
35
|
+
"region": "us-east-1",
|
|
36
|
+
"functionName": "my-function"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"policies": { "inbound": ["upstream-aws-service-auth"] }
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### With custom code (for example, API Gateway with IAM auth, or S3)
|
|
47
|
+
|
|
48
|
+
Attach the policy, then sign outbound requests with `AwsClient.fromContext`:
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
import { AwsClient } from "@zuplo/runtime/aws";
|
|
52
|
+
import { ZuploContext, ZuploRequest } from "@zuplo/runtime";
|
|
53
|
+
|
|
54
|
+
export default async function (request: ZuploRequest, context: ZuploContext) {
|
|
55
|
+
const aws = AwsClient.fromContext(context, {
|
|
56
|
+
service: "execute-api",
|
|
57
|
+
region: "us-east-1",
|
|
58
|
+
});
|
|
59
|
+
return aws.fetch(
|
|
60
|
+
"https://abc123.execute-api.us-east-1.amazonaws.com/prod/orders"
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
If a route does not attach the policy, you can run it on demand from custom code
|
|
66
|
+
with `await context.invokeInboundPolicy("upstream-aws-service-auth", request)`
|
|
67
|
+
before calling `AwsClient.fromContext`.
|
|
68
|
+
|
|
69
|
+
## Configuration
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"name": "upstream-aws-service-auth",
|
|
74
|
+
"policyType": "upstream-aws-service-auth",
|
|
75
|
+
"handler": {
|
|
76
|
+
"export": "UpstreamAwsServiceAuthInboundPolicy",
|
|
77
|
+
"module": "$import(@zuplo/runtime)",
|
|
78
|
+
"options": {
|
|
79
|
+
"accessKeyId": "$env(AWS_ACCESS_KEY_ID)",
|
|
80
|
+
"secretAccessKey": "$env(AWS_SECRET_ACCESS_KEY)",
|
|
81
|
+
"region": "us-east-1",
|
|
82
|
+
"roleArn": "arn:aws:iam::123456789012:role/my-gateway-role"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Store `accessKeyId` and `secretAccessKey` in environment variables using
|
|
89
|
+
`$env(...)` — never commit them to source.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Authenticate to AWS upstreams using an IAM access key pair, optionally exchanged
|
|
2
|
+
for an IAM role's temporary credentials via STS AssumeRole. This policy resolves
|
|
3
|
+
AWS credentials and makes them available to the AWS Lambda handler and to custom
|
|
4
|
+
code, which sign upstream requests with AWS Signature Version 4.
|
|
5
|
+
|
|
6
|
+
With this policy, you'll benefit from:
|
|
7
|
+
|
|
8
|
+
- **Reusable Credentials**: Resolve AWS credentials once and use them from the
|
|
9
|
+
AWS Lambda handler or your own code via `AwsClient.fromContext(context)`
|
|
10
|
+
- **Role Assumption**: Optionally assume an IAM role (STS AssumeRole) to obtain
|
|
11
|
+
short-lived, least-privilege temporary credentials
|
|
12
|
+
- **Automatic Token Management**: Temporary credentials are cached in memory and
|
|
13
|
+
refreshed before they expire
|
|
14
|
+
- **Credential Security**: Store access keys securely in your Zuplo environment
|
|
15
|
+
and keep them out of source control
|
|
16
|
+
|
|
17
|
+
To avoid storing any long-lived AWS keys at all, use the
|
|
18
|
+
`upstream-aws-federated-auth` policy instead, which uses Workload Identity
|
|
19
|
+
Federation.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "https://cdn.zuplo.com/policies/runtime/schemas/upstream-aws-service-auth-inbound.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"title": "Upstream AWS Service Auth",
|
|
6
|
+
"isDeprecated": false,
|
|
7
|
+
"isPaidAddOn": false,
|
|
8
|
+
"isEnterprise": true,
|
|
9
|
+
"isInternal": false,
|
|
10
|
+
"isBeta": true,
|
|
11
|
+
"isHidden": false,
|
|
12
|
+
"requiresAI": false,
|
|
13
|
+
"products": ["api-gateway"],
|
|
14
|
+
"description": "Resolves AWS credentials from static access keys (optionally exchanged for an IAM role's temporary credentials via STS AssumeRole) and registers them on the request context. The AWS Lambda handler and custom code read them with `AwsClient.fromContext` to sign upstream requests. This policy does not itself sign or forward the request.",
|
|
15
|
+
"deprecatedMessage": "",
|
|
16
|
+
"required": ["handler"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"handler": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"default": {},
|
|
21
|
+
"required": ["export", "module", "options"],
|
|
22
|
+
"properties": {
|
|
23
|
+
"export": {
|
|
24
|
+
"const": "UpstreamAwsServiceAuthInboundPolicy",
|
|
25
|
+
"description": "The name of the exported type"
|
|
26
|
+
},
|
|
27
|
+
"module": {
|
|
28
|
+
"const": "$import(@zuplo/runtime)",
|
|
29
|
+
"description": "The module containing the policy"
|
|
30
|
+
},
|
|
31
|
+
"options": {
|
|
32
|
+
"title": "UpstreamAwsServiceAuthInboundPolicyOptions",
|
|
33
|
+
"type": "object",
|
|
34
|
+
"description": "The options for this policy.",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": ["accessKeyId", "secretAccessKey", "region"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"accessKeyId": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"examples": ["$env(AWS_ACCESS_KEY_ID)"],
|
|
41
|
+
"description": "The AWS access key ID. Store the value in an environment variable rather than in source."
|
|
42
|
+
},
|
|
43
|
+
"secretAccessKey": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"examples": ["$env(AWS_SECRET_ACCESS_KEY)"],
|
|
46
|
+
"description": "The AWS secret access key. Always store this in an environment variable."
|
|
47
|
+
},
|
|
48
|
+
"region": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"examples": ["us-east-1"],
|
|
51
|
+
"description": "The AWS region. Used for the STS endpoint when 'roleArn' is set, and as the default signing region for consumers of the resolved credentials."
|
|
52
|
+
},
|
|
53
|
+
"sessionToken": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"x-show-example": false,
|
|
56
|
+
"x-advanced": true,
|
|
57
|
+
"description": "The AWS session token, required only when the configured access key pair is itself a temporary credential."
|
|
58
|
+
},
|
|
59
|
+
"roleArn": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"x-show-example": false,
|
|
62
|
+
"x-advanced": true,
|
|
63
|
+
"description": "An IAM role to assume using STS AssumeRole with the configured access keys. When set, the resolved credentials are the role's temporary credentials instead of the static keys."
|
|
64
|
+
},
|
|
65
|
+
"externalId": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"x-show-example": false,
|
|
68
|
+
"x-advanced": true,
|
|
69
|
+
"description": "The external ID to pass to STS AssumeRole when the role's trust policy requires one."
|
|
70
|
+
},
|
|
71
|
+
"roleSessionName": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"default": "zuplo-gateway",
|
|
74
|
+
"x-show-example": false,
|
|
75
|
+
"x-advanced": true,
|
|
76
|
+
"description": "The STS role session name recorded in AWS CloudTrail. Must match the pattern \\[\\\\w+=,.@-\\]{2,64}."
|
|
77
|
+
},
|
|
78
|
+
"durationSeconds": {
|
|
79
|
+
"type": "number",
|
|
80
|
+
"default": 3600,
|
|
81
|
+
"x-show-example": false,
|
|
82
|
+
"x-advanced": true,
|
|
83
|
+
"description": "The lifetime in seconds of the temporary credentials requested from STS (900-43200). The assumed role's maximum session duration may further limit this value."
|
|
84
|
+
},
|
|
85
|
+
"stsEndpoint": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"x-show-example": false,
|
|
88
|
+
"x-advanced": true,
|
|
89
|
+
"description": "Overrides the STS endpoint URL. Only needed for non-standard partitions such as AWS GovCloud or AWS China."
|
|
90
|
+
},
|
|
91
|
+
"tokenRetries": {
|
|
92
|
+
"type": "number",
|
|
93
|
+
"default": 3,
|
|
94
|
+
"x-show-example": false,
|
|
95
|
+
"x-advanced": true,
|
|
96
|
+
"description": "The number of times to retry fetching temporary credentials in the event of a failure."
|
|
97
|
+
},
|
|
98
|
+
"expirationOffsetSeconds": {
|
|
99
|
+
"type": "number",
|
|
100
|
+
"default": 300,
|
|
101
|
+
"x-show-example": false,
|
|
102
|
+
"x-advanced": true,
|
|
103
|
+
"description": "The number of seconds before credential expiration at which cached credentials are discarded and refreshed."
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"examples": [
|
|
109
|
+
{
|
|
110
|
+
"export": "UpstreamAwsServiceAuthInboundPolicy",
|
|
111
|
+
"module": "$import(@zuplo/runtime)",
|
|
112
|
+
"options": {
|
|
113
|
+
"accessKeyId": "$env(AWS_ACCESS_KEY_ID)",
|
|
114
|
+
"region": "us-east-1",
|
|
115
|
+
"secretAccessKey": "$env(AWS_SECRET_ACCESS_KEY)"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"properties": {
|
|
42
42
|
"activeDirectoryTenantId": {
|
|
43
43
|
"type": "string",
|
|
44
|
-
"examples": ["
|
|
44
|
+
"examples": ["11111111-1111-1111-1111-111111111111"],
|
|
45
45
|
"description": "Azure Active Directory Tenant ID."
|
|
46
46
|
},
|
|
47
47
|
"activeDirectoryClientId": {
|
|
48
48
|
"type": "string",
|
|
49
|
-
"examples": ["
|
|
49
|
+
"examples": ["22222222-2222-2222-2222-222222222222"],
|
|
50
50
|
"description": "The Application (client) ID of the Azure AD App Registration."
|
|
51
51
|
},
|
|
52
52
|
"activeDirectoryClientSecret": {
|
|
@@ -57,11 +57,13 @@
|
|
|
57
57
|
"tokenRetries": {
|
|
58
58
|
"type": "number",
|
|
59
59
|
"default": 3,
|
|
60
|
-
"
|
|
60
|
+
"x-advanced": true,
|
|
61
|
+
"description": "The number of times to retry fetching the token in the event of a failure."
|
|
61
62
|
},
|
|
62
63
|
"expirationOffsetSeconds": {
|
|
63
64
|
"type": "number",
|
|
64
65
|
"default": 300,
|
|
66
|
+
"x-advanced": true,
|
|
65
67
|
"description": "The number of seconds less than the token expiration to cache the token."
|
|
66
68
|
}
|
|
67
69
|
}
|
|
@@ -72,9 +74,9 @@
|
|
|
72
74
|
"export": "UpstreamAzureAdServiceAuthInboundPolicy",
|
|
73
75
|
"module": "$import(@zuplo/runtime)",
|
|
74
76
|
"options": {
|
|
75
|
-
"activeDirectoryClientId": "
|
|
77
|
+
"activeDirectoryClientId": "22222222-2222-2222-2222-222222222222",
|
|
76
78
|
"activeDirectoryClientSecret": "$env(ACTIVE_DIRECTORY_CLIENT_SECRET)",
|
|
77
|
-
"activeDirectoryTenantId": "
|
|
79
|
+
"activeDirectoryTenantId": "11111111-1111-1111-1111-111111111111",
|
|
78
80
|
"expirationOffsetSeconds": 300,
|
|
79
81
|
"tokenRetries": 3
|
|
80
82
|
}
|
|
@@ -43,11 +43,13 @@
|
|
|
43
43
|
"tokenRetries": {
|
|
44
44
|
"type": "number",
|
|
45
45
|
"default": 3,
|
|
46
|
+
"x-advanced": true,
|
|
46
47
|
"description": "The number of times to retry fetching the token in the event of a failure."
|
|
47
48
|
},
|
|
48
49
|
"expirationOffsetSeconds": {
|
|
49
50
|
"type": "number",
|
|
50
51
|
"default": 300,
|
|
52
|
+
"x-advanced": true,
|
|
51
53
|
"description": "The number of seconds less than the token expiration to cache the token."
|
|
52
54
|
}
|
|
53
55
|
}
|
|
@@ -49,6 +49,11 @@
|
|
|
49
49
|
"type": "string",
|
|
50
50
|
"description": "The property on the incoming request.user object to retrieve the value of the userId."
|
|
51
51
|
},
|
|
52
|
+
"webApiKey": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"examples": ["$env(WEB_API_KEY)"],
|
|
55
|
+
"description": "The Firebase Web API Key (found in project settings)"
|
|
56
|
+
},
|
|
52
57
|
"developerClaims": {
|
|
53
58
|
"type": "object",
|
|
54
59
|
"tsType": "Record<string, string | number | boolean | null>",
|
|
@@ -73,21 +78,19 @@
|
|
|
73
78
|
"premium": true
|
|
74
79
|
}
|
|
75
80
|
],
|
|
81
|
+
"x-advanced": true,
|
|
76
82
|
"description": "Additional claims to include in the custom token's payload."
|
|
77
83
|
},
|
|
78
|
-
"webApiKey": {
|
|
79
|
-
"type": "string",
|
|
80
|
-
"examples": ["$env(WEB_API_KEY)"],
|
|
81
|
-
"description": "The Firebase Web API Key (found in project settings)"
|
|
82
|
-
},
|
|
83
84
|
"tokenRetries": {
|
|
84
85
|
"type": "number",
|
|
85
86
|
"default": 3,
|
|
87
|
+
"x-advanced": true,
|
|
86
88
|
"description": "The number of times to retry fetching the token in the event of a failure."
|
|
87
89
|
},
|
|
88
90
|
"expirationOffsetSeconds": {
|
|
89
91
|
"type": "number",
|
|
90
92
|
"default": 300,
|
|
93
|
+
"x-advanced": true,
|
|
91
94
|
"description": "The number of seconds less than the token expiration to cache the token."
|
|
92
95
|
}
|
|
93
96
|
}
|
|
@@ -130,9 +130,9 @@ With GCP Workload Federation setup, you can add the policy to your Zuplo API.
|
|
|
130
130
|
"module": "$import(@zuplo/runtime)",
|
|
131
131
|
"export": "UpstreamGcpFederatedAuthInboundPolicy",
|
|
132
132
|
"options": {
|
|
133
|
-
"audience": "https://
|
|
133
|
+
"audience": "https://my-backend-api-a1b2c3d4e5-uc.a.run.app",
|
|
134
134
|
"serviceAccountEmail": "zup-api@my-project.iam.gserviceaccount.com",
|
|
135
|
-
"workloadIdentityProvider": "projects/
|
|
135
|
+
"workloadIdentityProvider": "projects/1234567890/locations/global/workloadIdentityPools/my-pool/providers/my-provider"
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
}
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"properties": {
|
|
42
42
|
"audience": {
|
|
43
43
|
"type": "string",
|
|
44
|
-
"examples": ["https://
|
|
44
|
+
"examples": ["https://my-backend-api-a1b2c3d4e5-uc.a.run.app"],
|
|
45
45
|
"description": "The audience for the minted JWT. This is typically the URL of your service. See the document [AuthRequirement](https://cloud.google.com/endpoints/docs/grpc-service-config/reference/rpc/google.api#google.api.AuthRequirement) for details."
|
|
46
46
|
},
|
|
47
47
|
"serviceAccountEmail": {
|
|
@@ -52,30 +52,34 @@
|
|
|
52
52
|
"workloadIdentityProvider": {
|
|
53
53
|
"type": "string",
|
|
54
54
|
"examples": [
|
|
55
|
-
"projects/
|
|
55
|
+
"projects/1234567890/locations/global/workloadIdentityPools/my-pool/providers/my-provider"
|
|
56
56
|
]
|
|
57
57
|
},
|
|
58
58
|
"tokenLifetime": {
|
|
59
59
|
"type": "number",
|
|
60
60
|
"x-show-example": false,
|
|
61
61
|
"default": 3600,
|
|
62
|
+
"x-advanced": true,
|
|
62
63
|
"description": "The lifetime in seconds of the issued token."
|
|
63
64
|
},
|
|
64
65
|
"tokenRetries": {
|
|
65
66
|
"type": "number",
|
|
66
67
|
"x-show-example": false,
|
|
67
68
|
"default": 3,
|
|
69
|
+
"x-advanced": true,
|
|
68
70
|
"description": "The number of times to retry fetching the token in the event of a failure."
|
|
69
71
|
},
|
|
70
72
|
"expirationOffsetSeconds": {
|
|
71
73
|
"type": "number",
|
|
72
74
|
"x-show-example": false,
|
|
73
75
|
"default": 300,
|
|
76
|
+
"x-advanced": true,
|
|
74
77
|
"description": "The number of seconds less than the token expiration to cache the token."
|
|
75
78
|
},
|
|
76
79
|
"useMemoryCacheOnly": {
|
|
77
80
|
"type": "boolean",
|
|
78
81
|
"x-show-example": false,
|
|
82
|
+
"x-advanced": true,
|
|
79
83
|
"description": "This is an advanced option that should only be used if you do not want to persist information in ZoneCache."
|
|
80
84
|
}
|
|
81
85
|
}
|
|
@@ -86,9 +90,9 @@
|
|
|
86
90
|
"export": "UpstreamGcpFederatedAuthInboundPolicy",
|
|
87
91
|
"module": "$import(@zuplo/runtime)",
|
|
88
92
|
"options": {
|
|
89
|
-
"audience": "https://
|
|
93
|
+
"audience": "https://my-backend-api-a1b2c3d4e5-uc.a.run.app",
|
|
90
94
|
"serviceAccountEmail": "zup-api@my-project.iam.gserviceaccount.com",
|
|
91
|
-
"workloadIdentityProvider": "projects/
|
|
95
|
+
"workloadIdentityProvider": "projects/1234567890/locations/global/workloadIdentityPools/my-pool/providers/my-provider"
|
|
92
96
|
}
|
|
93
97
|
}
|
|
94
98
|
]
|
|
@@ -50,7 +50,7 @@ protected by Identity Aware Proxy (IAP), use the `audience` property:
|
|
|
50
50
|
"export": "UpstreamGcpServiceAuthInboundPolicy",
|
|
51
51
|
"module": "$import(@zuplo/runtime)",
|
|
52
52
|
"options": {
|
|
53
|
-
"audience": "https://my-
|
|
53
|
+
"audience": "https://my-backend-api-a1b2c3d4e5-uc.a.run.app",
|
|
54
54
|
"serviceAccountJson": "$env(GCP_SERVICE_ACCOUNT)"
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -59,7 +59,7 @@ protected by Identity Aware Proxy (IAP), use the `audience` property:
|
|
|
59
59
|
**Audience Values:**
|
|
60
60
|
|
|
61
61
|
- For **Cloud Run**: Use the full URL of your Cloud Run service (e.g.,
|
|
62
|
-
`https://my-
|
|
62
|
+
`https://my-backend-api-a1b2c3d4e5-uc.a.run.app`)
|
|
63
63
|
- For **Identity Aware Proxy**: Use the Client ID of your OAuth application
|
|
64
64
|
- For **Cloud Functions**: Use the full URL of your function
|
|
65
65
|
|
|
@@ -109,7 +109,7 @@ Apply the policy to routes that need to access your Cloud Run service:
|
|
|
109
109
|
"export": "forwardToOrigin",
|
|
110
110
|
"module": "$import(@zuplo/runtime)",
|
|
111
111
|
"options": {
|
|
112
|
-
"baseUrl": "https://my-
|
|
112
|
+
"baseUrl": "https://my-backend-api-a1b2c3d4e5-uc.a.run.app"
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"properties": {
|
|
38
38
|
"audience": {
|
|
39
39
|
"type": "string",
|
|
40
|
-
"examples": ["https://my-
|
|
41
|
-
"description": "The audience for the service to be called. This is typically the URL of your service endpoint like 'https://my-
|
|
40
|
+
"examples": ["https://my-backend-api-a1b2c3d4e5-uc.a.run.app"],
|
|
41
|
+
"description": "The audience for the service to be called. This is typically the URL of your service endpoint like 'https://my-backend-api-a1b2c3d4e5-uc.a.run.app'. If calling a Google API, leave this empty."
|
|
42
42
|
},
|
|
43
43
|
"scopes": {
|
|
44
44
|
"type": "array",
|
|
@@ -57,17 +57,20 @@
|
|
|
57
57
|
"type": "number",
|
|
58
58
|
"x-show-example": false,
|
|
59
59
|
"default": 3,
|
|
60
|
+
"x-advanced": true,
|
|
60
61
|
"description": "The number of times to retry fetching the token in the event of a failure."
|
|
61
62
|
},
|
|
62
63
|
"expirationOffsetSeconds": {
|
|
63
64
|
"type": "number",
|
|
64
65
|
"x-show-example": false,
|
|
65
66
|
"default": 300,
|
|
67
|
+
"x-advanced": true,
|
|
66
68
|
"description": "The number of seconds less than the token expiration to cache the token."
|
|
67
69
|
},
|
|
68
70
|
"useMemoryCacheOnly": {
|
|
69
71
|
"type": "boolean",
|
|
70
72
|
"x-show-example": false,
|
|
73
|
+
"x-advanced": true,
|
|
71
74
|
"description": "This is an advanced option that should only be used if you do not want to persist information in ZoneCache."
|
|
72
75
|
},
|
|
73
76
|
"version": {
|
|
@@ -75,12 +78,14 @@
|
|
|
75
78
|
"default": 1,
|
|
76
79
|
"enum": [1, 2],
|
|
77
80
|
"x-show-example": false,
|
|
81
|
+
"x-advanced": true,
|
|
78
82
|
"description": "The version of the policy."
|
|
79
83
|
},
|
|
80
84
|
"enableSuspiciousHeaderWarning": {
|
|
81
85
|
"type": "boolean",
|
|
82
86
|
"default": true,
|
|
83
87
|
"x-show-example": false,
|
|
88
|
+
"x-advanced": true,
|
|
84
89
|
"description": "When `true` (the default), emits a warning if the inbound request carries headers like `X-Serverless-Authorization` or `X-Goog-IAP-JWT-Assertion`. Forwarding those to a downstream Cloud Run typically causes a `the access token could not be verified` 401 because Cloud Run prefers `X-Serverless-Authorization` over `Authorization` for IAM checks. Set this to `false` only if you have intentionally chosen to forward those headers (e.g. the upstream service is also IAP-fronted and expects them) — the warning is otherwise a useful diagnostic signal."
|
|
85
90
|
}
|
|
86
91
|
}
|
|
@@ -91,7 +96,7 @@
|
|
|
91
96
|
"export": "UpstreamGcpServiceAuthInboundPolicy",
|
|
92
97
|
"module": "$import(@zuplo/runtime)",
|
|
93
98
|
"options": {
|
|
94
|
-
"audience": "https://my-
|
|
99
|
+
"audience": "https://my-backend-api-a1b2c3d4e5-uc.a.run.app",
|
|
95
100
|
"scopes": ["https://www.googleapis.com/auth/cloud-platform"],
|
|
96
101
|
"serviceAccountJson": "$env(SERVICE_ACCOUNT_JSON)"
|
|
97
102
|
}
|