{"modulePath":"github.com/LinuxGit/kops","version":"v1.15.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package server\n\n## Constants\n\n```go\nconst (\n\t// Version is the server version\n\tVersion = \"v0.0.4\"\n)\n```\n\n## Variables\n\n```go\nvar (\n\t// CheckRegistration indicates we should validate the node is not regestered\n\tCheckRegistration = \"verify-registration\"\n)\n```\n\n## Types\n\n```go\ntype Authorizer interface {\n\t// Admit is responsible for checking if the request is permitted\n\tAuthorize(context.Context, *NodeRegistration) error\n\t// Close provides a signal to close of resources\n\tClose() error\n\t// Name returns the name of the authorizer\n\tName() string\n}\n```\nAuthorizer is the generic means to authorize the incoming node request\n\n```go\ntype Config struct {\n\t// AuthorizationTimeout is the max duration for a authorization\n\tAuthorizationTimeout time.Duration\n\t// ClusterTag is the cloud tag key used to identity the cluster\n\tClusterTag string\n\t// Features is arbitrary feature set for a authorizer\n\tFeatures []string\n\t// EnableVerbose indicate verbose logging\n\tEnableVerbose bool\n\t// ClientCommonName is the common name on the client certificate if mutual tls is enabled\n\tClientCommonName string\n\t// ClusterName is the name of the kubernetes cluster\n\tClusterName string\n\t// Listen is the interacted to bind to\n\tListen string\n\t// TokenDuration is the expiration of a bootstrap token\n\tTokenDuration time.Duration\n\t// TLSCertPath is the path to the server TLS certificate\n\tTLSCertPath string\n\t// TLSClientCAPath is the path to a certificate authority\n\tTLSClientCAPath string\n\t// TLSPrivateKeyPath is the path to the private key\n\tTLSPrivateKeyPath string\n}\n```\nConfig is the configuration for the service\n\n```go\nfunc (c *Config) IsValid() error\n```\nIsValid checks the configuration options\n\n```go\nfunc (c *Config) UseFeature(name string) bool\n```\nUseFeature indicates a feature is in use\n\n```go\ntype NodeAuthorizer struct {\n\t// contains filtered or unexported fields\n}\n```\nNodeAuthorizer retains the authorizer state\n\n```go\nfunc New(config *Config, authorizer Authorizer) (*NodeAuthorizer, error)\n```\nNew creates and returns a node authorizer\n\n```go\nfunc (n *NodeAuthorizer) Run() error\n```\nRun is responsible for starting the node authorizer service\n\n```go\ntype NodeRegistration struct {\n\t// Spec is the request specification\n\tSpec NodeRegistrationSpec\n\t// Status is the result of a admission\n\tStatus NodeRegistrationStatus\n}\n```\nNodeRegistration is an incomming request\n\n```go\nfunc (n *NodeRegistration) Deny(reason string)\n```\nDeny marks the request as denied and adds the reason why\n\n```go\nfunc (n *NodeRegistration) IsAllowed() bool\n```\nIsAllowed checks if the request if allowed\n\n```go\ntype NodeRegistrationSpec struct {\n\t// NodeName is the name of the node\n\tNodeName string\n\t// RemoteAddr is the address of the requester\n\tRemoteAddr string\n\t// Request is the request body\n\tRequest []byte\n}\n```\nNodeRegistrationSpec is the node request specification\n\n```go\ntype NodeRegistrationStatus struct {\n\t// Allowed indicates the request is permitted\n\tAllowed bool\n\t// Token is the bootstrap token\n\tToken string\n\t// Reason is the reason for the error if any\n\tReason string\n}\n```\nNodeRegistrationStatus is result of a authorization\n\n```go\ntype Token struct {\n\t// ID is the id of the token\n\tID string\n\t// Secret is the secret of the token\n\tSecret string\n}\n```\nToken defines a bootstrap token\n\n```go\nfunc NewToken() (*Token, error)\n```\nNewToken creates and returns a new token\n\n```go\nfunc (t *Token) Name() string\n```\nName returns the secret name\n\n```go\nfunc (t *Token) String() string\n```\nString returns the encoded secret\n\n```go\ntype Verifier interface {\n\t// VerifyIdentity is responsible for constructing the parameters for a request\n\tVerifyIdentity(context.Context) ([]byte, error)\n}\n```\nVerifier is the client side of authorizer\n\n","path":"github.com/LinuxGit/kops/node-authorizer/pkg/server","name":"server","synopsis":"","isRedistributable":true}
