dfinity / interface-spec

IC Interface Specification
https://khsfq-wqaaa-aaaak-qckvq-cai.icp0.io/docs
37 stars 20 forks source link

feat: Add a system api call to check whether a given principal is a controller #141

Closed dsarlis closed 1 year ago

dsarlis commented 1 year ago

This PR adds a new system api call to allow a canister to check whether a given principal is one of its own controllers. This is a useful check for canisters and it has come up in various contexts, for example when canisters want to perform some access control on their methods based on whether the caller is a controller.

netlify[bot] commented 1 year ago

Deploy Preview for ic-interface-spec ready!

Name Link
Latest commit 3f6ca9fd838467ea35ce907c875232d9ae79a2c8
Latest deploy log https://app.netlify.com/sites/ic-interface-spec/deploys/642c2a2539a582000862700d
Deploy Preview https://deploy-preview-141--ic-interface-spec.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Dfinity-Bjoern commented 1 year ago

Discussed in the interface spec meeting; we weren't sure about possible use cases for a more generic API that allows to get all controllers. @bogwar will get input from the developer forum.

dsarlis commented 1 year ago

Discussed in the interface spec meeting; we weren't sure about possible use cases for a more generic API that allows to get all controllers. @bogwar will get input from the developer forum.

I'm fine with asking but let's make sure we ask the right question. What I mean: if we ask, do you want a more generic API that gives you the list of controllers, nobody is gonna say no (people will always say give me more basically). But if we ask: between the two options, is the is_controller enough for almost everything and what does a more generic API add (if anything), that's a better way to phrase this imo. The more generic API is also more complicated, it will need 3 methods to properly return a "list" of controllers, so we should have really strong use cases to go for it. cc @bogwar

bogwar commented 1 year ago

Definitely — thanks for the suggestion Dimitris

On Tue, 28 Feb 2023 at 16:08, Dimitris Sarlis @.***> wrote:

Discussed in the interface spec meeting; we weren't sure about possible use cases for a more generic API that allows to get all controllers. @bogwar https://github.com/bogwar will get input from the developer forum.

I'm fine with asking but let's make sure we ask the right question. What I mean: if we ask, do you want a more generic API that gives you the list of controllers, nobody is gonna say no (people will always say give me more basically). But if we ask: between the two options, is the is_controller enough for almost everything and what does a more generic API add (if anything), that's a better way to phrase this imo. The more generic API is also more complicated, it will need 3 methods to properly return a "list" of controllers, so we should have really strong use cases to go for it. cc @bogwar https://github.com/bogwar

— Reply to this email directly, view it on GitHub https://github.com/dfinity/interface-spec/pull/141#issuecomment-1448350866, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMHTG7HZEHUQX4CSUGLMP2TWZYIFFANCNFSM6AAAAAAVKSGCWI . You are receiving this because you were mentioned.Message ID: @.***>