Skip to content

Add singleton principle to RestService#198

Closed
Justin Wang (Claimundefine) wants to merge 1 commit intomasterfrom
DGS-19297-create-singleton-for-rest-client
Closed

Add singleton principle to RestService#198
Justin Wang (Claimundefine) wants to merge 1 commit intomasterfrom
DGS-19297-create-singleton-for-rest-client

Conversation

@Claimundefine
Copy link
Copy Markdown
Contributor

RestService would be created multiple times for both the DekRegistry and SchemaRegistry clients. This would specifically be an issue as the OAuth client would also be created twice, with two tokens to manage.

private oauthClient?: OAuthClient;
private oauthBearer: boolean = false;

constructor(baseURLs: string[], isForward?: boolean, axiosDefaults?: CreateAxiosDefaults,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This would normally be private, but this would break the jest mocks and RestService is not exposed to the user regardless.

@confluent-cla-assistant
Copy link
Copy Markdown

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

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