Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.

Add capabilities property #35

Closed
wants to merge 7 commits into from
Closed

Conversation

phillmac
Copy link
Contributor

@phillmac phillmac commented Jul 17, 2019

Define what optional functions are actually implemented in this controller, e.g. grant / revoke as a public static property

Define what optional functions are actually implemented in this controller
Fix property name collision with orbitdb-access-controller
orbitdb-access-controller has both grant and revoke implemented
eth-contract/deposit-contract has grant and revoke
eth-contract/cool-contract has grant and revoke
@shamb0t
Copy link
Contributor

shamb0t commented Jul 17, 2019

@phillmac Thanks for opening a PR. Can you elaborate on what you're trying to accomplish?

Also note that none of the access controllers currently support key revocation

@phillmac
Copy link
Contributor Author

Basically from the api standpoint, I have no visibility into the grant / revoke functions that are actually present on a given controller. It'd be useful to have the ability to report for e.g. If this controller has grant implemented.

@phillmac phillmac marked this pull request as ready for review July 17, 2019 09:04
@shamb0t
Copy link
Contributor

shamb0t commented Jul 17, 2019

@phillmac could the same be achieved by calling the capability of interest in a try-catch block in the http-api? Not all access-controllers are required to adhere to those capabilities, and if others are added wouldn't it require listing them all in the interface?

@phillmac
Copy link
Contributor Author

phillmac commented Jul 17, 2019

@shamb0t If the functions were just purely undefined and generated errors that'd be great, because the error would be feedback that the api call failed.
Currently the functions defined in the access-controller-interface silently return and to all apearances the api call suceeded.
See orbitdb-archive/orbit-db-http-api#20

@phillmac
Copy link
Contributor Author

As you said there would be some interface overhead in maintaining a list of what controllers have what functions. A better solution would be very welcome!

@shamb0t
Copy link
Contributor

shamb0t commented Jul 17, 2019

@phillmac ah yes ofc they are already in the interface....hmm perhaps a quick fix could be changing grant and revoke in the interface to return false instead of a noop? That way if its not overridden as in the ipfs-access-controller case it will return false

@phillmac
Copy link
Contributor Author

That'd be a lot better. I'll make another pr and close this one?

@shamb0t
Copy link
Contributor

shamb0t commented Jul 17, 2019

@phillmac that would be great!

@phillmac phillmac closed this Jul 17, 2019
@phillmac phillmac deleted the feat/defined-capabilities branch July 17, 2019 12:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants