Documentation ¶
Index ¶
- Constants
- func HTTPConfigToProto(cfg pkgHttpClient.Config) (*pb.HttpConfig, error)
- func New(ctx context.Context, config Config, fileWatcher *fsnotify.Watcher, ...) (*service.Service, error)
- func NewMessageWithCode(code codes.Code) *pool.Message
- func NewStore(ctx context.Context, config mongodb.Config, fileWatcher *fsnotify.Watcher, ...) (*mongodb.Store, func(), error)
- func TLSConfigToProto(cfg pkgCertManagerClient.Config) (*pb.TlsConfig, error)
- type APIsConfig
- type AttestationMechanism
- type AuthHandler
- type AuthorizationConfig
- type AuthorizationProviderConfig
- type COAPConfig
- type CSR
- type ClientsConfig
- type CoapConfig
- type CoapGatewayConfig
- type Config
- type CredentialsRequest
- type DefaultAuthHandler
- type EnrollmentGroup
- type EnrollmentGroupConfig
- type EnrollmentGroups
- type EnrollmentGroupsCache
- func (c *EnrollmentGroupsCache) CheckExpirations(t time.Time)
- func (c *EnrollmentGroupsCache) Close()
- func (c *EnrollmentGroupsCache) GetEnrollmentGroup(ctx context.Context, chains [][]*x509.Certificate) (*EnrollmentGroup, bool, error)
- func (c *EnrollmentGroupsCache) GetEnrollmentGroupsByIssuerNames(ctx context.Context, issuerNames []string, ...) error
- type GrpcClientConfig
- type HTTPConfig
- type HubConfig
- type LinkedHub
- func (h *LinkedHub) Close()
- func (h *LinkedHub) GetToken(ctx context.Context, key string, urlValues map[string]string, ...) (*oauth2.Token, error)
- func (h *LinkedHub) GetTokenFromOAuth(ctx context.Context, urlValues map[string]string, ...) (*oauth2.Token, error)
- func (h *LinkedHub) Invalidate()
- func (h *LinkedHub) IsExpired(now time.Time) bool
- func (h *LinkedHub) Refresh(now time.Time)
- func (h *LinkedHub) SignIdentityCertificate(ctx context.Context, in *pbCA.SignCertificateRequest, opts ...grpc.CallOption) (*pbCA.SignCertificateResponse, error)
- type LinkedHubCache
- type LogConfig
- type Option
- type Options
- type ProvisionCloudConfigurationRequest
- type RequestHandle
- func (RequestHandle) DefaultHandler(_ context.Context, req *mux.Message, _ *Session, _ []*LinkedHub, ...) (*pool.Message, error)
- func (RequestHandle) ProcessACLs(_ context.Context, req *mux.Message, session *Session, linkedHubs []*LinkedHub, ...) (*pool.Message, error)
- func (RequestHandle) ProcessCloudConfiguration(ctx context.Context, req *mux.Message, session *Session, ...) (*pool.Message, error)
- func (RequestHandle) ProcessCredentials(ctx context.Context, req *mux.Message, session *Session, ...) (*pool.Message, error)
- func (RequestHandle) ProcessOwnership(_ context.Context, req *mux.Message, session *Session, _ []*LinkedHub, ...) (*pool.Message, error)
- func (RequestHandle) ProcessPlgdTime(_ context.Context, req *mux.Message, session *Session, _ []*LinkedHub, ...) (*pool.Message, error)
- type RequestHandler
- type Service
- type Session
- func (s *Session) Close() error
- func (s *Session) Context() context.Context
- func (s *Session) Debugf(fmt string, args ...interface{})
- func (s *Session) DeviceID() string
- func (s *Session) Errorf(fmt string, args ...interface{})
- func (s *Session) OnClose()
- func (s *Session) RemoteAddr() net.Addr
- func (s *Session) SetDeviceID(deviceID string)
- func (s *Session) String() string
- func (s *Session) WriteMessage(m *pool.Message) error
- type StorageConfig
- type X509
Constants ¶
View Source
const DPSTag = "dps"
Variables ¶
This section is empty.
Functions ¶
func HTTPConfigToProto ¶
func HTTPConfigToProto(cfg pkgHttpClient.Config) (*pb.HttpConfig, error)
func New ¶
func New(ctx context.Context, config Config, fileWatcher *fsnotify.Watcher, logger log.Logger, opts ...Option) (*service.Service, error)
New creates server.
func TLSConfigToProto ¶
func TLSConfigToProto(cfg pkgCertManagerClient.Config) (*pb.TlsConfig, error)
Types ¶
type APIsConfig ¶
type APIsConfig struct { COAP COAPConfig `yaml:"coap" json:"coap"` HTTP HTTPConfig `yaml:"http" json:"http"` }
func (*APIsConfig) Validate ¶
func (c *APIsConfig) Validate() error
type AttestationMechanism ¶
type AttestationMechanism struct {
X509 X509 `yaml:"x509" json:"x509"`
}
func (*AttestationMechanism) ToProto ¶
func (c *AttestationMechanism) ToProto() *pb.AttestationMechanism
type AuthHandler ¶
type AuthHandler interface { // tls.Config overrides VerifyPeerCertificate(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error VerifyConnection(tls.ConnectionState) error GetChainsCache() *cache.Cache[uint64, [][]*x509.Certificate] }
type AuthorizationConfig ¶
type AuthorizationConfig struct { OwnerClaim string `yaml:"ownerClaim" json:"ownerClaim"` DeviceIDClaim string `yaml:"deviceIDClaim" json:"deviceIdClaim"` Provider AuthorizationProviderConfig `yaml:"provider" json:"provider"` }
func (*AuthorizationConfig) ToProto ¶
func (c *AuthorizationConfig) ToProto() (*pb.AuthorizationConfig, error)
type AuthorizationProviderConfig ¶
type AuthorizationProviderConfig struct { Name string `yaml:"name" json:"name"` clientcredentials.Config `yaml:",inline"` }
func (*AuthorizationProviderConfig) ToProto ¶
func (c *AuthorizationProviderConfig) ToProto() (*pb.AuthorizationProviderConfig, error)
type COAPConfig ¶
type COAPConfig struct {
pkgCoapService.Config `yaml:",inline" json:",inline"`
}
func (*COAPConfig) Validate ¶
func (c *COAPConfig) Validate() error
type CSR ¶
type CSR struct { Encoding csr.CertificateEncoding `json:"encoding"` Data string `json:"data"` }
type ClientsConfig ¶
type ClientsConfig struct { Storage StorageConfig `yaml:"storage" json:"storage"` OpenTelemetryCollector pkgHttp.OpenTelemetryCollectorConfig `yaml:"openTelemetryCollector" json:"openTelemetryCollector"` }
func (*ClientsConfig) Validate ¶
func (c *ClientsConfig) Validate() error
type CoapConfig ¶
type CoapConfig struct {
Address string `yaml:"address" json:"address"`
}
func (*CoapConfig) Validate ¶
func (c *CoapConfig) Validate() error
type CoapGatewayConfig ¶
type CoapGatewayConfig struct { COAP CoapConfig `yaml:"coap" json:"coap"` ProviderName string `yaml:"providerName" json:"providerName"` }
func (*CoapGatewayConfig) Validate ¶
func (c *CoapGatewayConfig) Validate() error
type Config ¶
type Config struct { Log LogConfig `yaml:"log" json:"log"` APIs APIsConfig `yaml:"apis" json:"apis"` Clients ClientsConfig `yaml:"clients" json:"clients"` EnrollmentGroups EnrollmentGroups `yaml:"enrollmentGroups" json:"enrollmentGroups"` }
Config represents application configuration
type CredentialsRequest ¶
type DefaultAuthHandler ¶
type DefaultAuthHandler struct {
// contains filtered or unexported fields
}
func MakeDefaultAuthHandler ¶
func MakeDefaultAuthHandler(config Config, enrollmentGroupsCache *EnrollmentGroupsCache) DefaultAuthHandler
func (DefaultAuthHandler) GetChainsCache ¶
func (d DefaultAuthHandler) GetChainsCache() *cache.Cache[uint64, [][]*x509.Certificate]
func (DefaultAuthHandler) VerifyConnection ¶
func (d DefaultAuthHandler) VerifyConnection(tls.ConnectionState) error
func (DefaultAuthHandler) VerifyPeerCertificate ¶
func (d DefaultAuthHandler) VerifyPeerCertificate(rawCerts [][]byte, _ [][]*x509.Certificate) error
type EnrollmentGroup ¶
type EnrollmentGroup struct { *pb.EnrollmentGroup AttestationMechanismX509CertificateChain []*x509.Certificate // contains filtered or unexported fields }
type EnrollmentGroupConfig ¶
type EnrollmentGroupConfig struct { ID string `yaml:"id" json:"id"` Owner string `yaml:"owner" json:"owner"` AttestationMechanism AttestationMechanism `yaml:"attestationMechanism" json:"attestationMechanism"` Hub HubConfig `yaml:"hub" json:"hub"` Hubs []HubConfig `yaml:"hubs" json:"hubs"` Name string `yaml:"name" json:"name"` }
func (*EnrollmentGroupConfig) String ¶
func (e *EnrollmentGroupConfig) String() string
func (*EnrollmentGroupConfig) ToProto ¶
func (e *EnrollmentGroupConfig) ToProto() (*pb.EnrollmentGroup, []*pb.Hub, error)
func (*EnrollmentGroupConfig) Validate ¶
func (e *EnrollmentGroupConfig) Validate() error
type EnrollmentGroups ¶
type EnrollmentGroups []EnrollmentGroupConfig
func (EnrollmentGroups) FindByID ¶
func (g EnrollmentGroups) FindByID(id string) (EnrollmentGroupConfig, bool)
type EnrollmentGroupsCache ¶
type EnrollmentGroupsCache struct {
// contains filtered or unexported fields
}
func (*EnrollmentGroupsCache) CheckExpirations ¶
func (c *EnrollmentGroupsCache) CheckExpirations(t time.Time)
func (*EnrollmentGroupsCache) Close ¶
func (c *EnrollmentGroupsCache) Close()
func (*EnrollmentGroupsCache) GetEnrollmentGroup ¶
func (c *EnrollmentGroupsCache) GetEnrollmentGroup(ctx context.Context, chains [][]*x509.Certificate) (*EnrollmentGroup, bool, error)
func (*EnrollmentGroupsCache) GetEnrollmentGroupsByIssuerNames ¶
func (c *EnrollmentGroupsCache) GetEnrollmentGroupsByIssuerNames(ctx context.Context, issuerNames []string, onEnrollmentGroup func(g *EnrollmentGroup) bool) error
type GrpcClientConfig ¶
func (*GrpcClientConfig) ToProto ¶
func (c *GrpcClientConfig) ToProto() (*pb.GrpcClientConfig, error)
func (*GrpcClientConfig) Validate ¶
func (c *GrpcClientConfig) Validate() error
type HTTPConfig ¶
type HTTPConfig struct { http.Config `yaml:",inline"` Enabled bool `yaml:"enabled" json:"enabled"` }
func (*HTTPConfig) Validate ¶
func (c *HTTPConfig) Validate() error
type HubConfig ¶
type HubConfig struct { ID string `yaml:"id" json:"id"` HubID string `yaml:"hubID" json:"hubId"` CoapGateway string `yaml:"coapGateway" json:"coapGateway"` Gateways []string `yaml:"gateways" json:"gateways"` CertificateAuthority GrpcClientConfig `yaml:"certificateAuthority" json:"certificateAuthority"` Authorization AuthorizationConfig `yaml:"authorization" json:"authorization"` Name string `yaml:"name" json:"name"` }
type LinkedHub ¶
type LinkedHub struct {
// contains filtered or unexported fields
}
func NewLinkedHub ¶
func (*LinkedHub) GetTokenFromOAuth ¶
func (*LinkedHub) Invalidate ¶
func (h *LinkedHub) Invalidate()
func (*LinkedHub) SignIdentityCertificate ¶
func (h *LinkedHub) SignIdentityCertificate(ctx context.Context, in *pbCA.SignCertificateRequest, opts ...grpc.CallOption) (*pbCA.SignCertificateResponse, error)
type LinkedHubCache ¶
type LinkedHubCache struct {
// contains filtered or unexported fields
}
func NewLinkedHubCache ¶
func (*LinkedHubCache) Close ¶
func (c *LinkedHubCache) Close()
func (*LinkedHubCache) GetHubs ¶
func (c *LinkedHubCache) GetHubs(ctx context.Context, eg *EnrollmentGroup) ([]*LinkedHub, error)
type Option ¶
func WithAuthHandler ¶
func WithAuthHandler(authHandler AuthHandler) Option
Override default authorization handler
func WithRequestHandler ¶
func WithRequestHandler(requestHandler RequestHandler) Option
Override default request handler
type RequestHandle ¶
type RequestHandle struct{}
func (RequestHandle) DefaultHandler ¶
func (RequestHandle) ProcessACLs ¶
func (RequestHandle) ProcessCloudConfiguration ¶
func (RequestHandle) ProcessCredentials ¶
func (RequestHandle) ProcessOwnership ¶
func (RequestHandle) ProcessPlgdTime ¶
type RequestHandler ¶
type RequestHandler interface { DefaultHandler(ctx context.Context, req *mux.Message, session *Session, linkedHub []*LinkedHub, group *EnrollmentGroup) (*pool.Message, error) ProcessOwnership(ctx context.Context, req *mux.Message, session *Session, linkedHub []*LinkedHub, group *EnrollmentGroup) (*pool.Message, error) ProcessCredentials(ctx context.Context, req *mux.Message, session *Session, linkedHub []*LinkedHub, group *EnrollmentGroup) (*pool.Message, error) ProcessACLs(ctx context.Context, req *mux.Message, session *Session, linkedHub []*LinkedHub, group *EnrollmentGroup) (*pool.Message, error) ProcessCloudConfiguration(ctx context.Context, req *mux.Message, session *Session, linkedHub []*LinkedHub, group *EnrollmentGroup) (*pool.Message, error) ProcessPlgdTime(ctx context.Context, req *mux.Message, session *Session, linkedHub []*LinkedHub, group *EnrollmentGroup) (*pool.Message, error) }
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents a setup of connection
func (*Session) OnClose ¶
func (s *Session) OnClose()
OnClose action when coap connection was closed.
func (*Session) RemoteAddr ¶
func (*Session) SetDeviceID ¶
type StorageConfig ¶
type StorageConfig struct { // expiration time of cached DB records CacheExpiration time.Duration `yaml:"cacheExpiration" json:"cacheExpiration"` MongoDB mongodb.Config `yaml:"mongoDB" json:"mongoDb"` //nolint:tagliatelle }
func (*StorageConfig) Validate ¶
func (c *StorageConfig) Validate() error
type X509 ¶
type X509 struct { CertificateChain urischeme.URIScheme `yaml:"certificateChain" json:"certificateChain"` LeadCertificateName string `yaml:"leadCertificateName" json:"leadCertificateName"` ExpiredCertificateEnabled bool `yaml:"expiredCertificateEnabled" json:"expiredCertificateEnabled"` }
func (*X509) ToProto ¶
func (c *X509) ToProto() *pb.X509Configuration
Source Files ¶
Click to show internal directories.
Click to hide internal directories.