server

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2020 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Overview

Copyright The Guard Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright The Guard Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	ServingPort = 8443
)

Variables

This section is empty.

Functions

func WithCode

func WithCode(err error, code int) error

WithCode annotates err with a new code. If err is nil, WithCode returns nil.

Types

type AuthRecommendedOptions added in v0.6.0

type AuthRecommendedOptions struct {
	SecureServing SecureServingOptions
	NTP           NTPOptions
	Github        github.Options
	Gitlab        gitlab.Options
	Token         token.Options
	Google        google.Options
	Azure         azure.Options
	LDAP          ldap.Options
	AuthProvider  providers.AuthProviders
}

func NewAuthRecommendedOptions added in v0.6.0

func NewAuthRecommendedOptions() *AuthRecommendedOptions

func (*AuthRecommendedOptions) AddFlags added in v0.6.0

func (o *AuthRecommendedOptions) AddFlags(fs *pflag.FlagSet)

func (*AuthRecommendedOptions) Validate added in v0.6.0

func (o *AuthRecommendedOptions) Validate() []error

type AuthzRecommendedOptions added in v0.6.0

type AuthzRecommendedOptions struct {
	Azure         options.Options
	AuthzProvider authz.AuthzProviders
}

func NewAuthzRecommendedOptions added in v0.6.0

func NewAuthzRecommendedOptions() *AuthzRecommendedOptions

func (*AuthzRecommendedOptions) AddFlags added in v0.6.0

func (o *AuthzRecommendedOptions) AddFlags(fs *pflag.FlagSet)

func (*AuthzRecommendedOptions) Validate added in v0.6.0

type Authzhandler added in v0.6.0

type Authzhandler struct {
	AuthRecommendedOptions  *AuthRecommendedOptions
	AuthzRecommendedOptions *AuthzRecommendedOptions
	Store                   authz.Store
}

func (*Authzhandler) ServeHTTP added in v0.6.0

func (s *Authzhandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type NTPOptions

type NTPOptions struct {
	NTPServer    string
	MaxClodkSkew time.Duration
	Interval     time.Duration
}

func NewNTPOptions

func NewNTPOptions() NTPOptions

func (*NTPOptions) AddFlags

func (o *NTPOptions) AddFlags(fs *pflag.FlagSet)

func (*NTPOptions) Enabled

func (o *NTPOptions) Enabled() bool

func (NTPOptions) ToArgs

func (o NTPOptions) ToArgs() []string

func (*NTPOptions) Validate

func (o *NTPOptions) Validate() []error

type SecureServingOptions

type SecureServingOptions struct {
	SecureAddr string
	CACertFile string
	CertFile   string
	KeyFile    string
	// contains filtered or unexported fields
}

func NewSecureServingOptions

func NewSecureServingOptions() SecureServingOptions

func NewSecureServingOptionsFromDir

func NewSecureServingOptionsFromDir(pkiDir string) SecureServingOptions

func (*SecureServingOptions) AddFlags

func (o *SecureServingOptions) AddFlags(fs *pflag.FlagSet)

func (SecureServingOptions) Apply

func (o SecureServingOptions) Apply(d *apps.Deployment) (extraObjs []runtime.Object, err error)

func (SecureServingOptions) UseTLS

func (o SecureServingOptions) UseTLS() bool

func (*SecureServingOptions) Validate

func (o *SecureServingOptions) Validate() []error

type Server

type Server struct {
	AuthRecommendedOptions  *AuthRecommendedOptions
	AuthzRecommendedOptions *AuthzRecommendedOptions
	TokenAuthenticator      *token.Authenticator
}

func (*Server) AddFlags

func (s *Server) AddFlags(fs *pflag.FlagSet)

func (Server) ListenAndServe

func (s Server) ListenAndServe()

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL