Skip to content

Commit 501d3f7

Browse files
committed
v1.1.1
- Implemented HTTP authentication, more work to do, but learned a lot in the process. I'll next look at extracting apiKeys & cookie info. So far I've looked at the HTTP OpenAPI auth scheme, and will follow up with key name extraction and the apiKey auth type. Also looked at OAuth and will revisit that. - Some code clean up & minor refactors
1 parent 3c1bfe1 commit 501d3f7

8 files changed

Lines changed: 6 additions & 10 deletions

File tree

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "OpenAPI DevTools",
4-
"version": "1.1.0",
4+
"version": "1.1.1",
55
"devtools_page": "index.html",
66
"permissions": [],
77
"icons": {

resources/dist.zip

-50 Bytes
Binary file not shown.

src/lib/endpoints-to-oai31.helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
ParameterObject,
1313
SecuritySchemeObject,
1414
} from "openapi3-ts/oas31";
15-
import { Authentication, AuthType } from "../utils/authentication";
15+
import { Authentication, AuthType } from "../utils/httpauthentication";
1616

1717
export const createSecuritySchemeTypes = (auth?: Authentication): SecuritySchemeObject | undefined => {
1818
if (!auth) return;

src/lib/endpoints-to-oai31.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import bearer from "./__fixtures__/bearer";
77
import basic from "./__fixtures__/basic";
88
import digest from "./__fixtures__/digest";
99
import { cloneDeep } from "lodash";
10-
import { AuthType } from "../utils/authentication";
10+
import { AuthType } from "../utils/httpauthentication";
1111

1212
const createRequestStoreWithDefaults = () => {
1313
const store = new RequestStore();

src/lib/endpoints-to-oai31.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
createResponseTypes,
1616
createSecuritySchemeTypes,
1717
} from "./endpoints-to-oai31.helpers";
18-
import { AuthType } from "../utils/authentication";
18+
import { AuthType } from "../utils/httpauthentication";
1919

2020
const endpointsToOAI31 = (endpoints: Array<Endpoint>): OpenApiBuilder => {
2121
const builder = createBuilderAndDocRoot(endpoints);

src/lib/store-helpers/create-leaf.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
parseJSON,
55
} from "../../utils/helpers";
66
import { JSONType, Leaf } from "../../utils/types";
7-
import { parseAuthHeader } from "../../utils/authentication";
7+
import { parseAuthHeader } from "../../utils/httpauthentication";
88
import decodeUriComponent from "decode-uri-component";
99
import { filterIgnoreHeaders } from '../../utils/headers';
1010

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ export const parseAuthHeader = (
6363
if (found) {
6464
const authType = getAuthType(found.value);
6565
if (authType === "basic") {
66-
// type BasicAuthType = ReturnType<
67-
// typeof parseAuthorizationHeader<typeof BASIC>
68-
// >;
69-
// const authData = authHeader as BasicAuthType;
7066
const basicAuth: BasicAuthHeader = {
7167
authType: AuthType.BASIC,
7268
type: "http",

src/utils/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Schema } from "genson-js";
22
import type { RadixRouter } from "radix3";
3-
import { Authentication } from './authentication';
3+
import { Authentication } from './httpauthentication';
44

55
export type JSONType =
66
| string

0 commit comments

Comments
 (0)