Skip to content
This repository was archived by the owner on Feb 8, 2023. It is now read-only.
This repository was archived by the owner on Feb 8, 2023. It is now read-only.

Capability Service #274

@Stebalien

Description

@Stebalien

This came up in both #270 and #236.

Instead of implementing authentication in every protocol, it would be nice to have a simple service that negotiates capabilities out of band. At its core, this service would provide the simple interface:

type Capabilities interface {
    // Has checks if peer `p` has capability `cap`.
    // cap has the form `/ns/string`.
    Has(p peer.ID, cap Capability) bool
}
type CapabilityService interface {
    Capabilities

    // Register a handler for capabilities with namespace `ns`.
    Register(ns string, h Handler)
}

Other services could simply check capabilities by calling capService.Hash(peer, cap). The actual capability service would be responsible for determining if the peer has the capability (out of band).

@diasdavid IIRC, you were working on this. However, I can't find any relevant issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions