Documentation
¶
Index ¶
- func WriteToJSONFile(path string, key *Key) error
- type Key
- func (*Key) Descriptor() ([]byte, []int)
- func (m *Key) GetCreatedAt() *timestamp.Timestamp
- func (m *Key) GetDescription() string
- func (m *Key) GetId() string
- func (m *Key) GetKeyAlgorithm() v1.Key_Algorithm
- func (m *Key) GetPrivateKey() string
- func (m *Key) GetPublicKey() string
- func (m *Key) GetServiceAccountId() string
- func (m *Key) GetSubject() isKey_Subject
- func (m *Key) GetUserAccountId() string
- func (m *Key) MarshalJSON() ([]byte, error)
- func (m *Key) MarshalYAML() (interface{}, error)
- func (*Key) ProtoMessage()
- func (m *Key) Reset()
- func (m *Key) String() string
- func (m *Key) UnmarshalJSON(data []byte) error
- func (m *Key) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (m *Key) XXX_DiscardUnknown()
- func (m *Key) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Key) XXX_Merge(src proto.Message)
- func (*Key) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- func (m *Key) XXX_Size() int
- func (m *Key) XXX_Unmarshal(b []byte) error
- type Key_ServiceAccountId
- type Key_UserAccountId
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteToJSONFile ¶
WriteToJSONFile writes key to file in JSON format. File permissions will be 0600, because private key part is sensitive data.
Types ¶
type Key ¶
type Key struct { // ID of the Key resource. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Types that are valid to be assigned to Subject: // *Key_UserAccountId // *Key_ServiceAccountId Subject isKey_Subject `protobuf_oneof:"subject"` // Creation timestamp in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. CreatedAt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Description of the Key resource. 0-256 characters long. Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` // An algorithm used to generate a key pair of the Key resource. KeyAlgorithm v1.Key_Algorithm `` /* 137-byte string literal not displayed */ // A public key of the Key resource. PublicKey string `protobuf:"bytes,7,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // A public key of the Key resource. PrivateKey string `protobuf:"bytes,8,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Key is resource managed by IAM Key Service. Can be issued for User or Service Account, but key authorization is supported only for Service Accounts. Issued key contains private part that is not saved on server side, and should be saved by client.
func New ¶
func New(created *iam.CreateKeyResponse) *Key
New creates new Key from IAM Key Service Create response.
func ReadFromJSONBytes ¶
ReadFromJSONFile reads IAM Key from JSON bytes.
func ReadFromJSONFile ¶
ReadFromJSONFile reads IAM Key from JSON file.
func (*Key) Descriptor ¶
func (*Key) GetCreatedAt ¶
func (*Key) GetDescription ¶
func (*Key) GetKeyAlgorithm ¶
func (m *Key) GetKeyAlgorithm() v1.Key_Algorithm
func (*Key) GetPrivateKey ¶
func (*Key) GetPublicKey ¶
func (*Key) GetServiceAccountId ¶
func (*Key) GetSubject ¶
func (m *Key) GetSubject() isKey_Subject
func (*Key) GetUserAccountId ¶
func (*Key) MarshalJSON ¶
func (*Key) MarshalYAML ¶
func (*Key) ProtoMessage ¶
func (*Key) ProtoMessage()
func (*Key) UnmarshalJSON ¶
UnmarshalJSON unmarshals IAM Key JSON data. Both snake_case (gRPC API) and camelCase (REST API) fields are accepted.
func (*Key) UnmarshalYAML ¶
UnmarshalYAML unmarshals IAM Key YAML data. Both snake_case (gRPC API) and camelCase (REST API) fields are accepted.
func (*Key) XXX_DiscardUnknown ¶
func (m *Key) XXX_DiscardUnknown()
func (*Key) XXX_OneofFuncs ¶
func (*Key) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
func (*Key) XXX_Unmarshal ¶
type Key_ServiceAccountId ¶
type Key_ServiceAccountId struct {
ServiceAccountId string `protobuf:"bytes,3,opt,name=service_account_id,json=serviceAccountId,proto3,oneof"`
}
type Key_UserAccountId ¶
type Key_UserAccountId struct {
UserAccountId string `protobuf:"bytes,2,opt,name=user_account_id,json=userAccountId,proto3,oneof"`
}