Skip to content

Commit 4b7fb28

Browse files
committed
chore: implementing comments
Signed-off-by: Aron Kerekes <arkereke@cisco.com>
1 parent a44ca26 commit 4b7fb28

4 files changed

Lines changed: 259 additions & 38 deletions

File tree

docs/dir/.index

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ nav:
99
- Validation: validation.md
1010
- Trust Model: trust-model.md
1111
- Features and Usage: scenarios.md
12-
- Directory Sandbox:
13-
- Overview: directory-sandbox.md
12+
- Directory Testbed:
13+
- Overview: directory-testbed.md
14+
- Testbed Deployment: directory-testbed-deployment.md
1415
- Public Staging Environment: directory-public-staging.md
15-
- Deployment: directory-sandbox-deployment.md
1616
- CLI Reference: directory-cli.md
1717
- GUI Application: directory-gui.md
1818
- SDK Reference: directory-sdk.md

docs/dir/directory-public-staging.md

Lines changed: 63 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
# Directory Public Staging Environment
22

3-
This is a public staging environment for development and testing. Keep in mind the following:
3+
This page describes the Directory public staging environment and how to connect your organization to it. You establish trust by federating your SPIRE server with the Directory SPIRE server using one of two supported bundle endpoint profiles: `https_web` (used by the testbed and recommended for most cases) or `https_spiffe` (SPIFFE mutual TLS).
44

5-
* There are no SLA or data persistence guarantees.
6-
* This environment is not for production use.
7-
* This environment is ideal for prototyping, integration, and exploration.
5+
!!! note
6+
The public staging environment is for development and testing. Keep in mind the following:
7+
8+
- There are no SLA or data persistence guarantees.
9+
- This environment is not for production use.
10+
- This environment is ideal for prototyping, integration, and exploration.
811

912
## Architecture Overview
1013

14+
The following diagram shows how your application, the Directory network, and other federation members connect via the Directory API and SPIRE federation.
15+
1116
```mermaid
1217
flowchart LR
1318
subgraph YourApplication["Your Application"]
@@ -31,6 +36,8 @@ flowchart LR
3136

3237
## Available Endpoints
3338

39+
Use the following endpoints to reach the public staging Directory API, SPIRE federation, and status dashboard.
40+
3441
| Service | URL | Purpose |
3542
| -------------------- | ------------------------------------- | ------------------------------------------- |
3643
| Directory API | `https://api.directory.agntcy.org` | Main API for agent discovery and management |
@@ -46,6 +53,8 @@ For the testbed production deployment the following endpoints are available:
4653

4754
## Quick Start Guide
4855

56+
This section walks you through preparing your environment, configuring the client, and completing federation so you can use the public staging Directory.
57+
4958
### Prerequisites
5059

5160
Before you begin, ensure you have:
@@ -171,10 +180,28 @@ To interact with the Directory, you need to establish a trusted federation betwe
171180

172181
### Step 1: Prepare Your Federation Request
173182

174-
Create a file with your SPIRE server details using the template below:
183+
Create a federation file with your SPIRE server details. The Directory supports two bundle endpoint profiles; choose the one that matches your environment.
184+
185+
**Option A: https_web profile** (recommended for testbed and most deployments)
186+
187+
Federation over standard HTTPS using CA-signed certificates. No bootstrap bundle exchange is required. The testbed uses this profile.
188+
189+
```yaml
190+
# onboarding/federation/your-org.com.yaml
191+
className: dir-spire
192+
trustDomain: your-org.com
193+
bundleEndpointURL: https://spire.your-org.com
194+
bundleEndpointProfile:
195+
type: https_web
196+
```
197+
198+
**Option B: https_spiffe profile**
199+
200+
Federation over SPIFFE mutual TLS using X.509-SVIDs. Requires a one-time bootstrap bundle exchange with the Directory and SSL passthrough on your ingress.
175201
176202
```yaml
177-
# onboarding/your-org.com.yaml
203+
# onboarding/federation/your-org.com.yaml
204+
className: dir-spire
178205
trustDomain: your-org.com
179206
bundleEndpointURL: https://spire.your-org.com
180207
bundleEndpointProfile:
@@ -194,47 +221,54 @@ trustDomainBundle: |-
194221
}
195222
```
196223
197-
!!! tip
198-
To get your trust bundle:
224+
!!! note
225+
Organizations must establish their own secure procedures for exchanging bootstrap bundles with federation partners. The bundle exchange mechanism (email, file transfer, version control, etc.) should align with organizational security policies.
199226
200-
```bash
201-
# Export your SPIRE server trust bundle
202-
spire-server bundle show -format spiffe > your-trust-bundle.json
203-
```
227+
To get your trust bundle (for `https_spiffe` or for sharing with the Directory):
228+
229+
```bash
230+
# Export your SPIRE server trust bundle
231+
spire-server bundle show -format spiffe > your-trust-bundle.json
232+
```
204233

205234
### Step 2: Submit Federation Request
206235

207-
1. Fork the [AGNTCY Directory repository](https://github.com/agntcy/dir)
236+
Submit your federation configuration to the Directory by adding a file to the [dir-staging](https://github.com/agntcy/dir-staging) repository and opening a pull request:
208237

209-
2. Create your federation file:
238+
1. Fork and clone the dir-staging repository:
210239

211-
```bash
212-
git clone https://github.com/your-username/dir.git
213-
cd dir/deployment/onboarding/
214-
cp spire.template.yaml your-org.com.yaml
215-
# Edit your-org.com.yaml with your details
216-
```
240+
```bash
241+
git clone https://github.com/your-username/dir-staging.git
242+
cd dir-staging
243+
```
217244

218-
3. Submit a Pull Request:
245+
2. Add your federation file under `onboarding/federation/` using the same structure as in Step 1. Name the file after your trust domain (e.g. `your-org.com.yaml`):
219246

220-
- Title: `federation(<Trust Domain>): add [Your Organization]`.
221-
- Description: Brief description of your organization and use case.
222-
- Files: Include your completed federation configuration.
247+
```bash
248+
# Create or edit your federation file
249+
# Path: onboarding/federation/your-org.com.yaml
250+
```
223251

224-
### Step 3: Configure Your SPIRE Server
252+
For `https_web` (testbed / recommended): include `className`, `trustDomain`, `bundleEndpointURL`, and `bundleEndpointProfile.type: https_web`.
253+
For `https_spiffe`: also include `endpointSPIFFEID` and `trustDomainBundle` in the same file.
225254

226-
Add the Directory SPIRE server as a federation peer in your SPIRE server configuration
227-
by obtaining the [Directory trust bundle](https://github.com/agntcy/dir-staging/tree/feat/deploy/onboarding).
255+
3. Submit a pull request to the upstream [agntcy/dir-staging](https://github.com/agntcy/dir-staging) repo:
256+
257+
- Title: `federation(<Trust Domain>): add [Your Organization]`
258+
- Description: Brief description of your organization and use case.
259+
- Files: Your new or updated file under `onboarding/federation/`.
260+
261+
### Step 3: Configure Your SPIRE Server
228262

229-
Save the trust bundle to the specified path.
263+
Add the Directory SPIRE server as a federation peer in your SPIRE server configuration. Obtain the Directory trust bundle from the [dir-staging onboarding resources](https://github.com/agntcy/dir-staging/tree/main/onboarding) (or from the Directory team after your federation request is approved) and configure it in your SPIRE server per your deployment method.
230264

231265
### Step 4: Verify Federation
232266

233267
```bash
234268
# Check federation status
235269
spire-server federation list
236270
237-
# Should show federated trust domain
271+
# Should show the federated trust domain
238272
spire-server federation show --trustDomain dir.agntcy.org
239273
```
240274

Lines changed: 188 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Sandbox Deployment
1+
# Testbed Deployment
22

33
The [dir-staging](https://github.com/agntcy/dir-staging) repository contains the deployment manifests for AGNTCY Directory project. It is designed to be used with Argo CD for GitOps-style continuous deployment.
44

@@ -362,3 +362,190 @@ with the Directory Server, follow these steps:
362362
dirctl info baeareiesad3lyuacjirp6gxudrzheltwbodtsg7ieqpox36w5j637rchwq
363363
```
364364
365+
## GitHub OAuth Authentication
366+
367+
The Directory server can be deployed with an optional Envoy gateway that provides GitHub OAuth authentication, allowing users to access the Directory API using their GitHub identity.
368+
369+
### Features
370+
371+
- Device Flow (default) — No OAuth App registration required.
372+
- Casbin RBAC — Policy-driven, role-based authorization.
373+
- Multi-Role Support — Define admin, reader, and custom roles.
374+
- Per-Method Permissions — Fine-grained API access control
375+
- User & Org Roles — Assign roles to individual users or entire GitHub orgs.
376+
- Default Role — Automatic role for any authenticated user.
377+
- Token Caching — Automatic credential management.
378+
- CI/CD Support — Use GitHub PATs for automation.
379+
- Helm Integration — Fully integrated as `envoy-authz` subchart.
380+
381+
### Quick Start
382+
383+
1. Enable in your deployment values:
384+
385+
Edit `applications/dir/dev/values.yaml`:
386+
387+
```yaml
388+
apiserver:
389+
# Enable the Envoy auth gateway subchart
390+
envoyAuthz:
391+
enabled: true
392+
393+
# Configure the subchart
394+
envoy-authz:
395+
envoy:
396+
replicaCount: 1 # Increase for production
397+
backend:
398+
address: "dir-dir-dev-argoapp-apiserver.dir-dev-dir.svc.cluster.local"
399+
port: 8888
400+
spiffe:
401+
enabled: true
402+
trustDomain: example.org
403+
className: dir-spire
404+
405+
authServer:
406+
replicaCount: 1 # Increase for production
407+
408+
# Casbin RBAC Configuration
409+
authorization:
410+
# Default role for any authenticated GitHub user
411+
defaultRole: "reader"
412+
413+
# Role definitions
414+
roles:
415+
# Admin role - full access
416+
admin:
417+
allowedMethods:
418+
- "*" # Wildcard grants all methods
419+
users:
420+
- "github:alice"
421+
- "github:bob"
422+
orgs: []
423+
424+
# Reader role - read-only access
425+
reader:
426+
allowedMethods:
427+
- "/agntcy.dir.store.v1.StoreService/Pull"
428+
- "/agntcy.dir.search.v1.SearchService/SearchCIDs"
429+
- "/agntcy.dir.routing.v1.RoutingService/List"
430+
users: [] # Inherited by defaultRole
431+
orgs: []
432+
433+
# GitHub provider configuration
434+
github:
435+
enabled: true
436+
cacheTTL: 5m
437+
438+
ingress:
439+
enabled: true
440+
className: "nginx"
441+
host: "dev.gateway.example.org"
442+
annotations:
443+
# Required for gRPC over HTTPS
444+
nginx.ingress.kubernetes.io/backend-protocol: "GRPC"
445+
nginx.ingress.kubernetes.io/grpc-backend: "true"
446+
```
447+
448+
2. Deploy GitHub OAuth authentication
449+
450+
ArgoCD syncs automatically after git push.
451+
452+
3. Authenticate:
453+
454+
```bash
455+
# Device Flow (recommended - no OAuth App needed)
456+
export DIRECTORY_CLIENT_SERVER_ADDRESS="dev.gateway.example.org:443"
457+
export DIRECTORY_CLIENT_AUTH_MODE="github"
458+
459+
# Login - opens browser for GitHub authorization
460+
dirctl auth login
461+
462+
# Use dirctl normally after login
463+
dirctl routing list
464+
```
465+
466+
For CI/CD, use GitHub Personal Access Tokens or Actions' `GITHUB_TOKEN`:
467+
468+
```bash
469+
export DIRECTORY_CLIENT_AUTH_MODE="github"
470+
export DIRECTORY_CLIENT_GITHUB_TOKEN="${GITHUB_PAT}"
471+
# Or use GitHub Actions' automatic token:
472+
# export DIRECTORY_CLIENT_GITHUB_TOKEN="${GITHUB_TOKEN}"
473+
474+
# Connect to Envoy gateway
475+
export DIRECTORY_CLIENT_SERVER_ADDRESS="dev.gateway.example.org:443"
476+
477+
dirctl routing list
478+
```
479+
480+
!!! note
481+
For CI/CD, your GitHub user or bot account must be assigned a role (admin or reader) in the RBAC configuration.
482+
483+
### Configuration Options
484+
485+
#### Available API Methods
486+
487+
For a complete list of all 24 Directory API methods with their full gRPC paths and descriptions, see the [envoy-authz values.yaml reference](https://github.com/agntcy/dir/blob/main/install/charts/envoy-authz/values.yaml#L93-L151).
488+
489+
#### User-based roles
490+
491+
Specific users with specific permissions:
492+
493+
```yaml
494+
authServer:
495+
authorization:
496+
defaultRole: "" # No default role - explicit assignment required
497+
roles:
498+
admin:
499+
allowedMethods: ["*"]
500+
users:
501+
- "github:alice"
502+
- "github:bob"
503+
orgs: []
504+
```
505+
506+
#### Organization-based roles
507+
508+
Entire GitHub org gets a role:
509+
510+
```yaml
511+
authServer:
512+
authorization:
513+
defaultRole: "reader" # All authenticated users get reader
514+
roles:
515+
admin:
516+
allowedMethods: ["*"]
517+
users: []
518+
orgs:
519+
- "your-org" # All org members are admins
520+
```
521+
522+
#### Combined roles
523+
524+
Users override org roles:
525+
526+
```yaml
527+
authServer:
528+
authorization:
529+
defaultRole: "reader"
530+
userDenyList:
531+
- "github:suspended-user" # Block specific users
532+
roles:
533+
admin:
534+
allowedMethods: ["*"]
535+
users:
536+
- "github:alice" # Individual admin
537+
orgs:
538+
- "your-org" # Org-wide admin
539+
reader:
540+
allowedMethods:
541+
- "/agntcy.dir.store.v1.StoreService/Pull"
542+
- "/agntcy.dir.search.v1.SearchService/SearchCIDs"
543+
users: []
544+
orgs: []
545+
```
546+
547+
#### RBAC Precedence
548+
549+
Deny > User Role > Org Role > Default Role
550+
551+
See [Directory Helm Chart documentation](https://github.com/agntcy/dir/tree/main/install/charts/envoy-authz) for complete API method list and advanced configuration.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Directory Sandbox
1+
# Directory Testbed
22

3-
The Directory Sandbox is a local environment for development and testing. It can be used to test your application with the Directory network. This environment provides a fully functional Directory instance for development, testing, and exploration purposes.
3+
The Directory Testbed is a local environment for development and testing. It can be used to test your application with the Directory network. This environment provides a fully functional Directory instance for development, testing, and exploration purposes.
44

5-
There are two ways to use the sandbox:
5+
There are two ways to use the testbed:
66

7-
- [Using the public staging environment](./directory-public-staging.md).
8-
- [Deploying the local sandbox environment](./directory-sandbox-deployment.md).
7+
- [Deploying the local testbed environment](./directory-testbed-deployment.md)
8+
- [Using the public staging environment](./directory-public-staging.md)

0 commit comments

Comments
 (0)