Skip to content

Commit 557638e

Browse files
committed
chore: basic auth
1 parent 7153476 commit 557638e

9 files changed

Lines changed: 101 additions & 1280 deletions

blockfrost-openapi.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,12 @@ info:
332332
333333
Include your project ID as the `project_id` HTTP header.
334334
335+
Alternatively, you can use **HTTP Basic Auth** directly in the endpoint URL. The username is the network prefix and the password is your project ID:
336+
```
337+
https://nightpreview:YOUR_PROJECT_ID@midnight-preview.blockfrost.io/api/v0
338+
https://nightmainnet:YOUR_PROJECT_ID@midnight-mainnet.blockfrost.io/api/v0
339+
```
340+
335341
When using WebSocket in the browser (which doesn't support custom headers), include your project ID as a subprotocol by prefixing it with `project_id_`:
336342
```javascript
337343
new WebSocket("wss://midnight-preview.blockfrost.io/api/v0/ws", [
@@ -368,7 +374,7 @@ info:
368374
369375
### WebSocket Subscriptions
370376
371-
Subscriptions use a WebSocket connection following the [GraphQL over WebSocket](https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md) protocol.
377+
Subscriptions use a WebSocket connection following the GraphQL over WebSocket protocol.
372378
373379
**Connecting with `websocat`:**
374380
```bash

docs/blockfrost-openapi.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,18 @@ info:
456456
Include your project ID as the `project_id` HTTP header.
457457
458458
459+
Alternatively, you can use **HTTP Basic Auth** directly in the endpoint URL.
460+
The username is the network prefix and the password is your project ID:
461+
462+
```
463+
464+
https://nightpreview:YOUR_PROJECT_ID@midnight-preview.blockfrost.io/api/v0
465+
466+
https://nightmainnet:YOUR_PROJECT_ID@midnight-mainnet.blockfrost.io/api/v0
467+
468+
```
469+
470+
459471
When using WebSocket in the browser (which doesn't support custom headers),
460472
include your project ID as a subprotocol by prefixing it with `project_id_`:
461473
@@ -508,9 +520,8 @@ info:
508520
### WebSocket Subscriptions
509521
510522
511-
Subscriptions use a WebSocket connection following the [GraphQL over
512-
WebSocket](https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md)
513-
protocol.
523+
Subscriptions use a WebSocket connection following the GraphQL over
524+
WebSocket protocol.
514525
515526
516527
**Connecting with `websocat`:**

docs/midnight/index.html

Lines changed: 52 additions & 48 deletions
Large diffs are not rendered by default.

json-schema.json

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

openapi.json

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

openapi.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,18 @@ info:
456456
Include your project ID as the `project_id` HTTP header.
457457
458458
459+
Alternatively, you can use **HTTP Basic Auth** directly in the endpoint URL.
460+
The username is the network prefix and the password is your project ID:
461+
462+
```
463+
464+
https://nightpreview:YOUR_PROJECT_ID@midnight-preview.blockfrost.io/api/v0
465+
466+
https://nightmainnet:YOUR_PROJECT_ID@midnight-mainnet.blockfrost.io/api/v0
467+
468+
```
469+
470+
459471
When using WebSocket in the browser (which doesn't support custom headers),
460472
include your project ID as a subprotocol by prefixing it with `project_id_`:
461473
@@ -508,9 +520,8 @@ info:
508520
### WebSocket Subscriptions
509521
510522
511-
Subscriptions use a WebSocket connection following the [GraphQL over
512-
WebSocket](https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md)
513-
protocol.
523+
Subscriptions use a WebSocket connection following the GraphQL over
524+
WebSocket protocol.
514525
515526
516527
**Connecting with `websocat`:**

spectaql.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ info:
5353
description: |
5454
Include your project ID as the `project_id` HTTP header.
5555
56+
Alternatively, you can use **HTTP Basic Auth** directly in the endpoint URL. The username is the network prefix and the password is your project ID:
57+
```
58+
https://nightpreview:YOUR_PROJECT_ID@midnight-preview.blockfrost.io/api/v0
59+
https://nightmainnet:YOUR_PROJECT_ID@midnight-mainnet.blockfrost.io/api/v0
60+
```
61+
5662
When using WebSocket in the browser (which doesn't support custom headers), include your project ID as a subprotocol by prefixing it with `project_id_`:
5763
```javascript
5864
new WebSocket("wss://midnight-preview.blockfrost.io/api/v0/ws", [

src/definitions.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,12 @@ info:
332332
333333
Include your project ID as the `project_id` HTTP header.
334334
335+
Alternatively, you can use **HTTP Basic Auth** directly in the endpoint URL. The username is the network prefix and the password is your project ID:
336+
```
337+
https://nightpreview:YOUR_PROJECT_ID@midnight-preview.blockfrost.io/api/v0
338+
https://nightmainnet:YOUR_PROJECT_ID@midnight-mainnet.blockfrost.io/api/v0
339+
```
340+
335341
When using WebSocket in the browser (which doesn't support custom headers), include your project ID as a subprotocol by prefixing it with `project_id_`:
336342
```javascript
337343
new WebSocket("wss://midnight-preview.blockfrost.io/api/v0/ws", [

0 commit comments

Comments
 (0)