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

Can't read /services with api key #251

Closed
pyhedgehog opened this issue Jun 7, 2016 · 15 comments
Closed

Can't read /services with api key #251

pyhedgehog opened this issue Jun 7, 2016 · 15 comments

Comments

@pyhedgehog
Copy link

pyhedgehog commented Jun 7, 2016

I have a correct $hook_private_key but /services has no hooks listed:

$ python2.7 -m hookio keys checkAccess hook::view::read
{
  "hasAccess": true
}

$ python2.7 -m hookio account services

$ 

When I'm using /login, everything works fine:

$ hook_private_key= python2.7 -m hookio --login $hookio_login account services
pythonsdktest/80e2416a-a987-417c-bd65-7368eb43df31-5A9D9260-bug
pythonsdktest/80e2416aa987417cbd657368eb43df311609CA9Ebug
pythonsdktest/80e2416aa987417cbd657368eb43df312E1D7A5Ebug
pythonsdktest/BUG237test09
pythonsdktest/estABCDEFGH_bug237test08
pythonsdktest/hooktest
...
@pyhedgehog
Copy link
Author

There are related problem - I haven't found how to get owner of key. Even worse - fake header x-hookio-user-session-name is anonymous for api requests.
I've checked that if x-hookio-user-session-name set in request it's ignored. But it's replaced by anonymous instead of key owner.

@Marak
Copy link
Collaborator

Marak commented Sep 11, 2016

This appears to be resolved locally and working in the new version of SDK.

Will update / close this issue when the deployment is live.

Marak added a commit that referenced this issue Sep 11, 2016
  * Can now list / find services using API
  * Using RBAC logic with new role "hook::find"
@Marak
Copy link
Collaborator

Marak commented Sep 11, 2016

Okay, the new role for listing / searching services is called hook::find.

Will continue to polish this and have it ready for next release.

@pyhedgehog
Copy link
Author

Old internal keys ({..., "name": "api-access-key", "key_type": "internal", ...}) don't have hook::find role. Related to #243.

@Marak
Copy link
Collaborator

Marak commented Sep 30, 2016

I will be sure to run a migration script which generates all new roles for the old internal keys.

Noted. Thank you.

@pyhedgehog
Copy link
Author

pyhedgehog commented Sep 30, 2016

Also /keys interface not yet has checkbox for hook::find role.

@Marak
Copy link
Collaborator

Marak commented Sep 30, 2016

That's fixed locally now.

@Marak
Copy link
Collaborator

Marak commented Sep 30, 2016

Is auto-enumerated from resource definition.

@pyhedgehog
Copy link
Author

pyhedgehog commented Sep 30, 2016

And should we have another issue for request interface+API for editing existing keys?

@Marak
Copy link
Collaborator

Marak commented Sep 30, 2016

Is refactored already.

see: https://github.com/bigcompany/hook.io/tree/master/view/keys

More tests I have locally.

Should work with JSON now.

We need to get docker or vagrant working for developers to do local dev...

@Marak
Copy link
Collaborator

Marak commented Sep 30, 2016

Release is coming soon. Been very busy with stack refactor into hook.io.

@pyhedgehog
Copy link
Author

Cool. stack is more important.

@Marak
Copy link
Collaborator

Marak commented Sep 30, 2016

@pyhedgehog - Please check out python and python3 binaries to see if we can integrate hook.io SDK

If you can make single request work I can start to update with new APIs.

https://github.com/Stackvana/stack/blob/master/bin/binaries/python
https://github.com/Stackvana/stack/blob/master/bin/binaries/python3

@Marak
Copy link
Collaborator

Marak commented Sep 30, 2016

Can also look at : https://github.com/bigcompany/hook.io-sdk/tree/dev

for reference. working the dev branch

@Marak
Copy link
Collaborator

Marak commented Dec 30, 2016

@pyhedgehog

I've completely revamped the API and keys API.

This should be resolved in production now.

Working API calls should exist for all endpoints here: https://github.com/bigcompany/hook.io-sdk/tree/master/examples

Please let me know if you still not able to read the data you need.

@Marak Marak closed this as completed Dec 30, 2016
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