Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthClaims ¶
type AuthClaims struct {
jwt.StandardClaims
}
AuthClaims defines standard claims for authentication.
type Service ¶
type Service struct { pb.UnimplementedAuthAPIServiceServer Config Deps // contains filtered or unexported fields }
Service is a gRPC service for authorization.
func (*Service) Auth ¶
func (s *Service) Auth(ctx context.Context, req *pb.AuthRequest) (*pb.AuthResponse, error)
Auth authenticates a user storage request. It detects raw bearer tokens or JTWs associated with the NEAR blockchain. The latter is an URL encoded base64 JWT with an Ed25519 signature. 1. Validates the JWT 2. Validates that the key DID in the JWT ("sub" in the payload) was created with the public key ("x" in the header) 3. Validates that the user has locked funds on-chain using a service provided by neard. It returns the key DID.
Click to show internal directories.
Click to hide internal directories.