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

feat(api): expose credentials in GET /integrations/:uniqueKey #3074

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bodinsamuel
Copy link
Collaborator

Changes

  • GET /integrations/:uniqueKey now expose credentials (optional)
    Some customers need the credentials for internal operations or oauth revoke. This expose optionally the credentials with some added security.

  • Try to fix IntegrationConfig type by creating a smaller scope for integration create
    This type is annoying, it's used a bit everywhere and everything is marked as undefined except it's null not undefined. Anyway, first steps since I needed better types.

@bodinsamuel bodinsamuel self-assigned this Nov 27, 2024
Copy link
Contributor

@nalanj nalanj left a comment

Choose a reason for hiding this comment

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

Looks good. Tested it locally and it worked great too.


export type NullablePartial<
TBase,
NK extends keyof TBase = { [K in keyof TBase]: null extends TBase[K] ? K : never }[keyof TBase],
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would rename NK TNullableKey to follow the same pattern and make it a bit more descriptive

TBase,
NK extends keyof TBase = { [K in keyof TBase]: null extends TBase[K] ? K : never }[keyof TBase],
NP = Partial<Pick<TBase, NK>> & Pick<TBase, Exclude<keyof TBase, NK>>
> = { [K in keyof NP]: NP[K] };
Copy link
Collaborator

@TBonnin TBonnin Nov 27, 2024

Choose a reason for hiding this comment

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

not sure you need NP. can we have

export type NullablePartial<
   TBase, 
   TNullableKeys ...
> = Omit<TBase, TNullableKeys> & Partial<Pick<TBase, TNullableKeys>>

Copy link
Collaborator

@TBonnin TBonnin left a comment

Choose a reason for hiding this comment

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

code looks good but I am not sure I understand the purpose of exposing integration credentials to the users when they are the ones who are providing those credentials in the first place

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