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

Implement Capability{Reader,Keeper} traits #58

Closed
7 tasks
hu55a1n1 opened this issue Jan 14, 2022 · 0 comments · Fixed by informalsystems/hermes#1826
Closed
7 tasks

Implement Capability{Reader,Keeper} traits #58

hu55a1n1 opened this issue Jan 14, 2022 · 0 comments · Fixed by informalsystems/hermes#1826
Assignees

Comments

@hu55a1n1
Copy link
Contributor

hu55a1n1 commented Jan 14, 2022

Crate

ibc

Summary

The current implementation of ChannelReader::authenticated_capability() seems to assume a source authentication model. Also, the implementation is incomplete.

Proposal

Define Capability{Reader,Keeper} traits and add other related methods from ICS05. Make CapabilityReader a super-trait of ChannelReader and PortReader.

trait CapabilityReader {
    fn claim(name: String, capability: CapabilityKey);

    fn authenticate(&self, name: impl AsRef<str>, capability: &CapabilityKey) -> Result<(), Error>;
    
    // ...
}

pub trait PortReader: CapabilityReader {
    fn authenticate_capability(&self, port_id: PortId, capability: &CapabilityKey) -> Result<(), Error> {
        self.authenticate(Path::Ports(port_id), capability)
    }
    
    // ...
}

Acceptance Criteria

  • Implement all capability related methods from ICS05.
  • Allow lib users to decide if they'd like to opt for an object-capabilities model or source-authentication model.

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@hu55a1n1 hu55a1n1 changed the title Implement Capability{Reader,Keeper} traits and allow users to decide if they'd like to opt for an object-capabilities model or source-authentication model. Implement Capability{Reader,Keeper} traits Jan 14, 2022
@hu55a1n1 hu55a1n1 self-assigned this Jan 14, 2022
@hu55a1n1 hu55a1n1 transferred this issue from informalsystems/hermes Sep 29, 2022
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

Successfully merging a pull request may close this issue.

1 participant