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

New config option to define which platform methods require the credentials option passed in. #344

Merged
merged 5 commits into from Mar 11, 2021

Conversation

silverbucket
Copy link
Member

Currently credentials are passed in to every platform function which were previously used to access the appropriate client instance or re-connect if needed. The architecture has progressively moved away from that to simply destroying and restarting the platform if the connection is lost. This PR adds a requireCredentials property to the platform config, which is an array listing every method that needs the credentials object passed in. For now, all functions are defined, but as the client internals of each platform is improved we can slowly remove methods from the list.
Resolves #287

@silverbucket silverbucket added type:feature kredits-2 Medium contribution labels Mar 10, 2021
@silverbucket silverbucket added this to the Core milestone Mar 10, 2021
@silverbucket silverbucket self-assigned this Mar 10, 2021
Copy link
Contributor

@galfert galfert 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 to me. Just left a suggestion for changing (simplifying) a code comment.

packages/sockethub/src/platform.ts Outdated Show resolved Hide resolved
@silverbucket silverbucket merged commit d344993 into master Mar 11, 2021
@silverbucket silverbucket deleted the pass-credentials-config branch March 11, 2021 22:59
silverbucket added a commit that referenced this pull request Mar 16, 2021
…tials option passed in. (#344)

* use requireCredentials property to define which platform methods need the credentials object passed in

Co-authored-by: Garret Alfert <alfert@wevelop.de>

Co-authored-by: Garret Alfert <alfert@wevelop.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kredits-2 Medium contribution type:feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove passing of credentials on each platform method
2 participants