session

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package session is a generated protocol buffer package.

Session Service

Session Service API performs CRUD actions against session resources

It is generated from these files:
	server/session/session.proto

It has these top-level messages:
	SessionCreateRequest
	SessionDeleteRequest
	SessionResponse

Package session is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthSession = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSession   = fmt.Errorf("proto: integer overflow")
)

Functions

func RegisterSessionServiceHandler

func RegisterSessionServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterSessionServiceHandler registers the http handlers for service SessionService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterSessionServiceHandlerClient

func RegisterSessionServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SessionServiceClient) error

RegisterSessionServiceHandler registers the http handlers for service SessionService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SessionServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SessionServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SessionServiceClient" to call the correct interceptors.

func RegisterSessionServiceHandlerFromEndpoint

func RegisterSessionServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterSessionServiceHandlerFromEndpoint is same as RegisterSessionServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterSessionServiceServer

func RegisterSessionServiceServer(s *grpc.Server, srv SessionServiceServer)

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server provides a Session service

func NewServer

func NewServer(mgr *sessionmgr.SessionManager) *Server

NewServer returns a new instance of the Session service

func (*Server) AuthFuncOverride

func (s *Server) AuthFuncOverride(ctx context.Context, fullMethodName string) (context.Context, error)

AuthFuncOverride overrides the authentication function and let us not require auth to receive auth. Without this function here, ArgoCDServer.authenticate would be invoked and credentials checked. Since this service is generally invoked when the user has _no_ credentials, that would create a chicken-and-egg situation if we didn't place this here to allow traffic to pass through.

func (*Server) Create

Create generates a non-expiring JWT token signed by ArgoCD. This endpoint is used in two circumstances:

  1. Web/CLI logins for local users (i.e. admin), for when SSO is not configured. In this case, username/password.
  2. CLI login which completed an OAuth2 login flow but wish to store a permanent token in their config

func (*Server) Delete

Delete an authentication cookie from the client. This makes sense only for the Web client.

type SessionCreateRequest

type SessionCreateRequest struct {
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	Token    string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
}

SessionCreateRequest is for logging in.

func (*SessionCreateRequest) Descriptor

func (*SessionCreateRequest) Descriptor() ([]byte, []int)

func (*SessionCreateRequest) GetPassword

func (m *SessionCreateRequest) GetPassword() string

func (*SessionCreateRequest) GetToken added in v0.4.0

func (m *SessionCreateRequest) GetToken() string

func (*SessionCreateRequest) GetUsername

func (m *SessionCreateRequest) GetUsername() string

func (*SessionCreateRequest) Marshal added in v0.3.1

func (m *SessionCreateRequest) Marshal() (dAtA []byte, err error)

func (*SessionCreateRequest) MarshalTo added in v0.3.1

func (m *SessionCreateRequest) MarshalTo(dAtA []byte) (int, error)

func (*SessionCreateRequest) ProtoMessage

func (*SessionCreateRequest) ProtoMessage()

func (*SessionCreateRequest) Reset

func (m *SessionCreateRequest) Reset()

func (*SessionCreateRequest) Size added in v0.3.1

func (m *SessionCreateRequest) Size() (n int)

func (*SessionCreateRequest) String

func (m *SessionCreateRequest) String() string

func (*SessionCreateRequest) Unmarshal added in v0.3.1

func (m *SessionCreateRequest) Unmarshal(dAtA []byte) error

type SessionDeleteRequest

type SessionDeleteRequest struct {
}

SessionDeleteRequest is for logging out.

func (*SessionDeleteRequest) Descriptor

func (*SessionDeleteRequest) Descriptor() ([]byte, []int)

func (*SessionDeleteRequest) Marshal added in v0.3.1

func (m *SessionDeleteRequest) Marshal() (dAtA []byte, err error)

func (*SessionDeleteRequest) MarshalTo added in v0.3.1

func (m *SessionDeleteRequest) MarshalTo(dAtA []byte) (int, error)

func (*SessionDeleteRequest) ProtoMessage

func (*SessionDeleteRequest) ProtoMessage()

func (*SessionDeleteRequest) Reset

func (m *SessionDeleteRequest) Reset()

func (*SessionDeleteRequest) Size added in v0.3.1

func (m *SessionDeleteRequest) Size() (n int)

func (*SessionDeleteRequest) String

func (m *SessionDeleteRequest) String() string

func (*SessionDeleteRequest) Unmarshal added in v0.3.1

func (m *SessionDeleteRequest) Unmarshal(dAtA []byte) error

type SessionResponse

type SessionResponse struct {
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
}

SessionResponse wraps the created token or returns an empty string if deleted.

func (*SessionResponse) Descriptor

func (*SessionResponse) Descriptor() ([]byte, []int)

func (*SessionResponse) GetToken

func (m *SessionResponse) GetToken() string

func (*SessionResponse) Marshal added in v0.3.1

func (m *SessionResponse) Marshal() (dAtA []byte, err error)

func (*SessionResponse) MarshalTo added in v0.3.1

func (m *SessionResponse) MarshalTo(dAtA []byte) (int, error)

func (*SessionResponse) ProtoMessage

func (*SessionResponse) ProtoMessage()

func (*SessionResponse) Reset

func (m *SessionResponse) Reset()

func (*SessionResponse) Size added in v0.3.1

func (m *SessionResponse) Size() (n int)

func (*SessionResponse) String

func (m *SessionResponse) String() string

func (*SessionResponse) Unmarshal added in v0.3.1

func (m *SessionResponse) Unmarshal(dAtA []byte) error

type SessionServiceClient

type SessionServiceClient interface {
	// Create a new JWT for authentication and set a cookie if using HTTP.
	Create(ctx context.Context, in *SessionCreateRequest, opts ...grpc.CallOption) (*SessionResponse, error)
	// Delete an existing JWT cookie if using HTTP.
	Delete(ctx context.Context, in *SessionDeleteRequest, opts ...grpc.CallOption) (*SessionResponse, error)
}

func NewSessionServiceClient

func NewSessionServiceClient(cc *grpc.ClientConn) SessionServiceClient

type SessionServiceServer

type SessionServiceServer interface {
	// Create a new JWT for authentication and set a cookie if using HTTP.
	Create(context.Context, *SessionCreateRequest) (*SessionResponse, error)
	// Delete an existing JWT cookie if using HTTP.
	Delete(context.Context, *SessionDeleteRequest) (*SessionResponse, error)
}

Directories

Path Synopsis
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0

Jump to

Keyboard shortcuts

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