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

Allow API keys to be passed into directive #2

Closed
stanica opened this issue Sep 21, 2017 · 6 comments
Closed

Allow API keys to be passed into directive #2

stanica opened this issue Sep 21, 2017 · 6 comments

Comments

@stanica
Copy link

stanica commented Sep 21, 2017

I'd like to use this reservation system with multiple vendors. Each vendor will have a unique API key that must be used when calling an endpoint, so I need some way to pass the API key to this module. Do you have plans on adding this feature or should I add it myself?

@hmartos
Copy link
Owner

hmartos commented Sep 22, 2017

The truth is that I didn't think about it, but it seems to be a cool feature for this module.
I understand that you need to pass the API key to the getAvailableHours and reserve requests, so you can check it in your endpoint, but how do you plan to pass it, as a header of the request?.

Anyway, feel free to develop it by yourself and make a pull request, if you need some help I can point you to the right direction!! ;-)

@hmartos hmartos closed this as completed Sep 22, 2017
@hmartos hmartos reopened this Sep 22, 2017
@stanica
Copy link
Author

stanica commented Sep 22, 2017

The API I'm using lets me pass the API key as a request parameter in the URL or as an HTTP request header. I'll decide which to use after I poke around your module and see what's easier.

@hmartos
Copy link
Owner

hmartos commented Sep 23, 2017

I think it could be a cleaner solution in a header param of the request. It should be sent along with the requests if API key it is defined and not sent if it is not defined.

The starting point would be the directive, then you will have it available in controller and finally you can pass it to the factory as a parameter and send it in the requests.

I hope this help you!

@stanica
Copy link
Author

stanica commented Sep 25, 2017

Thanks for the tips!

In addition to the API key I also have a secret key that I can't expose on the client, so I'll need to make my own endpoints for consuming the vendor's API. I also need to integrate multiple vendors, so at minimum I need to pass in a vendor identifier.

I'm thinking it will be easier if I fork the repo and continue working on the module separately so I don't clutter yours up with my requirements.

@hmartos
Copy link
Owner

hmartos commented Sep 25, 2017

Yeah, I think it could be a good idea to fork the repo like you say.

Any question you have you can post it here and I will be glad to help you if I can!

@hmartos hmartos closed this as completed Sep 25, 2017
@stanica
Copy link
Author

stanica commented Sep 26, 2017

Cheers!

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