Skip to content

Commit 191c45c

Browse files
committed
refactor: rename EPIC_ME_SERVER_URL to EPIC_ME_AUTH_SERVER_URL across multiple files
1 parent 3e1926b commit 191c45c

File tree

8 files changed

+32
-32
lines changed

8 files changed

+32
-32
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { DBClient } from '@epic-web/epicme-db-client'
22

3-
export const EPIC_ME_SERVER_URL = 'http://localhost:7788'
3+
export const EPIC_ME_AUTH_SERVER_URL = 'http://localhost:7788'
44

55
export function getClient() {
6-
return new DBClient(EPIC_ME_SERVER_URL)
6+
return new DBClient(EPIC_ME_AUTH_SERVER_URL)
77
}

exercises/03.initialize-flow/01.problem/src/auth.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { EPIC_ME_SERVER_URL } from './client.ts'
1+
import { EPIC_ME_AUTH_SERVER_URL } from './client.ts'
22

33
export async function handleOAuthAuthorizationServerRequest() {
44
const authUrl = new URL(
55
'/.well-known/oauth-authorization-server',
6-
EPIC_ME_SERVER_URL,
6+
EPIC_ME_AUTH_SERVER_URL,
77
)
88
return Response.redirect(authUrl.toString(), 302)
99
}
@@ -23,10 +23,10 @@ export async function handleOAuthProtectedResourceRequest(request: Request) {
2323
},
2424
authorization_servers: [
2525
{
26-
issuer: EPIC_ME_SERVER_URL,
27-
authorization_endpoint: `${EPIC_ME_SERVER_URL}/authorize`,
28-
token_endpoint: `${EPIC_ME_SERVER_URL}/token`,
29-
introspection_endpoint: `${EPIC_ME_SERVER_URL}/introspect`,
26+
issuer: EPIC_ME_AUTH_SERVER_URL,
27+
authorization_endpoint: `${EPIC_ME_AUTH_SERVER_URL}/authorize`,
28+
token_endpoint: `${EPIC_ME_AUTH_SERVER_URL}/token`,
29+
introspection_endpoint: `${EPIC_ME_AUTH_SERVER_URL}/introspect`,
3030
},
3131
],
3232
})
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { DBClient } from '@epic-web/epicme-db-client'
22

3-
export const EPIC_ME_SERVER_URL = 'http://localhost:7788'
3+
export const EPIC_ME_AUTH_SERVER_URL = 'http://localhost:7788'
44

55
export function getClient() {
6-
return new DBClient(EPIC_ME_SERVER_URL)
6+
return new DBClient(EPIC_ME_AUTH_SERVER_URL)
77
}

exercises/03.initialize-flow/01.problem/test/index.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { test, expect, inject } from 'vitest'
22

33
const mcpServerPort = inject('mcpServerPort')
4-
const EPIC_ME_SERVER_URL = 'http://localhost:7788'
4+
const EPIC_ME_AUTH_SERVER_URL = 'http://localhost:7788'
55

66
// TypeScript interfaces for API responses
77
interface AuthServerConfig {
@@ -144,7 +144,7 @@ test('OAuth integration flow works end-to-end', async () => {
144144

145145
// Step 2: Dynamic client registration
146146
const clientRegistrationResponse = await fetch(
147-
`${EPIC_ME_SERVER_URL}/register`,
147+
`${EPIC_ME_AUTH_SERVER_URL}/register`,
148148
{
149149
method: 'POST',
150150
headers: { 'Content-Type': 'application/json' },
@@ -191,7 +191,7 @@ test('OAuth integration flow works end-to-end', async () => {
191191
)
192192

193193
// Step 4: Requesting the auth code programmatically
194-
const testAuthUrl = new URL(`${EPIC_ME_SERVER_URL}/test-auth`)
194+
const testAuthUrl = new URL(`${EPIC_ME_AUTH_SERVER_URL}/test-auth`)
195195
// Use the registered client ID instead of the one from the auth URL
196196
testAuthUrl.searchParams.set('client_id', clientRegistration.client_id)
197197
testAuthUrl.searchParams.set('redirect_uri', redirectUri)
@@ -235,7 +235,7 @@ test('OAuth integration flow works end-to-end', async () => {
235235
tokenParams.set('client_secret', clientRegistration.client_secret)
236236
}
237237

238-
const tokenResponse = await fetch(`${EPIC_ME_SERVER_URL}/token`, {
238+
const tokenResponse = await fetch(`${EPIC_ME_AUTH_SERVER_URL}/token`, {
239239
method: 'POST',
240240
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
241241
body: tokenParams,

exercises/04.auth-requests/01.problem/src/auth.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { z } from 'zod'
2-
import { EPIC_ME_SERVER_URL } from './client.ts'
2+
import { EPIC_ME_AUTH_SERVER_URL } from './client.ts'
33

44
export type AuthInfo = Exclude<
55
Awaited<ReturnType<typeof getAuthInfo>>,
@@ -12,7 +12,7 @@ export async function getAuthInfo(request: Request) {
1212

1313
const token = authHeader.slice('Bearer '.length)
1414

15-
const validateUrl = new URL('/introspect', EPIC_ME_SERVER_URL).toString()
15+
const validateUrl = new URL('/introspect', EPIC_ME_AUTH_SERVER_URL).toString()
1616
const resp = await fetch(validateUrl, {
1717
headers: { authorization: authHeader },
1818
})
@@ -43,7 +43,7 @@ export function initiateOAuthFlow(request: Request) {
4343
const currentUrl = url.toString()
4444

4545
// Create the OAuth authorization URL
46-
const authUrl = new URL('/authorize', EPIC_ME_SERVER_URL)
46+
const authUrl = new URL('/authorize', EPIC_ME_AUTH_SERVER_URL)
4747

4848
// Add the current URL as the redirect target
4949
authUrl.searchParams.set('redirect_uri', currentUrl)
@@ -70,7 +70,7 @@ export function initiateOAuthFlow(request: Request) {
7070
export async function handleOAuthAuthorizationServerRequest() {
7171
const authUrl = new URL(
7272
'/.well-known/oauth-authorization-server',
73-
EPIC_ME_SERVER_URL,
73+
EPIC_ME_AUTH_SERVER_URL,
7474
)
7575
return Response.redirect(authUrl.toString(), 302)
7676
}
@@ -90,10 +90,10 @@ export async function handleOAuthProtectedResourceRequest(request: Request) {
9090
},
9191
authorization_servers: [
9292
{
93-
issuer: EPIC_ME_SERVER_URL,
94-
authorization_endpoint: `${EPIC_ME_SERVER_URL}/authorize`,
95-
token_endpoint: `${EPIC_ME_SERVER_URL}/token`,
96-
introspection_endpoint: `${EPIC_ME_SERVER_URL}/introspect`,
93+
issuer: EPIC_ME_AUTH_SERVER_URL,
94+
authorization_endpoint: `${EPIC_ME_AUTH_SERVER_URL}/authorize`,
95+
token_endpoint: `${EPIC_ME_AUTH_SERVER_URL}/token`,
96+
introspection_endpoint: `${EPIC_ME_AUTH_SERVER_URL}/introspect`,
9797
},
9898
],
9999
})
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { DBClient } from '@epic-web/epicme-db-client'
22

3-
export const EPIC_ME_SERVER_URL = 'http://localhost:7788'
3+
export const EPIC_ME_AUTH_SERVER_URL = 'http://localhost:7788'
44

55
export function getClient() {
6-
return new DBClient(EPIC_ME_SERVER_URL)
6+
return new DBClient(EPIC_ME_AUTH_SERVER_URL)
77
}

exercises/04.auth-requests/01.problem/test/index.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { test, expect, inject } from 'vitest'
22

33
const mcpServerPort = inject('mcpServerPort')
4-
const EPIC_ME_SERVER_URL = 'http://localhost:7788'
4+
const EPIC_ME_AUTH_SERVER_URL = 'http://localhost:7788'
55

66
// TypeScript interfaces for API responses
77
interface AuthServerConfig {
@@ -144,7 +144,7 @@ test('OAuth integration flow works end-to-end', async () => {
144144

145145
// Step 2: Dynamic client registration
146146
const clientRegistrationResponse = await fetch(
147-
`${EPIC_ME_SERVER_URL}/register`,
147+
`${EPIC_ME_AUTH_SERVER_URL}/register`,
148148
{
149149
method: 'POST',
150150
headers: { 'Content-Type': 'application/json' },
@@ -191,7 +191,7 @@ test('OAuth integration flow works end-to-end', async () => {
191191
)
192192

193193
// Step 4: Requesting the auth code programmatically
194-
const testAuthUrl = new URL(`${EPIC_ME_SERVER_URL}/test-auth`)
194+
const testAuthUrl = new URL(`${EPIC_ME_AUTH_SERVER_URL}/test-auth`)
195195
// Use the registered client ID instead of the one from the auth URL
196196
testAuthUrl.searchParams.set('client_id', clientRegistration.client_id)
197197
testAuthUrl.searchParams.set('redirect_uri', redirectUri)
@@ -235,7 +235,7 @@ test('OAuth integration flow works end-to-end', async () => {
235235
tokenParams.set('client_secret', clientRegistration.client_secret)
236236
}
237237

238-
const tokenResponse = await fetch(`${EPIC_ME_SERVER_URL}/token`, {
238+
const tokenResponse = await fetch(`${EPIC_ME_AUTH_SERVER_URL}/token`, {
239239
method: 'POST',
240240
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
241241
body: tokenParams,

exercises/99.finished/99.solution/test/index.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { test, expect, inject } from 'vitest'
22
import { z } from 'zod'
33

44
const mcpServerPort = inject('mcpServerPort')
5-
const EPIC_ME_SERVER_URL = 'http://localhost:7788'
5+
const EPIC_ME_AUTH_SERVER_URL = 'http://localhost:7788'
66

77
// TypeScript interfaces for API responses
88
interface AuthServerConfig {
@@ -146,7 +146,7 @@ test('OAuth integration flow works end-to-end', async () => {
146146

147147
// Step 2: Dynamic client registration
148148
const clientRegistrationResponse = await fetch(
149-
`${EPIC_ME_SERVER_URL}/register`,
149+
`${EPIC_ME_AUTH_SERVER_URL}/register`,
150150
{
151151
method: 'POST',
152152
headers: { 'Content-Type': 'application/json' },
@@ -176,7 +176,7 @@ test('OAuth integration flow works end-to-end', async () => {
176176
const redirectUri = `${mcpServerUrl}/mcp`
177177

178178
// Step 4: Requesting the auth code programmatically
179-
const testAuthUrl = new URL(`${EPIC_ME_SERVER_URL}/test-auth`)
179+
const testAuthUrl = new URL(`${EPIC_ME_AUTH_SERVER_URL}/test-auth`)
180180
// Use the registered client ID instead of the one from the auth URL
181181
testAuthUrl.searchParams.set('client_id', clientRegistration.client_id)
182182
testAuthUrl.searchParams.set('redirect_uri', redirectUri)
@@ -220,7 +220,7 @@ test('OAuth integration flow works end-to-end', async () => {
220220
tokenParams.set('client_secret', clientRegistration.client_secret)
221221
}
222222

223-
const tokenResponse = await fetch(`${EPIC_ME_SERVER_URL}/token`, {
223+
const tokenResponse = await fetch(`${EPIC_ME_AUTH_SERVER_URL}/token`, {
224224
method: 'POST',
225225
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
226226
body: tokenParams,

0 commit comments

Comments
 (0)