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

Question: multiple auth credentials #135

Open
jordanh opened this issue Oct 30, 2016 · 3 comments
Open

Question: multiple auth credentials #135

jordanh opened this issue Oct 30, 2016 · 3 comments

Comments

@jordanh
Copy link
Contributor

jordanh commented Oct 30, 2016

Imagine as though you wanted to make a Slackbot. Let's assert folks using the Slackbot go through a step to store their unique authentication credentials (i.e. a JWT token) with the Slackbot so that when it interacts with the service that feeds the Slackbot data, it does so with their identity.

Now, imagine as though to implement this Slackbot one wanted to use Cashay—in part because the API the Slackbot wishes to interact with behind the scenes is a GraphQL API, but also because Cashay's pub/sub pattern and redux bindings make for a wonderful foundation for building a stateful bot.

Presently Cashay.js exports a singleton like:

export default new Cashay();

If I wanted to use Cashay to implement this Slackbot, I think I'd need to create and track multiple Cashay instances (one per set of user authentication credentials), right? Could the cashay module export the class definition so I can create new instances myself?

Is there another pattern I should consider?

@mattkrick
Copy link
Owner

cashay.query({transport: myTransport}).

But I don't get it. Cashay is for the client. Why would one client have many auths?

@jordanh
Copy link
Contributor Author

jordanh commented Oct 31, 2016

I'm exploring using Cashay more generally as a GraphQL client embedded within a micro-service. In this case, a server that implements a chatbot. Let's talk about it!

@mattkrick
Copy link
Owner

I'll be back at the desk in about an hour, let's chat then. I've got no
clue what a client side microservice looks like!

On Oct 31, 2016 11:11 AM, "Jordan Husney" [email protected] wrote:

I'm exploring using Cashay more generally as a GraphQL client embedded
within a micro-service. In this case, a server that implements a chatbot.
Let's talk about it!


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#135 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFQjv8d7z-gqjaySTvPOWOs7NR3e49Hnks5q5i9OgaJpZM4KkiZa
.

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

No branches or pull requests

2 participants