Documentation
¶
Overview ¶
Package auth aims to provide authentication primitives against applications and services of the Axone network.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticatedHandler ¶
type AuthenticatedHandler func(*Identity, http.ResponseWriter, *http.Request)
AuthenticatedHandler is a handler that requires an authenticated user.
It is intended to be used in combination with a middleware handler that verifies the user's identity, for example with the jwt middleware:
jwtFactory.VerifyHTTPMiddleware(func(id *auth.Identity, w http.ResponseWriter, r *http.Request) { // Your handler logic here })
type Identity ¶
Identity denotes an identity that has been authenticated, which may contain some resolved authorizations.
type Proxy ¶
type Proxy interface { // Authenticate verifies the authenticity and integrity of the provided credential before resolving on-chain // authorized actions with the proxied service by querying the service's governance. Authenticate(ctx context.Context, credential []byte) (*Identity, error) }
Proxy acts as the entrypoint of a service and is responsible for authenticating any identity willing to conduct some actions against the underlying service. It authenticates Decentralized Identities based on a provided Verifiable Credential and resolving allowed authorized actions for this identity based on on-chain rules. It is not responsible or aware of the communication protocol, which means it only returns information on the identity if authentic and won't for example issue a JWT token, this is out of its scope.
func NewProxy ¶
func NewProxy(govAddr, serviceID string, dvClient dataverse.QueryClient, authParser credential.Parser[*credential.AuthClaim], ) Proxy
NewProxy creates a new Proxy instance using the given service identifier and on-chain governance address (i.e. the law-stone smart contract instance carrying its rules).