flightdeck 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/flightdeck.bin.js +4 -1
- package/dist/lib.js +4 -1
- package/package.json +2 -2
- package/src/flightdeck.lib.ts +7 -1
package/dist/flightdeck.bin.js
CHANGED
|
@@ -92,8 +92,11 @@ class FlightDeck {
|
|
|
92
92
|
try {
|
|
93
93
|
if (typeof req.url === `undefined`)
|
|
94
94
|
throw 400;
|
|
95
|
-
|
|
95
|
+
const expectedAuthHeader = `Bearer ${secret}`;
|
|
96
|
+
if (authHeader !== `Bearer ${secret}`) {
|
|
97
|
+
this.logger.info(`Unauthorized: needed \`${expectedAuthHeader}\`, got \`${authHeader}\``);
|
|
96
98
|
throw 401;
|
|
99
|
+
}
|
|
97
100
|
const url = new URL(req.url, ORIGIN);
|
|
98
101
|
this.logger.info(req.method, url.pathname);
|
|
99
102
|
switch (req.method) {
|
package/dist/lib.js
CHANGED
|
@@ -96,8 +96,11 @@ class FlightDeck {
|
|
|
96
96
|
try {
|
|
97
97
|
if (typeof req.url === `undefined`)
|
|
98
98
|
throw 400;
|
|
99
|
-
|
|
99
|
+
const expectedAuthHeader = `Bearer ${secret}`;
|
|
100
|
+
if (authHeader !== `Bearer ${secret}`) {
|
|
101
|
+
this.logger.info(`Unauthorized: needed \`${expectedAuthHeader}\`, got \`${authHeader}\``);
|
|
100
102
|
throw 401;
|
|
103
|
+
}
|
|
101
104
|
const url = new URL(req.url, ORIGIN);
|
|
102
105
|
this.logger.info(req.method, url.pathname);
|
|
103
106
|
switch (req.method) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flightdeck",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jeremy Banka",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"comline": "0.1.3"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@types/node": "22.7.
|
|
29
|
+
"@types/node": "22.7.6",
|
|
30
30
|
"@types/tmp": "0.2.6",
|
|
31
31
|
"bun-types": "1.1.30",
|
|
32
32
|
"concurrently": "9.0.1",
|
package/src/flightdeck.lib.ts
CHANGED
|
@@ -126,7 +126,13 @@ export class FlightDeck<S extends string = string> {
|
|
|
126
126
|
const authHeader = req.headers.authorization
|
|
127
127
|
try {
|
|
128
128
|
if (typeof req.url === `undefined`) throw 400
|
|
129
|
-
|
|
129
|
+
const expectedAuthHeader = `Bearer ${secret}`
|
|
130
|
+
if (authHeader !== `Bearer ${secret}`) {
|
|
131
|
+
this.logger.info(
|
|
132
|
+
`Unauthorized: needed \`${expectedAuthHeader}\`, got \`${authHeader}\``,
|
|
133
|
+
)
|
|
134
|
+
throw 401
|
|
135
|
+
}
|
|
130
136
|
const url = new URL(req.url, ORIGIN)
|
|
131
137
|
this.logger.info(req.method, url.pathname)
|
|
132
138
|
switch (req.method) {
|