zuplo 7.8.7 → 7.8.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/ai-gateway/custom-policies.mdx +2 -1
- package/docs/ai-gateway/usage-limits.mdx +2 -2
- package/docs/api-management/overview.md +2 -2
- package/docs/articles/add-api-to-backstage.mdx +4 -3
- package/docs/articles/api-key-consumer-bucket-portal-ui.mdx +1 -1
- package/docs/articles/api-key-management.mdx +1 -1
- package/docs/articles/migrate-from-apigee.md +3 -3
- package/docs/articles/migrate-from-aws-api-gateway.md +3 -3
- package/docs/articles/migrate-from-azure-apim.md +3 -3
- package/docs/articles/migrate-from-kong.md +3 -3
- package/docs/articles/source-control-setup-github.mdx +2 -2
- package/docs/cli/create-zuplo-api.mdx +4 -4
- package/docs/cli/openapi-merge.mdx +1 -1
- package/docs/cli/openapi-merge.partial.mdx +1 -1
- package/docs/concepts/ai-gateway.mdx +1 -1
- package/docs/concepts/mcp.mdx +4 -4
- package/docs/dedicated/architecture.mdx +1 -1
- package/docs/errors/not-found.mdx +1 -1
- package/docs/getting-started/ai-gateway/portal.mdx +181 -0
- package/docs/getting-started/dev-portal/agent.mdx +148 -0
- package/docs/getting-started/dev-portal/index.mdx +26 -0
- package/docs/getting-started/dev-portal/local.mdx +213 -0
- package/docs/getting-started/dev-portal/portal.mdx +146 -0
- package/docs/{articles/step-3-add-api-key-auth.mdx → getting-started/gateway/add-api-key-auth/index.mdx} +30 -24
- package/docs/{articles/step-3-add-api-key-auth-local.mdx → getting-started/gateway/add-api-key-auth/local.mdx} +26 -21
- package/docs/{articles/step-2-add-rate-limiting.mdx → getting-started/gateway/add-rate-limiting/index.mdx} +20 -14
- package/docs/{articles/step-2-add-rate-limiting-local.mdx → getting-started/gateway/add-rate-limiting/local.mdx} +22 -15
- package/docs/getting-started/gateway/agent.mdx +198 -0
- package/docs/{articles/step-4-deploying-to-the-edge.mdx → getting-started/gateway/deploy-to-the-edge/index.mdx} +36 -27
- package/docs/{articles/step-4-deploying-to-the-edge-local.mdx → getting-started/gateway/deploy-to-the-edge/local.mdx} +46 -18
- package/docs/{articles/step-5-dynamic-rate-limiting.mdx → getting-started/gateway/dynamic-rate-limiting/index.mdx} +21 -12
- package/docs/{articles/step-5-dynamic-rate-limiting-local.mdx → getting-started/gateway/dynamic-rate-limiting/local.mdx} +21 -12
- package/docs/getting-started/gateway/index.mdx +24 -0
- package/docs/{articles/step-1-setup-basic-gateway.mdx → getting-started/gateway/setup-a-basic-gateway/index.mdx} +31 -22
- package/docs/{articles/step-1-setup-basic-gateway-local.mdx → getting-started/gateway/setup-a-basic-gateway/local.mdx} +22 -16
- package/docs/getting-started/index.mdx +25 -0
- package/docs/getting-started/mcp-gateway/agent.mdx +161 -0
- package/docs/getting-started/mcp-gateway/index.mdx +25 -0
- package/docs/{mcp-gateway/quickstart-local.mdx → getting-started/mcp-gateway/local.mdx} +35 -31
- package/docs/{mcp-gateway/quickstart.mdx → getting-started/mcp-gateway/portal.mdx} +64 -48
- package/docs/getting-started/mcp-server/agent.mdx +152 -0
- package/docs/getting-started/mcp-server/index.mdx +25 -0
- package/docs/{articles/mcp-quickstart-local.mdx → getting-started/mcp-server/local.mdx} +24 -13
- package/docs/{articles/mcp-quickstart.mdx → getting-started/mcp-server/portal.mdx} +35 -15
- package/docs/getting-started/migrate/agent.mdx +129 -0
- package/docs/getting-started/migrate/index.mdx +25 -0
- package/docs/getting-started/migrate/local.mdx +141 -0
- package/docs/getting-started/migrate/portal.mdx +129 -0
- package/docs/home.mdx +6 -0
- package/docs/mcp-gateway/connect-clients/chatgpt.mdx +2 -1
- package/docs/mcp-gateway/connect-clients/claude-code.mdx +2 -1
- package/docs/mcp-gateway/connect-clients/claude-desktop.mdx +2 -1
- package/docs/mcp-gateway/connect-clients/cursor.mdx +2 -1
- package/docs/mcp-gateway/connect-clients/vs-code.mdx +2 -1
- package/docs/mcp-gateway/how-it-works.mdx +2 -2
- package/docs/mcp-gateway/how-to/connect-upstream-api-key.mdx +4 -3
- package/docs/mcp-gateway/how-to/curate-tools.mdx +3 -2
- package/docs/mcp-gateway/overview.mdx +3 -3
- package/docs/policies/ai-gateway-smart-router-inbound/doc.md +14 -0
- package/docs/policies/akamai-ai-firewall-v2-inbound/doc.md +7 -0
- package/package.json +5 -5
- package/docs/ai-gateway/getting-started.mdx +0 -307
- package/docs/dev-portal/local-development.mdx +0 -72
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
---
|
|
2
|
+
category: Developer Portal
|
|
3
|
+
showLastModified: false
|
|
4
|
+
suggestEdit: false
|
|
5
|
+
sidebar_label: Editor
|
|
6
|
+
title: Getting Started with Developer Portal - Editor
|
|
7
|
+
description:
|
|
8
|
+
Build a developer portal locally with API documentation, an introduction,
|
|
9
|
+
sign-in, and API key management, then test a protected route.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<WizardSteps build="dev-portal" method="local" />
|
|
13
|
+
|
|
14
|
+
<MethodTabs build="dev-portal" method="local" />
|
|
15
|
+
|
|
16
|
+
Build a developer portal with API reference documentation, a custom
|
|
17
|
+
introduction, and API key management. You'll run it locally, sign in as an API
|
|
18
|
+
consumer, and make an authenticated request from the API playground.
|
|
19
|
+
|
|
20
|
+
## Prerequisites
|
|
21
|
+
|
|
22
|
+
- [Node.js](https://nodejs.org/en/download) 24 or later and Git.
|
|
23
|
+
- A [Zuplo account](https://portal.zuplo.com).
|
|
24
|
+
- An editor and an email address you can use to sign in to the developer portal.
|
|
25
|
+
|
|
26
|
+
## Create and customize the portal
|
|
27
|
+
|
|
28
|
+
<Stepper>
|
|
29
|
+
|
|
30
|
+
1. **Create a project**
|
|
31
|
+
|
|
32
|
+
Run:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx create-zuplo-api@latest my-api-project
|
|
36
|
+
cd my-api-project
|
|
37
|
+
npm run dev
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
When prompted, choose **Yes** to create a matching Portal project, complete
|
|
41
|
+
sign-in, and select your Zuplo account. The CLI creates a hosted project and
|
|
42
|
+
links your local copy to it. Keep `.env.zuplo` out of source control.
|
|
43
|
+
|
|
44
|
+
The default template includes a Todo API and a developer portal. Open the
|
|
45
|
+
**Docs Server** URL printed in the terminal, normally
|
|
46
|
+
[http://localhost:9200](http://localhost:9200). You should see the Todo API
|
|
47
|
+
reference. The gateway runs on port `9000` and the Route Designer on `9100`.
|
|
48
|
+
|
|
49
|
+
:::tip{title="Use an existing project"}
|
|
50
|
+
|
|
51
|
+
If your project already has a `docs` directory, clone its Git repository, run
|
|
52
|
+
`npm install` at the project root, then run `npx zuplo login` and
|
|
53
|
+
`npx zuplo link`, selecting the project's **working copy**. This walkthrough
|
|
54
|
+
uses the Todo template; for your own API, apply the policy and tests to an
|
|
55
|
+
equivalent read-only route. Start all three services with `npm run dev` from
|
|
56
|
+
the project root. For an older project without `docs`, first follow
|
|
57
|
+
[Enable the Developer Portal](../../dev-portal/migration.mdx).
|
|
58
|
+
|
|
59
|
+
:::
|
|
60
|
+
|
|
61
|
+
2. **Set your portal's title and introduction**
|
|
62
|
+
|
|
63
|
+
Open `docs/zudoku.config.tsx`. Set `site.title` and `metadata.title` to
|
|
64
|
+
`Todo Developer Portal`, and set `metadata.description` to
|
|
65
|
+
`Explore the Todo API and manage your API keys.` Keep the other settings.
|
|
66
|
+
|
|
67
|
+
The `apis` entry already reads `../config/routes.oas.json` and publishes it
|
|
68
|
+
at `/api`. Your API documentation updates when the OpenAPI file changes.
|
|
69
|
+
|
|
70
|
+
Replace `docs/pages/introduction.mdx` with:
|
|
71
|
+
|
|
72
|
+
```mdx title="docs/pages/introduction.mdx"
|
|
73
|
+
---
|
|
74
|
+
title: Welcome to the Todo API
|
|
75
|
+
description: Sign in, find your API key, and make your first request.
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
Use the Todo API to retrieve tasks for your application.
|
|
79
|
+
|
|
80
|
+
1. Sign in using the email address registered as a key manager.
|
|
81
|
+
2. Open **API Keys** from your profile menu to find your assigned key.
|
|
82
|
+
3. Open **API Reference** and try **Get all todos** with that key.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The default navigation already includes `introduction`. Open
|
|
86
|
+
`http://localhost:9200/introduction` to see the page. Changes appear as you
|
|
87
|
+
save. See [Writing content](../../dev-portal/zudoku/writing.mdx) for more
|
|
88
|
+
page options.
|
|
89
|
+
|
|
90
|
+
3. **Require an API key for the sample route**
|
|
91
|
+
|
|
92
|
+
Replace the empty policy list with:
|
|
93
|
+
|
|
94
|
+
```json title="config/policies.json"
|
|
95
|
+
{
|
|
96
|
+
"policies": [
|
|
97
|
+
{
|
|
98
|
+
"name": "api-key-auth",
|
|
99
|
+
"policyType": "api-key-inbound",
|
|
100
|
+
"handler": {
|
|
101
|
+
"export": "ApiKeyInboundPolicy",
|
|
102
|
+
"module": "$import(@zuplo/runtime)",
|
|
103
|
+
"options": { "allowUnauthenticatedRequests": false }
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
In `config/routes.oas.json`, find `paths["/todos"].get`. Update its
|
|
111
|
+
`x-zuplo-route` to retain the forward handler and add the policy:
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
"x-zuplo-route": {
|
|
115
|
+
"corsPolicy": "anything-goes",
|
|
116
|
+
"handler": {
|
|
117
|
+
"export": "urlForwardHandler",
|
|
118
|
+
"module": "$import(@zuplo/runtime)",
|
|
119
|
+
"options": { "baseUrl": "https://todo.zuplo.io" }
|
|
120
|
+
},
|
|
121
|
+
"policies": { "inbound": ["api-key-auth"] }
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
If you're using an existing project, add the policy to its existing list and
|
|
126
|
+
put it first in this route's inbound chain. Leave the other routes and their
|
|
127
|
+
handlers in place.
|
|
128
|
+
|
|
129
|
+
`anything-goes` enables browser requests from the developer portal. For a
|
|
130
|
+
production API, configure [CORS](../../articles/cors.mdx) for your portal's
|
|
131
|
+
origin. This step protects `GET /todos`; apply authentication to other routes
|
|
132
|
+
before exposing private data through them.
|
|
133
|
+
|
|
134
|
+
Update `info.description` to say that `GET /todos` requires a bearer API key,
|
|
135
|
+
replacing the sample's statement that no authentication is required.
|
|
136
|
+
|
|
137
|
+
In a second terminal, run `curl -i http://localhost:9000/todos`. Expect
|
|
138
|
+
`401 Unauthorized`.
|
|
139
|
+
|
|
140
|
+
</Stepper>
|
|
141
|
+
|
|
142
|
+
## Assign an API key and test it
|
|
143
|
+
|
|
144
|
+
<Stepper>
|
|
145
|
+
|
|
146
|
+
1. **Create a consumer in the Portal**
|
|
147
|
+
|
|
148
|
+
Open your project in the Zuplo Portal and go to
|
|
149
|
+
[**Services → API Keys → Consumers**](https://portal.zuplo.com/+/account/project/services).
|
|
150
|
+
Select **Dev**, then click **Create Consumer**.
|
|
151
|
+
|
|
152
|
+
Set **Subject** to `tutorial-consumer`, add your email address under **Key
|
|
153
|
+
managers**, and leave **Metadata** as `{}`. Click **Save consumer**.
|
|
154
|
+
|
|
155
|
+
<ModalScreenshot>
|
|
156
|
+
|
|
157
|
+

|
|
158
|
+
|
|
159
|
+
</ModalScreenshot>
|
|
160
|
+
|
|
161
|
+
Key managers can view and manage this consumer's keys after signing in to the
|
|
162
|
+
developer portal. Signing in alone doesn't create a consumer. See
|
|
163
|
+
[API key management](../../articles/api-key-management.mdx).
|
|
164
|
+
|
|
165
|
+
2. **Sign in to the developer portal**
|
|
166
|
+
|
|
167
|
+
Open `http://localhost:9200` and sign in with the same email address you
|
|
168
|
+
entered as a key manager. The template includes a demo sign-in provider and
|
|
169
|
+
`apiKeys: { enabled: true }` for this test.
|
|
170
|
+
|
|
171
|
+
Open your profile menu and select **API Keys**. The assigned consumer and its
|
|
172
|
+
key should appear. If they don't, check the email address and that you
|
|
173
|
+
created the consumer in **Dev** for the linked project.
|
|
174
|
+
|
|
175
|
+
3. **Call the API from the documentation**
|
|
176
|
+
|
|
177
|
+
Open **API Reference**, select **Get all todos**, and click **Test**. Expand
|
|
178
|
+
**Authentication**, select `tutorial-consumer`, and click **Send**. Expect
|
|
179
|
+
`200 OK` and a JSON response containing todos.
|
|
180
|
+
|
|
181
|
+
You can also copy the key and verify it from a second terminal:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
export TODO_API_KEY="YOUR_API_KEY"
|
|
185
|
+
curl -i http://localhost:9000/todos \
|
|
186
|
+
-H "Authorization: Bearer $TODO_API_KEY"
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
This request should return `200`; the same request without the header should
|
|
190
|
+
still return `401`.
|
|
191
|
+
|
|
192
|
+
</Stepper>
|
|
193
|
+
|
|
194
|
+
## Publish the portal
|
|
195
|
+
|
|
196
|
+
Follow [Deploy to the edge](../gateway/deploy-to-the-edge/local.mdx) to connect
|
|
197
|
+
your repository and deploy. In the Zuplo Portal, open **Deployment URLs** and
|
|
198
|
+
copy the **Dev Portal** URL. The portal deploys with the gateway.
|
|
199
|
+
|
|
200
|
+
Create a consumer in the deployed environment's **Prod** API key bucket and
|
|
201
|
+
repeat the sign-in and API request there. Development keys are separate from
|
|
202
|
+
production keys.
|
|
203
|
+
|
|
204
|
+
Before inviting users or configuring a custom domain, replace the template's
|
|
205
|
+
demo sign-in configuration with your own
|
|
206
|
+
[authentication provider](../../dev-portal/zudoku/configuration/authentication.md).
|
|
207
|
+
|
|
208
|
+
## Next steps
|
|
209
|
+
|
|
210
|
+
- [Customize the theme](../../dev-portal/zudoku/customization/colors-theme.mdx).
|
|
211
|
+
- [Create consumers on login](../../dev-portal/dev-portal-create-consumer-on-auth.mdx)
|
|
212
|
+
if every user should receive a key automatically.
|
|
213
|
+
- [Add more documentation](../../dev-portal/zudoku/writing.mdx).
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
---
|
|
2
|
+
category: Developer Portal
|
|
3
|
+
showLastModified: false
|
|
4
|
+
suggestEdit: false
|
|
5
|
+
sidebar_label: Portal
|
|
6
|
+
title: Getting Started with Developer Portal - Portal
|
|
7
|
+
description:
|
|
8
|
+
Publish a developer portal in the Zuplo Portal, customize API documentation,
|
|
9
|
+
assign a consumer key, and test an authenticated request.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<WizardSteps build="dev-portal" method="portal" />
|
|
13
|
+
|
|
14
|
+
<MethodTabs build="dev-portal" method="portal" />
|
|
15
|
+
|
|
16
|
+
Publish API documentation and let developers manage their assigned API keys.
|
|
17
|
+
You'll create a Todo API, customize its developer portal, and make an
|
|
18
|
+
authenticated request from the portal's playground.
|
|
19
|
+
|
|
20
|
+
## Prerequisites
|
|
21
|
+
|
|
22
|
+
- A [Zuplo account](https://portal.zuplo.com).
|
|
23
|
+
- An email address you can use to sign in to the developer portal.
|
|
24
|
+
|
|
25
|
+
## Build and test your developer portal
|
|
26
|
+
|
|
27
|
+
<Stepper>
|
|
28
|
+
|
|
29
|
+
1. **Create a project and sample API**
|
|
30
|
+
|
|
31
|
+
Open [**Projects**](https://portal.zuplo.com/+/account/projects), click **New
|
|
32
|
+
Project**, and select **API & MCP Gateway**. Name it `my-dev-portal` and
|
|
33
|
+
click **Create Project**.
|
|
34
|
+
|
|
35
|
+
In **Code → config/routes.oas.json**, select **Start with Example API**, then
|
|
36
|
+
**Complete Import**. The Route Designer now lists the Todo API routes. Your
|
|
37
|
+
project also includes a `docs` directory for the developer portal.
|
|
38
|
+
|
|
39
|
+
2. **Customize the portal**
|
|
40
|
+
|
|
41
|
+
In the **Code** file tree, open `docs/zudoku.config.tsx`. Set `site.title`
|
|
42
|
+
and `metadata.title` to `Todo Developer Portal`, and set
|
|
43
|
+
`metadata.description` to `Explore the Todo API and manage your API keys.`
|
|
44
|
+
Keep the other settings, including `apis`, `authentication`, and `apiKeys`.
|
|
45
|
+
|
|
46
|
+
The `apis` configuration reads `../config/routes.oas.json` and displays it at
|
|
47
|
+
`/api`. Editing your routes updates the API reference.
|
|
48
|
+
|
|
49
|
+
Open `docs/pages/introduction.mdx` and replace its contents with:
|
|
50
|
+
|
|
51
|
+
```mdx title="docs/pages/introduction.mdx"
|
|
52
|
+
---
|
|
53
|
+
title: Welcome to the Todo API
|
|
54
|
+
description: Sign in, find your API key, and make your first request.
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
Use the Todo API to retrieve tasks for your application.
|
|
58
|
+
|
|
59
|
+
1. Sign in using the email address registered as a key manager.
|
|
60
|
+
2. Open **API Keys** from your profile menu to find your assigned key.
|
|
61
|
+
3. Open **API Reference** and try **List todos** with that key.
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Save the changes. The introduction already has a navigation entry. See
|
|
65
|
+
[Writing content](../../dev-portal/zudoku/writing.mdx) for more options.
|
|
66
|
+
|
|
67
|
+
3. **Protect the sample route**
|
|
68
|
+
|
|
69
|
+
Open `config/routes.oas.json` in the **Route Designer** and select **List
|
|
70
|
+
todos** (`GET /todos`). Open **Policies → Add Policy**, search for **API Key
|
|
71
|
+
Authentication**, and accept its default configuration.
|
|
72
|
+
|
|
73
|
+
<ModalScreenshot>
|
|
74
|
+
|
|
75
|
+

|
|
76
|
+
|
|
77
|
+
</ModalScreenshot>
|
|
78
|
+
|
|
79
|
+
Keep this policy first in the inbound policy chain. On the same route, open
|
|
80
|
+
**Deny All Origins (CORS)** and select **Allow All Origins** so the developer
|
|
81
|
+
portal can call it from the browser. Save your changes.
|
|
82
|
+
|
|
83
|
+
In the code view, add `info.description` to the OpenAPI file and set it to
|
|
84
|
+
`GET /todos requires a bearer API key.` Save again.
|
|
85
|
+
|
|
86
|
+
Click **Test** next to the route's path and send a request without a key.
|
|
87
|
+
Expect `401 Unauthorized`. This step protects `GET /todos`; apply
|
|
88
|
+
authentication to other routes before using them for private data.
|
|
89
|
+
|
|
90
|
+
4. **Assign a key to a developer**
|
|
91
|
+
|
|
92
|
+
Open
|
|
93
|
+
[**Services → API Keys → Consumers**](https://portal.zuplo.com/+/account/project/services).
|
|
94
|
+
Select **Dev** and click **Create Consumer**. Set **Subject** to
|
|
95
|
+
`tutorial-consumer`, enter your email under **Key managers**, and leave
|
|
96
|
+
**Metadata** as `{}`. Click **Save consumer**.
|
|
97
|
+
|
|
98
|
+
<ModalScreenshot>
|
|
99
|
+
|
|
100
|
+

|
|
101
|
+
|
|
102
|
+
</ModalScreenshot>
|
|
103
|
+
|
|
104
|
+
A key manager can manage the consumer's keys after signing in. Signing in
|
|
105
|
+
doesn't create a consumer automatically. See
|
|
106
|
+
[API key management](../../articles/api-key-management.mdx).
|
|
107
|
+
|
|
108
|
+
5. **Open and test the developer portal**
|
|
109
|
+
|
|
110
|
+
Open **Deployment URLs** and copy the **Dev Portal** URL for your working
|
|
111
|
+
copy. Open it in a new tab. Visit `/introduction` to check your new page.
|
|
112
|
+
|
|
113
|
+
Sign in using the same email address you entered under **Key managers**. The
|
|
114
|
+
template includes a demo sign-in provider for this tutorial. Open **API
|
|
115
|
+
Keys** from your profile menu and confirm your consumer's key appears.
|
|
116
|
+
|
|
117
|
+
Open **API Reference → List todos → Test**. Expand **Authentication**, select
|
|
118
|
+
`tutorial-consumer`, and click **Send**. Expect `200 OK` and todos in the
|
|
119
|
+
response. Select **None** under Authentication and send again: expect
|
|
120
|
+
`401 Unauthorized`.
|
|
121
|
+
|
|
122
|
+
If the key isn't listed, check the key manager email and that the consumer is
|
|
123
|
+
in the **Dev** bucket. If the browser reports a CORS error, check that this
|
|
124
|
+
route allows requests from the portal.
|
|
125
|
+
|
|
126
|
+
6. **Deploy for other developers**
|
|
127
|
+
|
|
128
|
+
Follow [Deploy to the edge](../gateway/deploy-to-the-edge/index.mdx) to
|
|
129
|
+
connect your Git repository and deploy. Open **Deployment URLs** for the
|
|
130
|
+
production deployment and copy its **Dev Portal** URL.
|
|
131
|
+
|
|
132
|
+
Create a consumer in the **Prod** API key bucket and repeat the signed-in
|
|
133
|
+
request there. Dev and Production keys are separate.
|
|
134
|
+
|
|
135
|
+
Before inviting users, replace the demo login with your own
|
|
136
|
+
[authentication provider](../../dev-portal/zudoku/configuration/authentication.md)
|
|
137
|
+
and configure [CORS](../../articles/cors.mdx) to allow your portal's origin.
|
|
138
|
+
|
|
139
|
+
</Stepper>
|
|
140
|
+
|
|
141
|
+
## Next steps
|
|
142
|
+
|
|
143
|
+
- [Customize the theme](../../dev-portal/zudoku/customization/colors-theme.mdx).
|
|
144
|
+
- [Create consumers on login](../../dev-portal/dev-portal-create-consumer-on-auth.mdx)
|
|
145
|
+
if every signed-in user should receive a key automatically.
|
|
146
|
+
- [Develop locally](./local.mdx) with live updates in your editor.
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
category: API Management
|
|
3
|
+
showLastModified: false
|
|
4
|
+
suggestEdit: false
|
|
5
|
+
title: Add API key authentication - Portal
|
|
6
|
+
description:
|
|
7
|
+
Put API key authentication in front of your routes, issue a key to a consumer,
|
|
8
|
+
and reject calls that arrive without one in the Zuplo Portal.
|
|
4
9
|
---
|
|
5
10
|
|
|
11
|
+
<WizardSteps build="gateway" method="portal" step="add-api-key-auth" />
|
|
12
|
+
|
|
13
|
+
<MethodTabs build="gateway" method="portal" step="add-api-key-auth" />
|
|
14
|
+
|
|
6
15
|
In this guide we'll add API Key authentication to a route. You can do this for
|
|
7
16
|
any Zuplo project but will need a route, consider completing
|
|
8
|
-
[Step 1](
|
|
17
|
+
[Step 1](../setup-a-basic-gateway/index.mdx) first.
|
|
9
18
|
|
|
10
19
|
API Key authentication is one of our most popular **policies** as implementing
|
|
11
20
|
this authentication method is considered one of the easiest to use by developers
|
|
@@ -14,10 +23,10 @@ other authentication methods.
|
|
|
14
23
|
|
|
15
24
|
:::info{title="What's a Policy?"}
|
|
16
25
|
|
|
17
|
-
[Policies](
|
|
18
|
-
incoming request or outgoing response. Zuplo offers a wide range of
|
|
19
|
-
built-in (including API key authentication) to save you time. You can
|
|
20
|
-
[the full list](
|
|
26
|
+
[Policies](../../../articles/policies.mdx) are modules that can intercept and
|
|
27
|
+
transform an incoming request or outgoing response. Zuplo offers a wide range of
|
|
28
|
+
policies built-in (including API key authentication) to save you time. You can
|
|
29
|
+
check out [the full list](../../../articles/policies.mdx).
|
|
21
30
|
|
|
22
31
|
:::
|
|
23
32
|
|
|
@@ -31,26 +40,26 @@ Let's get started.
|
|
|
31
40
|
`routes.oas.json`) and open the **Policies** section. Then click **Add
|
|
32
41
|
Policy**.
|
|
33
42
|
|
|
34
|
-

|
|
35
44
|
|
|
36
45
|
Search for the API key authentication policy, click on it, and then click OK
|
|
37
46
|
to accept the default policy JSON.
|
|
38
47
|
|
|
39
48
|
<ModalScreenshot>
|
|
40
49
|
|
|
41
|
-

|
|
42
51
|
|
|
43
52
|
</ModalScreenshot>
|
|
44
53
|
|
|
45
54
|
:::tip
|
|
46
55
|
|
|
47
56
|
The API key authentication policy should usually be one of the first policies
|
|
48
|
-
executed. If you came here from [Step 2](
|
|
57
|
+
executed. If you came here from [Step 2](../add-rate-limiting/index.mdx) then
|
|
49
58
|
you will want to drag it above the rate limiting policy.
|
|
50
59
|
|
|
51
60
|
:::
|
|
52
61
|
|
|
53
|
-

|
|
54
63
|
|
|
55
64
|
If you test your route, you should get a 401 Unauthorized response
|
|
56
65
|
|
|
@@ -68,11 +77,11 @@ Let's get started.
|
|
|
68
77
|
[**Services**](https://portal.zuplo.com/+/account/project/services) tab in
|
|
69
78
|
your project, then select **API Keys → Consumers** in the sidebar.
|
|
70
79
|
|
|
71
|
-

|
|
72
81
|
|
|
73
82
|
Then click **Create Consumer**.
|
|
74
83
|
|
|
75
|
-

|
|
76
85
|
|
|
77
86
|
Let's break down the configuration needed.
|
|
78
87
|
- Subject: Also known as `sub`. This is a unique identifier of the API
|
|
@@ -90,7 +99,7 @@ Let's get started.
|
|
|
90
99
|
|
|
91
100
|
<ModalScreenshot>
|
|
92
101
|
|
|
93
|
-

|
|
94
103
|
|
|
95
104
|
</ModalScreenshot>
|
|
96
105
|
|
|
@@ -99,7 +108,7 @@ Let's get started.
|
|
|
99
108
|
After your API Key consumer is created, copy your new API Key by clicking the
|
|
100
109
|
copy button (next to the eye icon).
|
|
101
110
|
|
|
102
|
-

|
|
103
112
|
|
|
104
113
|
4. Test out your API Key
|
|
105
114
|
|
|
@@ -108,7 +117,7 @@ Let's get started.
|
|
|
108
117
|
|
|
109
118
|
<ModalScreenshot>
|
|
110
119
|
|
|
111
|
-

|
|
112
121
|
|
|
113
122
|
</ModalScreenshot>
|
|
114
123
|
|
|
@@ -121,7 +130,7 @@ Let's get started.
|
|
|
121
130
|
|
|
122
131
|
<ModalScreenshot>
|
|
123
132
|
|
|
124
|
-

|
|
125
134
|
|
|
126
135
|
</ModalScreenshot>
|
|
127
136
|
|
|
@@ -130,7 +139,7 @@ Let's get started.
|
|
|
130
139
|
We also offer an API for our API key service that allows you to
|
|
131
140
|
programmatically create consumers and even create your own developer portal
|
|
132
141
|
or integrate key management into your existing dashboard. See
|
|
133
|
-
[this document for details](
|
|
142
|
+
[this document for details](../../../articles/api-key-api.mdx).
|
|
134
143
|
|
|
135
144
|
:::
|
|
136
145
|
|
|
@@ -138,17 +147,17 @@ Let's get started.
|
|
|
138
147
|
|
|
139
148
|
Whenever you deploy a new endpoint on Zuplo, it will automatically be added
|
|
140
149
|
to your
|
|
141
|
-
[autogenerated developer documentation portal](
|
|
150
|
+
[autogenerated developer documentation portal](../../../dev-portal/overview.mdx).
|
|
142
151
|
|
|
143
152
|
To access your API's developer portal, click the **Gateway deployed** button
|
|
144
153
|
in your toolbar and click the link under Developer Portal.
|
|
145
|
-

|
|
146
155
|
|
|
147
156
|
When you use certain policies like API keys, Zuplo will document properties
|
|
148
157
|
like headers associated with that policy. As you can see on the right, the
|
|
149
158
|
API key policy's `Authorization` header has been documented for you.
|
|
150
159
|
|
|
151
|
-

|
|
152
161
|
|
|
153
162
|
Additionally, a new Authentication section has been added to your developer
|
|
154
163
|
portal. Users of your API can sign in, view & manage their API keys, test
|
|
@@ -157,6 +166,3 @@ Let's get started.
|
|
|
157
166
|
[our developer portal auth docs](/docs/dev-portal/zudoku/configuration/authentication).
|
|
158
167
|
|
|
159
168
|
</Stepper>
|
|
160
|
-
|
|
161
|
-
**NEXT** Try
|
|
162
|
-
[Step 4 - Connect Source Control and Deploy to the Edge](./step-4-deploying-to-the-edge.mdx).
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
category: API Management
|
|
3
|
+
showLastModified: false
|
|
4
|
+
suggestEdit: false
|
|
5
|
+
title: Add API key authentication - Editor
|
|
6
|
+
description:
|
|
7
|
+
Put API key authentication in front of your routes, issue a key to a consumer,
|
|
8
|
+
and reject calls that arrive without one with the Zuplo CLI and your editor.
|
|
4
9
|
---
|
|
5
10
|
|
|
11
|
+
<WizardSteps build="gateway" method="local" step="add-api-key-auth" />
|
|
12
|
+
|
|
13
|
+
<MethodTabs build="gateway" method="local" step="add-api-key-auth" />
|
|
14
|
+
|
|
6
15
|
In this guide we'll add API Key authentication to a route. You can do this for
|
|
7
16
|
any Zuplo project but will need a route, consider completing
|
|
8
|
-
[Step 1](
|
|
17
|
+
[Step 1](../setup-a-basic-gateway/local.mdx) first.
|
|
9
18
|
|
|
10
19
|
API Key authentication is one of our most popular **policies** as implementing
|
|
11
20
|
this authentication method is considered one of the easiest to use by developers
|
|
@@ -14,10 +23,10 @@ other authentication methods.
|
|
|
14
23
|
|
|
15
24
|
:::info{title="What's a Policy?"}
|
|
16
25
|
|
|
17
|
-
[Policies](
|
|
18
|
-
incoming request or outgoing response. Zuplo offers a wide range of
|
|
19
|
-
built-in (including API key authentication) to save you time. You can
|
|
20
|
-
[the full list](
|
|
26
|
+
[Policies](../../../articles/policies.mdx) are modules that can intercept and
|
|
27
|
+
transform an incoming request or outgoing response. Zuplo offers a wide range of
|
|
28
|
+
policies built-in (including API key authentication) to save you time. You can
|
|
29
|
+
check out [the full list](../../../articles/policies.mdx).
|
|
21
30
|
|
|
22
31
|
:::
|
|
23
32
|
|
|
@@ -36,7 +45,7 @@ Let's get started.
|
|
|
36
45
|
|
|
37
46
|
<BrowserScreenshot url="http://localhost:9100/?path=routes.oas.json">
|
|
38
47
|
|
|
39
|
-

|
|
40
49
|
|
|
41
50
|
</BrowserScreenshot>
|
|
42
51
|
|
|
@@ -45,20 +54,19 @@ Let's get started.
|
|
|
45
54
|
|
|
46
55
|
<ModalScreenshot>
|
|
47
56
|
|
|
48
|
-

|
|
49
58
|
|
|
50
59
|
</ModalScreenshot>
|
|
51
60
|
|
|
52
61
|
:::tip
|
|
53
62
|
|
|
54
63
|
The API key authentication policy should usually be one of the first policies
|
|
55
|
-
executed. If you came here from
|
|
56
|
-
|
|
57
|
-
above the rate limiting policy.
|
|
64
|
+
executed. If you came here from [Step 2](../add-rate-limiting/local.mdx) then
|
|
65
|
+
you will want to drag it above the rate limiting policy.
|
|
58
66
|
|
|
59
67
|
:::
|
|
60
68
|
|
|
61
|
-

|
|
62
70
|
|
|
63
71
|
If you test your route, you should get a 401 Unauthorized response
|
|
64
72
|
|
|
@@ -87,11 +95,11 @@ Let's get started.
|
|
|
87
95
|
|
|
88
96
|
:::
|
|
89
97
|
|
|
90
|
-

|
|
91
99
|
|
|
92
100
|
Then click **Create Consumer**.
|
|
93
101
|
|
|
94
|
-

|
|
95
103
|
|
|
96
104
|
Let's break down the configuration needed.
|
|
97
105
|
- Subject: Also known as `sub`. This is a unique identifier of the API
|
|
@@ -109,7 +117,7 @@ Let's get started.
|
|
|
109
117
|
|
|
110
118
|
<ModalScreenshot>
|
|
111
119
|
|
|
112
|
-

|
|
113
121
|
|
|
114
122
|
</ModalScreenshot>
|
|
115
123
|
|
|
@@ -118,7 +126,7 @@ Let's get started.
|
|
|
118
126
|
After your API Key consumer is created, copy your new API Key by clicking the
|
|
119
127
|
copy button (next to the eye icon).
|
|
120
128
|
|
|
121
|
-

|
|
122
130
|
|
|
123
131
|
1. Test out your API Key
|
|
124
132
|
|
|
@@ -141,11 +149,8 @@ Let's get started.
|
|
|
141
149
|
We also offer an API for our API key service that allows you to
|
|
142
150
|
programmatically create consumers and even create your own developer portal
|
|
143
151
|
or integrate key management into your existing dashboard. See
|
|
144
|
-
[this document for details](
|
|
152
|
+
[this document for details](../../../articles/api-key-api.mdx).
|
|
145
153
|
|
|
146
154
|
:::
|
|
147
155
|
|
|
148
156
|
</Stepper>
|
|
149
|
-
|
|
150
|
-
**NEXT** Try
|
|
151
|
-
[Step 4 - Deploy to the Edge](./step-4-deploying-to-the-edge-local.mdx).
|