Skip to content

Commit

Permalink
chore: plumb OAuth Client Credentials header name and token prefix (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
RohinBhargava authored Nov 22, 2024
1 parent bc70832 commit 197a05c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,10 @@ const UnmemoizedEndpointContentLeft: React.FC<EndpointContentLeft.Props> = ({
clientCredentials: (clientCredentialsValue) =>
visitDiscriminatedUnion(clientCredentialsValue.value, "type")._visit({
referencedEndpoint: () => ({
key: ApiDefinition.PropertyKey("Authorization"),
description: "OAuth authentication of the form Bearer <token>.",
key: ApiDefinition.PropertyKey(
clientCredentialsValue.value.headerName || "Authorization",
),
description: `OAuth authentication of the form ${clientCredentialsValue.value.tokenPrefix ? `${clientCredentialsValue.value.tokenPrefix ?? "Bearer"} ` : ""}<token>.`,
hidden: false,
valueShape: stringShape,
availability: undefined,
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/fern-docs-server/src/getHarRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ export function getHarRequest(
visitDiscriminatedUnion(clientCredentials.value, "type")._visit({
referencedEndpoint: () => {
request.headers.push({
name: "Authorization",
value: "Bearer <token>",
name: clientCredentials.value.headerName || "Authorization",
value: `${clientCredentials.value.tokenPrefix ? `${clientCredentials.value.tokenPrefix ?? "Bearer"} ` : ""}<token>.`,
});
},
});
Expand Down

0 comments on commit 197a05c

Please sign in to comment.