Documentation ¶
Index ¶
- Variables
- func WriteToJSONFile(path string, key *Key) error
- type Key
- func (*Key) Descriptor() ([]byte, []int)deprecated
- func (x *Key) GetCreatedAt() *timestamppb.Timestamp
- func (x *Key) GetDescription() string
- func (x *Key) GetId() string
- func (x *Key) GetKeyAlgorithm() v1.Key_Algorithm
- func (x *Key) GetPrivateKey() string
- func (x *Key) GetPublicKey() string
- func (x *Key) GetServiceAccountId() string
- func (m *Key) GetSubject() isKey_Subject
- func (x *Key) GetUserAccountId() string
- func (m *Key) MarshalJSON() ([]byte, error)
- func (m *Key) MarshalYAML() (interface{}, error)
- func (*Key) ProtoMessage()
- func (x *Key) ProtoReflect() protoreflect.Message
- func (x *Key) Reset()
- func (x *Key) String() string
- func (m *Key) UnmarshalJSON(data []byte) error
- func (m *Key) UnmarshalYAML(unmarshal func(interface{}) error) error
- type Key_ServiceAccountId
- type Key_UserAccountId
Constants ¶
This section is empty.
Variables ¶
var File_key_proto protoreflect.FileDescriptor
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 assignable 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 *timestamppb.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"` // contains filtered or unexported fields }
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
deprecated
func (*Key) GetCreatedAt ¶
func (x *Key) GetCreatedAt() *timestamppb.Timestamp
func (*Key) GetDescription ¶
func (*Key) GetKeyAlgorithm ¶
func (x *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) ProtoReflect ¶
func (x *Key) ProtoReflect() protoreflect.Message
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.
type Key_ServiceAccountId ¶
type Key_ServiceAccountId struct { // ID of the service account that the Key resource belongs to. ServiceAccountId string `protobuf:"bytes,3,opt,name=service_account_id,json=serviceAccountId,proto3,oneof"` }
type Key_UserAccountId ¶
type Key_UserAccountId struct { // ID of the user account that the Key resource belongs to. UserAccountId string `protobuf:"bytes,2,opt,name=user_account_id,json=userAccountId,proto3,oneof"` }