stackvana / hook.io

Open-Source Microservice Hosting Platform
https://hook.io
Other
1.26k stars 117 forks source link

Can't read /services with api key #251

Closed pyhedgehog closed 7 years ago

pyhedgehog commented 8 years ago

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 commented 8 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

Marak commented 7 years ago

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

Noted. Thank you.

pyhedgehog commented 7 years ago

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

Marak commented 7 years ago

That's fixed locally now.

Marak commented 7 years ago

Is auto-enumerated from resource definition.

pyhedgehog commented 7 years ago

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

Marak commented 7 years ago

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 commented 7 years ago

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

pyhedgehog commented 7 years ago

Cool. stack is more important.

Marak commented 7 years ago

@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 commented 7 years ago

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

for reference. working the dev branch

Marak commented 7 years ago

@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.