Skip to content
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

refactor(api-key): remove unsupported api-key feature #1148

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

BugGambit
Copy link
Contributor

@BugGambit BugGambit commented Sep 17, 2024

As part of the v10 release, we would like to clean up api-key references in the SDK as api-keys isn't supported by CDF anymore (and hasn't been supported for a long time - years).

Jira: https://cognitedata.atlassian.net/browse/AUTH-3104

@BugGambit BugGambit requested a review from a team as a code owner September 17, 2024 18:28
@BugGambit BugGambit changed the title chore: upgrade to typescript 5 (#1135) refactor(api-key): remove unsupported api-key feature Sep 17, 2024
export const AUTHORIZATION_HEADER = 'Authorization';
/** @hidden */
export const API_KEY_HEADER = 'api-key';
export const AUTHORIZATION_HEADER = 'authorization';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like this change should break things but i'm not sure if we add both versions of the authorization header.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests passed and the api shoudn’t care about the casing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or what are you worried about will break?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the api shoudn’t care about the casing

I'm worried about this part. If we're using the same constant everywhere in the repo (which we probably do), i'm not surprised tests are working fine. Do we have a case that we pass this header manually from the outside of the sdk?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this is not a blocker though, just nitpicking)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me check how easy it is to undo the change. But we run integration tests so the API accepts the header

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then don't worry too much about it, we would be testing this sdk version anyway (and it would be almost instant to figure it out)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only place in fusion repo that we manually pass the authorization header: https://github.com/cognitedata/fusion/blob/a3b007c8255cb0475878f6767e95a658ba8c34d9/libs/shared/cogidp-sdk/src/lib/client.ts#L226-L228. But we're not using js sdk there so should be good imo

@BugGambit BugGambit merged commit f088e64 into release-v10 Sep 18, 2024
11 checks passed
@BugGambit BugGambit deleted the f1/remove_api_keys branch September 18, 2024 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants