-
Notifications
You must be signed in to change notification settings - Fork 16
feat(server): check optional bearer access token #382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
b09adff
3fbea2d
293ab5b
148ea93
9ef6499
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,6 +50,7 @@ export function createConfig(): Config { | |
|
|
||
| // Synapse SDK configuration | ||
| privateKey: process.env.PRIVATE_KEY, // Required: Ethereum-compatible private key | ||
| accessToken: process.env.ACCESS_TOKEN, | ||
| rpcUrl, // Determined from RPC_URL, NETWORK, or default to calibration | ||
|
Comment on lines
52
to
54
|
||
| // Storage paths | ||
| databasePath: process.env.DATABASE_PATH ?? join(dataDir, 'pins.db'), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -126,6 +126,11 @@ export async function createFilecoinPinningServer( | |
| return | ||
| } | ||
|
|
||
| if (config.accessToken && token !== config.accessToken) { | ||
| await reply.code(401).send({ error: 'Invalid access token' }) | ||
|
wjmelements marked this conversation as resolved.
Outdated
|
||
| return | ||
|
wjmelements marked this conversation as resolved.
Outdated
|
||
| } | ||
|
||
|
|
||
| // Add user to request context | ||
| request.user = DEFAULT_USER_INFO | ||
| }) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.