Documentation ¶
Index ¶
- func NewWoodpeckerServer(forge forge.Forge, queue queue.Queue, logger logging.Log, ...) proto.WoodpeckerServer
- type AgentTokenClaims
- type Authorizer
- type JWTManager
- type RPC
- func (s *RPC) Done(c context.Context, id string, state rpc.State) error
- func (s *RPC) Extend(c context.Context, id string) error
- func (s *RPC) Init(c context.Context, id string, state rpc.State) error
- func (s *RPC) Log(c context.Context, _logEntry *rpc.LogEntry) error
- func (s *RPC) Next(c context.Context, agentFilter rpc.Filter) (*rpc.Pipeline, error)
- func (s *RPC) RegisterAgent(ctx context.Context, platform, backend, version string, capacity int32) (int64, error)
- func (s *RPC) ReportHealth(ctx context.Context, status string) error
- func (s *RPC) Update(c context.Context, id string, state rpc.State) error
- func (s *RPC) Wait(c context.Context, id string) error
- type StreamContextWrapper
- type WoodpeckerAuthServer
- type WoodpeckerServer
- func (s *WoodpeckerServer) Done(c context.Context, req *proto.DoneRequest) (*proto.Empty, error)
- func (s *WoodpeckerServer) Extend(c context.Context, req *proto.ExtendRequest) (*proto.Empty, error)
- func (s *WoodpeckerServer) Init(c context.Context, req *proto.InitRequest) (*proto.Empty, error)
- func (s *WoodpeckerServer) Log(c context.Context, req *proto.LogRequest) (*proto.Empty, error)
- func (s *WoodpeckerServer) Next(c context.Context, req *proto.NextRequest) (*proto.NextResponse, error)
- func (s *WoodpeckerServer) RegisterAgent(c context.Context, req *proto.RegisterAgentRequest) (*proto.RegisterAgentResponse, error)
- func (s *WoodpeckerServer) ReportHealth(c context.Context, req *proto.ReportHealthRequest) (*proto.Empty, error)
- func (s *WoodpeckerServer) Update(c context.Context, req *proto.UpdateRequest) (*proto.Empty, error)
- func (s *WoodpeckerServer) Version(_ context.Context, _ *proto.Empty) (*proto.VersionResponse, error)
- func (s *WoodpeckerServer) Wait(c context.Context, req *proto.WaitRequest) (*proto.Empty, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AgentTokenClaims ¶
type AgentTokenClaims struct { jwt.RegisteredClaims AgentID int64 `json:"agent_id"` }
UserClaims is a custom JWT claims that contains some user's information
type Authorizer ¶
type Authorizer struct {
// contains filtered or unexported fields
}
func NewAuthorizer ¶
func NewAuthorizer(jwtManager *JWTManager) *Authorizer
func (*Authorizer) StreamInterceptor ¶
func (a *Authorizer) StreamInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
func (*Authorizer) UnaryInterceptor ¶
func (a *Authorizer) UnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)
type JWTManager ¶
type JWTManager struct {
// contains filtered or unexported fields
}
JWTManager is a JSON web token manager
func NewJWTManager ¶
func NewJWTManager(secretKey string) *JWTManager
NewJWTManager returns a new JWT manager
func (*JWTManager) Generate ¶
func (manager *JWTManager) Generate(agentID int64) (string, error)
Generate generates and signs a new token for a user
func (*JWTManager) Verify ¶
func (manager *JWTManager) Verify(accessToken string) (*AgentTokenClaims, error)
Verify verifies the access token string and return a user claim if the token is valid
type RPC ¶
type RPC struct {
// contains filtered or unexported fields
}
func (*RPC) RegisterAgent ¶
type StreamContextWrapper ¶
type StreamContextWrapper interface { grpc.ServerStream SetContext(context.Context) }
type WoodpeckerAuthServer ¶
type WoodpeckerAuthServer struct { proto.UnimplementedWoodpeckerAuthServer // contains filtered or unexported fields }
func NewWoodpeckerAuthServer ¶
func NewWoodpeckerAuthServer(jwtManager *JWTManager, agentMasterToken string, store store.Store) *WoodpeckerAuthServer
func (*WoodpeckerAuthServer) Auth ¶
func (s *WoodpeckerAuthServer) Auth(_ context.Context, req *proto.AuthRequest) (*proto.AuthResponse, error)
type WoodpeckerServer ¶
type WoodpeckerServer struct { proto.UnimplementedWoodpeckerServer // contains filtered or unexported fields }
WoodpeckerServer is a grpc server implementation.
func (*WoodpeckerServer) Done ¶
func (s *WoodpeckerServer) Done(c context.Context, req *proto.DoneRequest) (*proto.Empty, error)
func (*WoodpeckerServer) Extend ¶
func (s *WoodpeckerServer) Extend(c context.Context, req *proto.ExtendRequest) (*proto.Empty, error)
func (*WoodpeckerServer) Init ¶
func (s *WoodpeckerServer) Init(c context.Context, req *proto.InitRequest) (*proto.Empty, error)
func (*WoodpeckerServer) Log ¶
func (s *WoodpeckerServer) Log(c context.Context, req *proto.LogRequest) (*proto.Empty, error)
func (*WoodpeckerServer) Next ¶
func (s *WoodpeckerServer) Next(c context.Context, req *proto.NextRequest) (*proto.NextResponse, error)
func (*WoodpeckerServer) RegisterAgent ¶
func (s *WoodpeckerServer) RegisterAgent(c context.Context, req *proto.RegisterAgentRequest) (*proto.RegisterAgentResponse, error)
func (*WoodpeckerServer) ReportHealth ¶
func (s *WoodpeckerServer) ReportHealth(c context.Context, req *proto.ReportHealthRequest) (*proto.Empty, error)
func (*WoodpeckerServer) Update ¶
func (s *WoodpeckerServer) Update(c context.Context, req *proto.UpdateRequest) (*proto.Empty, error)
func (*WoodpeckerServer) Version ¶
func (s *WoodpeckerServer) Version(_ context.Context, _ *proto.Empty) (*proto.VersionResponse, error)
func (*WoodpeckerServer) Wait ¶
func (s *WoodpeckerServer) Wait(c context.Context, req *proto.WaitRequest) (*proto.Empty, error)
Click to show internal directories.
Click to hide internal directories.