Documentation ¶
Index ¶
- Constants
- func FetchAccessToken(addr, key, secret string) (string, error)
- func Mux(addr string) (http.Handler, error)
- func NewService(opts Opts) (srv.Service, error)
- type Client
- type Opts
- type Service
- func (s *Service) Access(ctx context.Context, tok *pbf.Token) (*pbf.Token, error)
- func (s *Service) Certificate(ctx context.Context, in *pbf.Trainer) (*pbf.Cert, error)
- func (s *Service) Enter(ctx context.Context, in *pbf.Trainer) (*pbf.Token, error)
- func (s *Service) GetTrainer(ctx context.Context, in *pbf.Trainer) (*pbf.Trainer, error)
- func (s *Service) Listen() error
- func (s *Service) Name() string
- func (s *Service) Register(ctx context.Context, in *pbf.Trainer) (out *pbf.Trainer, err error)
- func (s *Service) UpdateTrainer(ctx context.Context, in *pbf.Trainer) (*pbf.Trainer, error)
- func (s *Service) Version() string
Constants ¶
const ( Issuer = "buckhx.safari.registry" TokenDur = 24 * time.Hour ProfScope = "role:prof" ServiceScope = "role:svc" )
Variables ¶
This section is empty.
Functions ¶
func FetchAccessToken ¶
Types ¶
type Client ¶
type Client struct { pbf.RegistryClient *grpc.ClientConn // contains filtered or unexported fields }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) Access ¶
Enter authenticates a user to retrieve a an access token to authorize requests for a safari TODO figure out if BasicAuth should be used
body must contain key & secret keys
func (*Service) Certificate ¶
Certificate returns the cert used to verify token signatures
The cert is in JWK form as described in https://tools.ietf.org/html/rfc7517
func (*Service) Enter ¶
Enter authenticates a user to retrieve a an access token to authorize requests for a safari TODO determine if the body of this method should move into the auth package
HTTPS required w/ HTTP basic access authentication via a header Authorization: Basic BASE64({uid:pass})
func (*Service) GetTrainer ¶
GetTrainer fetchs a trainer
The populated fields will depend on the auth scope of the token
func (*Service) Register ¶
Register makes a creates a new trainer in the safari
Trainer name, password, age & gender are required. Any other supplied fields will be ignored
func (*Service) UpdateTrainer ¶
UpdateTrainer updates a trainer
The following fields can be updated w/ this method: Pc