treeben77 / rblx-open-cloud

API Wrapper for Roblox Open Cloud in Python
https://devforum.roblox.com/t/1991959
MIT License
19 stars 2 forks source link

The ability to set the API key globally #9

Closed logixism closed 1 year ago

logixism commented 1 year ago

Hi! I think it'd be nice if you could set the API key as an attribute perhaps, so you wouldn't have to specify it in every method you call. I.e: rblxopencloud.API_KEY = "foobar" However, it should still be possible to specify the API key in a method.

I'm sorry if this already exists, however I did not see it in your docs!

Thanks for reading my suggestion.

treeben77 commented 1 year ago

I actually originally had this functionality, but I changed it because I didn't like how that worked, and thought it was fairly unnecessary in most use cases. Another problem I face is that is that OAuth2 objects might break if it is used.

However, I will try to implement it into the library when I get a chance.

treeben77 commented 1 year ago

Thank you for your suggestion to the library, however it does raise a small security risk allowing the API token to be set in the library (it would be able to be accessed from all code the can access the module). It would also be confusing having the multiple methods of providing the API keys.

If you keep your security keys in environment values it's not too hard to provide it to each job.