Documentation ¶
Overview ¶
Package protocol is a generated protocol buffer package.
Copyright 2014 AdRoll, Inc.
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.
It is generated from these files:
hologram.proto
It has these top-level messages:
Message Ping ServerRequest AssumeRole GetUserCredentials AddSSHKey SSHChallengeResponse MFATokenResponse ServerResponse SSHChallenge SSHVerificationFailure STSCredentials MFATokenRequest AgentRequest AgentResponse Success Failure
Index ¶
- Constants
- Variables
- func Channelize(c io.ReadWriter) (receive chan *Message, send chan *Message, errors chan error)
- func NewMessageConnection(c io.ReadWriteCloser) *messageConnection
- func Write(w io.Writer, msg *Message) error
- type AddSSHKey
- type AgentRequest
- func (m *AgentRequest) GetAssumeRole() *AssumeRole
- func (m *AgentRequest) GetGetUserCredentials() *GetUserCredentials
- func (m *AgentRequest) GetSshAgentSock() string
- func (m *AgentRequest) GetSshKeyFile() []byte
- func (*AgentRequest) ProtoMessage()
- func (m *AgentRequest) Reset()
- func (m *AgentRequest) String() string
- type AgentResponse
- type AssumeRole
- type ConnectionHandlerFunc
- type Failure
- type GetUserCredentials
- type MFATokenRequest
- type MFATokenResponse
- type Message
- func (m *Message) GetAgentRequest() *AgentRequest
- func (m *Message) GetAgentResponse() *AgentResponse
- func (m *Message) GetError() string
- func (m *Message) GetFailure() *Failure
- func (m *Message) GetPing() *Ping
- func (m *Message) GetServerRequest() *ServerRequest
- func (m *Message) GetServerResponse() *ServerResponse
- func (m *Message) GetSource() Message_Source
- func (m *Message) GetSuccess() *Success
- func (*Message) ProtoMessage()
- func (m *Message) Reset()
- func (m *Message) String() string
- type MessageReadWriteCloser
- type Message_Source
- type Ping
- type Ping_RequestResponse
- type SSHChallenge
- type SSHChallengeResponse
- type SSHVerificationFailure
- type STSCredentials
- func (m *STSCredentials) GetAccessKeyId() string
- func (m *STSCredentials) GetAccessToken() string
- func (m *STSCredentials) GetExpiration() int64
- func (m *STSCredentials) GetSecretAccessKey() string
- func (*STSCredentials) ProtoMessage()
- func (m *STSCredentials) Reset()
- func (m *STSCredentials) String() string
- type ServerRequest
- func (m *ServerRequest) GetAddSSHkey() *AddSSHKey
- func (m *ServerRequest) GetAssumeRole() *AssumeRole
- func (m *ServerRequest) GetChallengeResponse() *SSHChallengeResponse
- func (m *ServerRequest) GetGetUserCredentials() *GetUserCredentials
- func (m *ServerRequest) GetTokenResponse() *MFATokenResponse
- func (*ServerRequest) ProtoMessage()
- func (m *ServerRequest) Reset()
- func (m *ServerRequest) String() string
- type ServerResponse
- func (m *ServerResponse) GetChallenge() *SSHChallenge
- func (m *ServerResponse) GetCredentials() *STSCredentials
- func (m *ServerResponse) GetTokenRequest() *MFATokenRequest
- func (m *ServerResponse) GetVerificationFailure() *SSHVerificationFailure
- func (*ServerResponse) ProtoMessage()
- func (m *ServerResponse) Reset()
- func (m *ServerResponse) String() string
- type Success
Constants ¶
const MaximumMessageSize uint32 = 1024 * 1024
We restrict messages to 1Mb in size as a precaution against a single message just filling up all available memory on the server.
Variables ¶
var (
ErrCorruptedMessage = errors.New("Message did not pass checksum.")
)
Common errors we'll run into.
var Message_Source_name = map[int32]string{
0: "OTHER",
1: "HOLOGRAM_SERVER",
2: "HOLOGRAM_CLIENT",
3: "HOLOGRAM_CLI",
}
var Message_Source_value = map[string]int32{
"OTHER": 0,
"HOLOGRAM_SERVER": 1,
"HOLOGRAM_CLIENT": 2,
"HOLOGRAM_CLI": 3,
}
var Ping_RequestResponse_name = map[int32]string{
1: "REQUEST",
2: "RESPONSE",
}
var Ping_RequestResponse_value = map[string]int32{
"REQUEST": 1,
"RESPONSE": 2,
}
Functions ¶
func Channelize ¶
func Channelize(c io.ReadWriter) (receive chan *Message, send chan *Message, errors chan error)
func NewMessageConnection ¶
func NewMessageConnection(c io.ReadWriteCloser) *messageConnection
NewmessageConnection is a convenience function to create a properly-initialized messageConnection.
Types ¶
type AddSSHKey ¶
type AddSSHKey struct { Username *string `protobuf:"bytes,1,req,name=username" json:"username,omitempty"` Passwordhash *string `protobuf:"bytes,2,req,name=passwordhash" json:"passwordhash,omitempty"` Sshkeybytes *string `protobuf:"bytes,3,req,name=sshkeybytes" json:"sshkeybytes,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*AddSSHKey) GetPasswordhash ¶
func (*AddSSHKey) GetSshkeybytes ¶
func (*AddSSHKey) GetUsername ¶
func (*AddSSHKey) ProtoMessage ¶
func (*AddSSHKey) ProtoMessage()
type AgentRequest ¶
type AgentRequest struct { SshAgentSock *string `protobuf:"bytes,2,opt,name=sshAgentSock" json:"sshAgentSock,omitempty"` AssumeRole *AssumeRole `protobuf:"bytes,3,opt,name=assumeRole" json:"assumeRole,omitempty"` GetUserCredentials *GetUserCredentials `protobuf:"bytes,4,opt,name=getUserCredentials" json:"getUserCredentials,omitempty"` // sshKeyFile should be sent along if the CLI cannot determine // how to communicate with the user's SSH agent. SshKeyFile []byte `protobuf:"bytes,5,opt,name=sshKeyFile" json:"sshKeyFile,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*AgentRequest) GetAssumeRole ¶
func (m *AgentRequest) GetAssumeRole() *AssumeRole
func (*AgentRequest) GetGetUserCredentials ¶
func (m *AgentRequest) GetGetUserCredentials() *GetUserCredentials
func (*AgentRequest) GetSshAgentSock ¶
func (m *AgentRequest) GetSshAgentSock() string
func (*AgentRequest) GetSshKeyFile ¶
func (m *AgentRequest) GetSshKeyFile() []byte
func (*AgentRequest) ProtoMessage ¶
func (*AgentRequest) ProtoMessage()
func (*AgentRequest) Reset ¶
func (m *AgentRequest) Reset()
func (*AgentRequest) String ¶
func (m *AgentRequest) String() string
type AgentResponse ¶
type AgentResponse struct { Success *Success `protobuf:"bytes,2,opt,name=success" json:"success,omitempty"` Failure *Failure `protobuf:"bytes,3,opt,name=failure" json:"failure,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*AgentResponse) GetFailure ¶
func (m *AgentResponse) GetFailure() *Failure
func (*AgentResponse) GetSuccess ¶
func (m *AgentResponse) GetSuccess() *Success
func (*AgentResponse) ProtoMessage ¶
func (*AgentResponse) ProtoMessage()
func (*AgentResponse) Reset ¶
func (m *AgentResponse) Reset()
func (*AgentResponse) String ¶
func (m *AgentResponse) String() string
type AssumeRole ¶
type AssumeRole struct { User *string `protobuf:"bytes,1,opt,name=user" json:"user,omitempty"` Role *string `protobuf:"bytes,2,opt,name=role" json:"role,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*AssumeRole) GetRole ¶
func (m *AssumeRole) GetRole() string
func (*AssumeRole) GetUser ¶
func (m *AssumeRole) GetUser() string
func (*AssumeRole) ProtoMessage ¶
func (*AssumeRole) ProtoMessage()
func (*AssumeRole) Reset ¶
func (m *AssumeRole) Reset()
func (*AssumeRole) String ¶
func (m *AssumeRole) String() string
type ConnectionHandlerFunc ¶
type ConnectionHandlerFunc func(MessageReadWriteCloser)
ConnectionHandlerFunc implementers are called as goroutines by the server when a message is received.
type Failure ¶
type Failure struct { ErrorMessage *string `protobuf:"bytes,1,opt,name=errorMessage" json:"errorMessage,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*Failure) GetErrorMessage ¶
func (*Failure) ProtoMessage ¶
func (*Failure) ProtoMessage()
type GetUserCredentials ¶
type GetUserCredentials struct {
XXX_unrecognized []byte `json:"-"`
}
func (*GetUserCredentials) ProtoMessage ¶
func (*GetUserCredentials) ProtoMessage()
func (*GetUserCredentials) Reset ¶
func (m *GetUserCredentials) Reset()
func (*GetUserCredentials) String ¶
func (m *GetUserCredentials) String() string
type MFATokenRequest ¶
type MFATokenRequest struct {
XXX_unrecognized []byte `json:"-"`
}
func (*MFATokenRequest) ProtoMessage ¶
func (*MFATokenRequest) ProtoMessage()
func (*MFATokenRequest) Reset ¶
func (m *MFATokenRequest) Reset()
func (*MFATokenRequest) String ¶
func (m *MFATokenRequest) String() string
type MFATokenResponse ¶
type MFATokenResponse struct { TokenValue *string `protobuf:"bytes,1,opt,name=tokenValue" json:"tokenValue,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*MFATokenResponse) GetTokenValue ¶
func (m *MFATokenResponse) GetTokenValue() string
func (*MFATokenResponse) ProtoMessage ¶
func (*MFATokenResponse) ProtoMessage()
func (*MFATokenResponse) Reset ¶
func (m *MFATokenResponse) Reset()
func (*MFATokenResponse) String ¶
func (m *MFATokenResponse) String() string
type Message ¶
type Message struct { Error *string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` // This is useful for statistics and debugging Source *Message_Source `protobuf:"varint,2,opt,name=source,enum=protocol.Message_Source,def=0" json:"source,omitempty"` Ping *Ping `protobuf:"bytes,5,opt,name=ping" json:"ping,omitempty"` ServerRequest *ServerRequest `protobuf:"bytes,6,opt,name=serverRequest" json:"serverRequest,omitempty"` ServerResponse *ServerResponse `protobuf:"bytes,7,opt,name=serverResponse" json:"serverResponse,omitempty"` AgentRequest *AgentRequest `protobuf:"bytes,8,opt,name=agentRequest" json:"agentRequest,omitempty"` AgentResponse *AgentResponse `protobuf:"bytes,9,opt,name=agentResponse" json:"agentResponse,omitempty"` Success *Success `protobuf:"bytes,10,opt,name=success" json:"success,omitempty"` Failure *Failure `protobuf:"bytes,11,opt,name=failure" json:"failure,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*Message) GetAgentRequest ¶
func (m *Message) GetAgentRequest() *AgentRequest
func (*Message) GetAgentResponse ¶
func (m *Message) GetAgentResponse() *AgentResponse
func (*Message) GetFailure ¶
func (*Message) GetServerRequest ¶
func (m *Message) GetServerRequest() *ServerRequest
func (*Message) GetServerResponse ¶
func (m *Message) GetServerResponse() *ServerResponse
func (*Message) GetSource ¶
func (m *Message) GetSource() Message_Source
func (*Message) GetSuccess ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
type MessageReadWriteCloser ¶
type MessageReadWriteCloser interface { Read() (*Message, error) Write(*Message) error Close() error }
MessageReadWriteCloser implementers provide a wrapper around the Hologram protocol that servers can use in their connection handlers.
type Message_Source ¶
type Message_Source int32
const ( Message_OTHER Message_Source = 0 Message_HOLOGRAM_SERVER Message_Source = 1 Message_HOLOGRAM_CLIENT Message_Source = 2 Message_HOLOGRAM_CLI Message_Source = 3 )
const Default_Message_Source Message_Source = Message_OTHER
func (Message_Source) Enum ¶
func (x Message_Source) Enum() *Message_Source
func (Message_Source) String ¶
func (x Message_Source) String() string
func (*Message_Source) UnmarshalJSON ¶
func (x *Message_Source) UnmarshalJSON(data []byte) error
type Ping ¶
type Ping struct { Type *Ping_RequestResponse `protobuf:"varint,1,opt,name=type,enum=protocol.Ping_RequestResponse,def=1" json:"type,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*Ping) GetType ¶
func (m *Ping) GetType() Ping_RequestResponse
func (*Ping) ProtoMessage ¶
func (*Ping) ProtoMessage()
type Ping_RequestResponse ¶
type Ping_RequestResponse int32
const ( Ping_REQUEST Ping_RequestResponse = 1 Ping_RESPONSE Ping_RequestResponse = 2 )
const Default_Ping_Type Ping_RequestResponse = Ping_REQUEST
func (Ping_RequestResponse) Enum ¶
func (x Ping_RequestResponse) Enum() *Ping_RequestResponse
func (Ping_RequestResponse) String ¶
func (x Ping_RequestResponse) String() string
func (*Ping_RequestResponse) UnmarshalJSON ¶
func (x *Ping_RequestResponse) UnmarshalJSON(data []byte) error
type SSHChallenge ¶
type SSHChallenge struct { Challenge []byte `protobuf:"bytes,1,req,name=challenge" json:"challenge,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*SSHChallenge) GetChallenge ¶
func (m *SSHChallenge) GetChallenge() []byte
func (*SSHChallenge) ProtoMessage ¶
func (*SSHChallenge) ProtoMessage()
func (*SSHChallenge) Reset ¶
func (m *SSHChallenge) Reset()
func (*SSHChallenge) String ¶
func (m *SSHChallenge) String() string
type SSHChallengeResponse ¶
type SSHChallengeResponse struct { Signature []byte `protobuf:"bytes,1,req,name=signature" json:"signature,omitempty"` Format *string `protobuf:"bytes,2,req,name=format" json:"format,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*SSHChallengeResponse) GetFormat ¶
func (m *SSHChallengeResponse) GetFormat() string
func (*SSHChallengeResponse) GetSignature ¶
func (m *SSHChallengeResponse) GetSignature() []byte
func (*SSHChallengeResponse) ProtoMessage ¶
func (*SSHChallengeResponse) ProtoMessage()
func (*SSHChallengeResponse) Reset ¶
func (m *SSHChallengeResponse) Reset()
func (*SSHChallengeResponse) String ¶
func (m *SSHChallengeResponse) String() string
type SSHVerificationFailure ¶
type SSHVerificationFailure struct {
XXX_unrecognized []byte `json:"-"`
}
func (*SSHVerificationFailure) ProtoMessage ¶
func (*SSHVerificationFailure) ProtoMessage()
func (*SSHVerificationFailure) Reset ¶
func (m *SSHVerificationFailure) Reset()
func (*SSHVerificationFailure) String ¶
func (m *SSHVerificationFailure) String() string
type STSCredentials ¶
type STSCredentials struct { AccessKeyId *string `protobuf:"bytes,1,req,name=accessKeyId" json:"accessKeyId,omitempty"` SecretAccessKey *string `protobuf:"bytes,2,req,name=secretAccessKey" json:"secretAccessKey,omitempty"` AccessToken *string `protobuf:"bytes,3,req,name=accessToken" json:"accessToken,omitempty"` Expiration *int64 `protobuf:"varint,4,req,name=expiration" json:"expiration,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*STSCredentials) GetAccessKeyId ¶
func (m *STSCredentials) GetAccessKeyId() string
func (*STSCredentials) GetAccessToken ¶
func (m *STSCredentials) GetAccessToken() string
func (*STSCredentials) GetExpiration ¶
func (m *STSCredentials) GetExpiration() int64
func (*STSCredentials) GetSecretAccessKey ¶
func (m *STSCredentials) GetSecretAccessKey() string
func (*STSCredentials) ProtoMessage ¶
func (*STSCredentials) ProtoMessage()
func (*STSCredentials) Reset ¶
func (m *STSCredentials) Reset()
func (*STSCredentials) String ¶
func (m *STSCredentials) String() string
type ServerRequest ¶
type ServerRequest struct { AssumeRole *AssumeRole `protobuf:"bytes,4,opt,name=assumeRole" json:"assumeRole,omitempty"` ChallengeResponse *SSHChallengeResponse `protobuf:"bytes,5,opt,name=challengeResponse" json:"challengeResponse,omitempty"` TokenResponse *MFATokenResponse `protobuf:"bytes,6,opt,name=tokenResponse" json:"tokenResponse,omitempty"` GetUserCredentials *GetUserCredentials `protobuf:"bytes,7,opt,name=getUserCredentials" json:"getUserCredentials,omitempty"` AddSSHkey *AddSSHKey `protobuf:"bytes,8,opt,name=addSSHkey" json:"addSSHkey,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*ServerRequest) GetAddSSHkey ¶
func (m *ServerRequest) GetAddSSHkey() *AddSSHKey
func (*ServerRequest) GetAssumeRole ¶
func (m *ServerRequest) GetAssumeRole() *AssumeRole
func (*ServerRequest) GetChallengeResponse ¶
func (m *ServerRequest) GetChallengeResponse() *SSHChallengeResponse
func (*ServerRequest) GetGetUserCredentials ¶
func (m *ServerRequest) GetGetUserCredentials() *GetUserCredentials
func (*ServerRequest) GetTokenResponse ¶
func (m *ServerRequest) GetTokenResponse() *MFATokenResponse
func (*ServerRequest) ProtoMessage ¶
func (*ServerRequest) ProtoMessage()
func (*ServerRequest) Reset ¶
func (m *ServerRequest) Reset()
func (*ServerRequest) String ¶
func (m *ServerRequest) String() string
type ServerResponse ¶
type ServerResponse struct { Challenge *SSHChallenge `protobuf:"bytes,4,opt,name=challenge" json:"challenge,omitempty"` VerificationFailure *SSHVerificationFailure `protobuf:"bytes,5,opt,name=verificationFailure" json:"verificationFailure,omitempty"` Credentials *STSCredentials `protobuf:"bytes,6,opt,name=credentials" json:"credentials,omitempty"` TokenRequest *MFATokenRequest `protobuf:"bytes,7,opt,name=tokenRequest" json:"tokenRequest,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*ServerResponse) GetChallenge ¶
func (m *ServerResponse) GetChallenge() *SSHChallenge
func (*ServerResponse) GetCredentials ¶
func (m *ServerResponse) GetCredentials() *STSCredentials
func (*ServerResponse) GetTokenRequest ¶
func (m *ServerResponse) GetTokenRequest() *MFATokenRequest
func (*ServerResponse) GetVerificationFailure ¶
func (m *ServerResponse) GetVerificationFailure() *SSHVerificationFailure
func (*ServerResponse) ProtoMessage ¶
func (*ServerResponse) ProtoMessage()
func (*ServerResponse) Reset ¶
func (m *ServerResponse) Reset()
func (*ServerResponse) String ¶
func (m *ServerResponse) String() string