-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: Adds access token authentication to client #166
Conversation
const configuration: ClientConfiguration = { | ||
instanceURL: "https://my.octopus.app", | ||
userAgentApp: "createRequestHeader-tests", | ||
accessToken: "access-token", |
Check failure
Code scanning / CodeQL
Hard-coded credentials
|
||
expect(headers).toEqual({ | ||
"Accept-Encoding": "gzip,deflate,compress", | ||
Authorization: "Bearer access-token", |
Check failure
Code scanning / CodeQL
Hard-coded credentials
@@ -12,12 +13,10 @@ export class AxiosAdapter<TResource> implements Adapter<TResource> { | |||
url: options.url, | |||
maxContentLength: Infinity, | |||
maxBodyLength: Infinity, | |||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did these light up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah not sure why they wouldn't have turned up before, as soon as I opened the file it lit up. We have these in a bunch of places across our various typescript codebases where we need them, so I think the disable is fine in an of itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just one half question about why we've had to disable some warnings, but not a blocking thing. Assuming the disable has reasons.
This pull request has been linked to Shortcut Story #54886: Add support for authenticating with access tokens to the Typescript client. |
This PR adds support for authenticating to the Octopus API using an access token as a bearer token in the
Authorization
header, as part of supporting OIDC for connecting to the API.The
apiKey
property in theClientConfiguration
type has been made optional, and backward compatibility has been preserved in the handling of headers, such that if none are provided thenX-Octopus-ApiKey
will be passed with an empty string.Note: The intent is to treat this as a minor version bump as the changes are backward compatible.
[sc-54886]