Skip to content
This repository was archived by the owner on Feb 18, 2026. It is now read-only.

Commit 78b5b46

Browse files
authored
fix: [CAT-1081] code cleanup to use relative paths
fix: [CAT-1081] code cleanup & use relative paths
2 parents 3880f7c + fbb69fa commit 78b5b46

File tree

12 files changed

+216
-71
lines changed

12 files changed

+216
-71
lines changed

.astro/content-modules.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
export default new Map([
33
["src/content/docs/index.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Findex.mdx&astroContentModuleFlag=true")],
4-
["src/content/docs/developer-guide.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fdeveloper-guide.mdx&astroContentModuleFlag=true")],
54
["src/content/docs/cognito-test.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fcognito-test.mdx&astroContentModuleFlag=true")],
5+
["src/content/docs/developer-guide.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fdeveloper-guide.mdx&astroContentModuleFlag=true")],
66
["src/content/docs/setup-guide.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fsetup-guide.mdx&astroContentModuleFlag=true")]]);
77

.astro/data-store.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Deploy to GitHub Pages
22

33
on:
4-
# Trigger the workflow every time you push to the `main` branch
4+
# Deploy on pushes to main branch only
55
push:
66
branches: [ main ]
77
# Allows you to run this workflow manually from the Actions tab on GitHub.

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ nano .env.local
2323

2424
### 3. Start Development Server
2525
```bash
26+
# Option 1: Use the convenience script (recommended)
27+
./start-dev.sh
28+
29+
# Option 2: Use npm directly
2630
npm run dev
2731
# Server will start on http://localhost:4321
2832
```
@@ -82,6 +86,7 @@ auth_integration/
8286
├── openapi.yaml # API specification
8387
├── astro.config.mjs # Astro/Starlight configuration
8488
├── test-cognito.html # Standalone test page
89+
├── start-dev.sh # Development server convenience script
8590
├── env.example # Example environment variables
8691
├── .gitignore # Git ignore rules
8792
└── SECURITY-GUIDE.md # Security documentation
@@ -98,7 +103,7 @@ NODE_ENV=development
98103
COGNITO_DOMAIN=your-dev-cognito-domain.auth.region.amazoncognito.com
99104
COGNITO_CLIENT_ID=your_dev_client_id
100105
COGNITO_CLIENT_SECRET=your_dev_client_secret
101-
COGNITO_SCOPE=backend-api-v3-admins/auths:read
106+
COGNITO_SCOPE=cognito-api-scope
102107
API_BASE_URL=http://localhost:3000/v1
103108
```
104109

@@ -109,7 +114,7 @@ NODE_ENV=staging
109114
COGNITO_DOMAIN=your-staging-cognito-domain.auth.region.amazoncognito.com
110115
COGNITO_CLIENT_ID=your_staging_client_id
111116
COGNITO_CLIENT_SECRET=your_staging_client_secret
112-
COGNITO_SCOPE=backend-api-v3-admins/auths:read
117+
COGNITO_SCOPE=cognito-api-scope
113118
API_BASE_URL=https://staging-api.example.com/v1
114119
```
115120

@@ -121,7 +126,7 @@ NODE_ENV=production
121126
COGNITO_DOMAIN=your-prod-cognito-domain.auth.region.amazoncognito.com
122127
COGNITO_CLIENT_ID=your_prod_client_id
123128
COGNITO_CLIENT_SECRET=your_prod_client_secret
124-
COGNITO_SCOPE=backend-api-v3-admins/auths:read
129+
COGNITO_SCOPE=cognito-api-scope
125130
API_BASE_URL=https://api.example.com/v1
126131
```
127132

SECURITY-GUIDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ NODE_ENV=development
3737
COGNITO_DOMAIN=your-actual-dev-cognito-domain.auth.region.amazoncognito.com
3838
COGNITO_CLIENT_ID=your_actual_dev_client_id
3939
COGNITO_CLIENT_SECRET=your_actual_dev_client_secret
40-
COGNITO_SCOPE=backend-api-v3-admins/auths:read
40+
COGNITO_SCOPE=cognito-api-scope
4141
API_BASE_URL=http://localhost:3000/v1
4242
```
4343

@@ -49,7 +49,7 @@ NODE_ENV=staging
4949
COGNITO_DOMAIN=your-actual-staging-cognito-domain.auth.region.amazoncognito.com
5050
COGNITO_CLIENT_ID=your_actual_staging_client_id
5151
COGNITO_CLIENT_SECRET=your_actual_staging_client_secret
52-
COGNITO_SCOPE=backend-api-v3-admins/auths:read
52+
COGNITO_SCOPE=cognito-api-scope
5353
API_BASE_URL=https://staging-api.example.com/v1
5454
```
5555

@@ -61,7 +61,7 @@ NODE_ENV=production
6161
COGNITO_DOMAIN=your-actual-prod-cognito-domain.auth.region.amazoncognito.com
6262
COGNITO_CLIENT_ID=your_actual_prod_client_id
6363
COGNITO_CLIENT_SECRET=your_actual_prod_client_secret
64-
COGNITO_SCOPE=backend-api-v3-admins/auths:read
64+
COGNITO_SCOPE=cognito-api-scope
6565
API_BASE_URL=https://api.example.com/v1
6666
```
6767

config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const config = {
66
domain: process.env.COGNITO_DOMAIN || 'your-dev-cognito-domain.auth.region.amazoncognito.com',
77
clientId: process.env.COGNITO_CLIENT_ID || 'your_dev_client_id',
88
clientSecret: process.env.COGNITO_CLIENT_SECRET || 'your_dev_client_secret',
9-
scope: process.env.COGNITO_SCOPE || 'backend-api-v3-admins/auths:read',
9+
scope: process.env.COGNITO_SCOPE || 'cognito-api-scope',
1010
},
1111
api: {
1212
baseUrl: process.env.API_BASE_URL || 'http://localhost:3000/v1',
@@ -18,7 +18,7 @@ const config = {
1818
domain: process.env.COGNITO_DOMAIN || 'your-staging-cognito-domain.auth.region.amazoncognito.com',
1919
clientId: process.env.COGNITO_CLIENT_ID || 'your_staging_client_id',
2020
clientSecret: process.env.COGNITO_CLIENT_SECRET || 'your_staging_client_secret',
21-
scope: process.env.COGNITO_SCOPE || 'backend-api-v3-admins/auths:read',
21+
scope: process.env.COGNITO_SCOPE,
2222
},
2323
api: {
2424
baseUrl: process.env.API_BASE_URL || 'https://staging-api.example.com/v1',
@@ -30,7 +30,7 @@ const config = {
3030
domain: process.env.COGNITO_DOMAIN || 'your-prod-cognito-domain.auth.region.amazoncognito.com',
3131
clientId: process.env.COGNITO_CLIENT_ID || 'your_prod_client_id',
3232
clientSecret: process.env.COGNITO_CLIENT_SECRET || 'your_prod_client_secret',
33-
scope: process.env.COGNITO_SCOPE || 'backend-api-v3-admins/auths:read',
33+
scope: process.env.COGNITO_SCOPE,
3434
},
3535
api: {
3636
baseUrl: process.env.API_BASE_URL || 'https://api.example.com/v1',

env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ NODE_ENV=development
55
COGNITO_DOMAIN=your-dev-cognito-domain.auth.region.amazoncognito.com
66
COGNITO_CLIENT_ID=your_dev_client_id
77
COGNITO_CLIENT_SECRET=your_dev_client_secret
8-
COGNITO_SCOPE=backend-api-v3-admins/auths:read
8+
COGNITO_SCOPE=cognito-api-scope
99

1010
# API Configuration
1111
API_BASE_URL=http://localhost:3000/v1

openapi.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ paths:
4848
description: AWS Cognito client secret
4949
scope:
5050
type: string
51-
example: "backend-api-v3-admins/auths:read"
51+
example: "cognito-api-scope"
5252
description: OAuth2 scope for the requested token
5353
required:
5454
- grant_type
@@ -62,21 +62,21 @@ paths:
6262
grant_type: "client_credentials"
6363
client_id: "your_dev_client_id"
6464
client_secret: "your_dev_client_secret"
65-
scope: "backend-api-v3-admins/auths:read"
65+
scope: "cognito-api-scope"
6666
cognito_auth_staging:
6767
summary: Staging Environment
6868
value:
6969
grant_type: "client_credentials"
7070
client_id: "your_staging_client_id"
7171
client_secret: "your_staging_client_secret"
72-
scope: "backend-api-v3-admins/auths:read"
72+
scope: "cognito-api-scope"
7373
cognito_auth_prod:
7474
summary: Production Environment
7575
value:
7676
grant_type: "client_credentials"
7777
client_id: "your_prod_client_id"
7878
client_secret: "your_prod_client_secret"
79-
scope: "backend-api-v3-admins/auths:read"
79+
scope: "cognito-api-scope"
8080
responses:
8181
'200':
8282
description: Token obtained successfully
@@ -99,7 +99,7 @@ paths:
9999
description: Token expiration time in seconds
100100
scope:
101101
type: string
102-
example: "backend-api-v3-admins/auths:read"
102+
example: "cognito-api-scope"
103103
description: Granted scope
104104
required:
105105
- access_token

src/content/docs/cognito-test.mdx

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ NODE_ENV=development
2121
COGNITO_DOMAIN=your-dev-cognito-domain.auth.region.amazoncognito.com
2222
COGNITO_CLIENT_ID=your_dev_client_id
2323
COGNITO_CLIENT_SECRET=your_dev_client_secret
24-
COGNITO_SCOPE=backend-api-v3-admins/auths:read
24+
COGNITO_SCOPE=cognito-api-scope
2525
API_BASE_URL=http://localhost:3000/v1
2626
```
2727

@@ -33,7 +33,7 @@ NODE_ENV=staging
3333
COGNITO_DOMAIN=your-staging-cognito-domain.auth.region.amazoncognito.com
3434
COGNITO_CLIENT_ID=your_staging_client_id
3535
COGNITO_CLIENT_SECRET=your_staging_client_secret
36-
COGNITO_SCOPE=backend-api-v3-admins/auths:read
36+
COGNITO_SCOPE=cognito-api-scope
3737
API_BASE_URL=https://staging-api.example.com/v1
3838
```
3939

@@ -45,7 +45,7 @@ NODE_ENV=production
4545
COGNITO_DOMAIN=your-prod-cognito-domain.auth.region.amazoncognito.com
4646
COGNITO_CLIENT_ID=your_prod_client_id
4747
COGNITO_CLIENT_SECRET=your_prod_client_secret
48-
COGNITO_SCOPE=backend-api-v3-admins/auths:read
48+
COGNITO_SCOPE=cognito-api-scope
4949
API_BASE_URL=https://api.example.com/v1
5050
```
5151

@@ -64,7 +64,7 @@ nano .env.local
6464

6565
The easiest way to understand the Cognito API is through the complete API documentation:
6666

67-
**Direct Link**: [API Reference - OAuth2 Token Endpoint](https://casparhealth.github.io/auth-integration/api/)
67+
**Direct Link**: [API Reference - OAuth2 Token Endpoint](/auth-integration/api/)
6868

6969
This page provides:
7070
- **Complete Specification**: Full OpenAPI documentation
@@ -76,7 +76,10 @@ This page provides:
7676

7777
#### Development
7878
```bash
79-
# Start development server
79+
# Option 1: Use the convenience script (recommended)
80+
./start-dev.sh
81+
82+
# Option 2: Use npm directly
8083
npm run dev
8184

8285
# Test with development credentials
@@ -85,7 +88,7 @@ curl -X POST "https://YOUR_DEV_COGNITO_DOMAIN/oauth2/token" \
8588
-d "grant_type=client_credentials" \
8689
-d "client_id=YOUR_DEV_CLIENT_ID" \
8790
-d "client_secret=YOUR_DEV_CLIENT_SECRET" \
88-
-d "scope=backend-api-v3-admins/auths:read"
91+
-d "scope=cognito-api-scope"
8992
```
9093

9194
#### Staging
@@ -99,7 +102,7 @@ curl -X POST "https://YOUR_STAGING_COGNITO_DOMAIN/oauth2/token" \
99102
-d "grant_type=client_credentials" \
100103
-d "client_id=YOUR_STAGING_CLIENT_ID" \
101104
-d "client_secret=YOUR_STAGING_CLIENT_SECRET" \
102-
-d "scope=backend-api-v3-admins/auths:read"
105+
-d "scope=cognito-api-scope"
103106
```
104107

105108
#### Production
@@ -113,7 +116,7 @@ curl -X POST "https://YOUR_PROD_COGNITO_DOMAIN/oauth2/token" \
113116
-d "grant_type=client_credentials" \
114117
-d "client_id=YOUR_PROD_CLIENT_ID" \
115118
-d "client_secret=YOUR_PROD_CLIENT_SECRET" \
116-
-d "scope=backend-api-v3-admins/auths:read"
119+
-d "scope=cognito-api-scope"
117120
```
118121

119122
### 1. Using cURL (Generic)
@@ -124,7 +127,7 @@ curl -X POST "https://YOUR_COGNITO_DOMAIN/oauth2/token" \
124127
-d "grant_type=client_credentials" \
125128
-d "client_id=YOUR_CLIENT_ID" \
126129
-d "client_secret=YOUR_CLIENT_SECRET" \
127-
-d "scope=backend-api-v3-admins/auths:read"
130+
-d "scope=cognito-api-scope"
128131
```
129132

130133
### 2. Using JavaScript (Browser)
@@ -135,7 +138,7 @@ async function getCognitoToken() {
135138
formData.append('grant_type', 'client_credentials');
136139
formData.append('client_id', 'YOUR_CLIENT_ID');
137140
formData.append('client_secret', 'YOUR_CLIENT_SECRET');
138-
formData.append('scope', 'backend-api-v3-admins/auths:read');
141+
formData.append('scope', 'cognito-api-scope');
139142

140143
try {
141144
const response = await fetch('https://YOUR_COGNITO_DOMAIN/oauth2/token', {
@@ -173,7 +176,7 @@ async function getCognitoToken() {
173176
formData.append('grant_type', 'client_credentials');
174177
formData.append('client_id', 'YOUR_CLIENT_ID');
175178
formData.append('client_secret', 'YOUR_CLIENT_SECRET');
176-
formData.append('scope', 'backend-api-v3-admins/auths:read');
179+
formData.append('scope', 'cognito-api-scope');
177180

178181
try {
179182
const response = await fetch('https://YOUR_COGNITO_DOMAIN/oauth2/token', {
@@ -210,7 +213,7 @@ getCognitoToken();
210213
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
211214
"token_type": "Bearer",
212215
"expires_in": 3600,
213-
"scope": "backend-api-v3-admins/auths:read"
216+
"scope": "cognito-api-scope"
214217
}
215218
```
216219

@@ -249,7 +252,7 @@ NODE_ENV=development
249252
COGNITO_DOMAIN=your-dev-cognito-domain.auth.region.amazoncognito.com
250253
COGNITO_CLIENT_ID=your_dev_client_id
251254
COGNITO_CLIENT_SECRET=your_dev_client_secret
252-
COGNITO_SCOPE=backend-api-v3-admins/auths:read
255+
COGNITO_SCOPE=cognito-api-scope
253256
API_BASE_URL=http://localhost:3000/v1
254257
```
255258

@@ -261,7 +264,7 @@ NODE_ENV=staging
261264
COGNITO_DOMAIN=your-staging-cognito-domain.auth.region.amazoncognito.com
262265
COGNITO_CLIENT_ID=your_staging_client_id
263266
COGNITO_CLIENT_SECRET=your_staging_client_secret
264-
COGNITO_SCOPE=backend-api-v3-admins/auths:read
267+
COGNITO_SCOPE=cognito-api-scope
265268
API_BASE_URL=https://staging-api.example.com/v1
266269
```
267270

@@ -273,7 +276,7 @@ NODE_ENV=production
273276
COGNITO_DOMAIN=your-prod-cognito-domain.auth.region.amazoncognito.com
274277
COGNITO_CLIENT_ID=your_prod_client_id
275278
COGNITO_CLIENT_SECRET=your_prod_client_secret
276-
COGNITO_SCOPE=backend-api-v3-admins/auths:read
279+
COGNITO_SCOPE=cognito-api-scope
277280
API_BASE_URL=https://api.example.com/v1
278281
```
279282

0 commit comments

Comments
 (0)