Download the PHP package thesis/grpc-auth without Composer
On this page you can find all versions of the php package thesis/grpc-auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thesis/grpc-auth
More information about thesis/grpc-auth
Files in thesis/grpc-auth
Package grpc-auth
Short Description Authentication interceptors for thesis/grpc: pluggable per-call credentials on the client, request verification on the server, unary & stream.
License MIT
Informations about the package grpc-auth
thesis/grpc-auth
Authentication interceptors for thesis/grpc: the client attaches
credentials to every outgoing call, the server verifies them and rejects unauthenticated calls with
UNAUTHENTICATED — both for unary and streaming RPCs.
Contents
- Installation
- Usage
- StaticAuth
- Custom credentials and authenticators
Installation
Usage
Two interceptors, one per side. The client one takes Credentials (what to attach), the server one an Authenticator (how to verify). StaticAuth is both, so a shared secret wires up both ends:
The server interceptor runs the authenticator before the handler, so an unauthenticated call never reaches your service.
StaticAuth
StaticAuth is a fixed shared-secret credential sent in the authorization header as
"<scheme> <secret>". It implements both Credentials and Authenticator: on the client it attaches
the header, on the server it matches the scheme case-insensitively (per RFC 7235) and compares only the
secret in constant time (hash_equals).
Custom credentials and authenticators
Implement Credentials for a client that fetches or rotates a token per call (e.g. OAuth). It is
resolved on every call and may use the Cancellation to bound the work:
Implement Authenticator for server-side verification, validate the metadata and throw
InvokeError(Code::UNAUTHENTICATED) when it fails:
All versions of grpc-auth with dependencies
amphp/amp Version ^3.1
thesis/googleapis-rpc-types Version ^0.2
thesis/grpc-client Version ^0.2
thesis/grpc-protocol Version ^0.2
thesis/grpc-server Version ^0.2