iamkey

package
v0.0.0-...-8bc9604 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IamTokenService_Create_FullMethodName                  = "/doublecloud.v1.IamTokenService/Create"
	IamTokenService_CreateForServiceAccount_FullMethodName = "/doublecloud.v1.IamTokenService/CreateForServiceAccount"
)

Variables

View Source
var (
	Key_Algorithm_name = map[int32]string{
		0: "ALGORITHM_UNSPECIFIED",
		1: "RSA_2048",
		2: "RSA_4096",
	}
	Key_Algorithm_value = map[string]int32{
		"ALGORITHM_UNSPECIFIED": 0,
		"RSA_2048":              1,
		"RSA_4096":              2,
	}
)

Enum value maps for Key_Algorithm.

View Source
var File_iam_token_service_proto protoreflect.FileDescriptor
View Source
var IamTokenService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "doublecloud.v1.IamTokenService",
	HandlerType: (*IamTokenServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _IamTokenService_Create_Handler,
		},
		{
			MethodName: "CreateForServiceAccount",
			Handler:    _IamTokenService_CreateForServiceAccount_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "iam_token_service.proto",
}

IamTokenService_ServiceDesc is the grpc.ServiceDesc for IamTokenService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterIamTokenServiceServer

func RegisterIamTokenServiceServer(s grpc.ServiceRegistrar, srv IamTokenServiceServer)

func WriteToJSONFile

func WriteToJSONFile(path string, key *Key) error

WriteToJSONFile writes key to file in JSON format. File permissions will be 0600, because private key part is sensitive data.

Types

type CreateIamTokenForServiceAccountRequest

type CreateIamTokenForServiceAccountRequest struct {
	ServiceAccountId string `protobuf:"bytes,1,opt,name=service_account_id,json=serviceAccountId,proto3" json:"service_account_id,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateIamTokenForServiceAccountRequest) Descriptor deprecated

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

Deprecated: Use CreateIamTokenForServiceAccountRequest.ProtoReflect.Descriptor instead.

func (*CreateIamTokenForServiceAccountRequest) GetServiceAccountId

func (x *CreateIamTokenForServiceAccountRequest) GetServiceAccountId() string

func (*CreateIamTokenForServiceAccountRequest) ProtoMessage

func (*CreateIamTokenForServiceAccountRequest) ProtoReflect

func (*CreateIamTokenForServiceAccountRequest) Reset

func (*CreateIamTokenForServiceAccountRequest) String

type CreateIamTokenRequest

type CreateIamTokenRequest struct {

	// Types that are assignable to Identity:
	//
	//	*CreateIamTokenRequest_Jwt
	Identity isCreateIamTokenRequest_Identity `protobuf_oneof:"identity"`
	// contains filtered or unexported fields
}

func (*CreateIamTokenRequest) Descriptor deprecated

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

Deprecated: Use CreateIamTokenRequest.ProtoReflect.Descriptor instead.

func (*CreateIamTokenRequest) GetIdentity

func (m *CreateIamTokenRequest) GetIdentity() isCreateIamTokenRequest_Identity

func (*CreateIamTokenRequest) GetJwt

func (x *CreateIamTokenRequest) GetJwt() string

func (*CreateIamTokenRequest) ProtoMessage

func (*CreateIamTokenRequest) ProtoMessage()

func (*CreateIamTokenRequest) ProtoReflect

func (x *CreateIamTokenRequest) ProtoReflect() protoreflect.Message

func (*CreateIamTokenRequest) Reset

func (x *CreateIamTokenRequest) Reset()

func (*CreateIamTokenRequest) String

func (x *CreateIamTokenRequest) String() string

type CreateIamTokenRequest_Jwt

type CreateIamTokenRequest_Jwt struct {
	// JSON Web Token (JWT) for a service account.
	// For more information, see [Get IAM token for a service account](/docs/iam/operations/iam-token/create-for-sa).
	Jwt string `protobuf:"bytes,2,opt,name=jwt,proto3,oneof"`
}

type CreateIamTokenResponse

type CreateIamTokenResponse struct {

	// IAM token for the specified identity.
	//
	// You should pass the token in the `Authorization` header for any further API requests.
	// For example, `Authorization: Bearer [iam_token]`.
	IamToken string `protobuf:"bytes,1,opt,name=iam_token,json=iamToken,proto3" json:"iam_token,omitempty"`
	// IAM token expiration time.
	ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateIamTokenResponse) Descriptor deprecated

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

Deprecated: Use CreateIamTokenResponse.ProtoReflect.Descriptor instead.

func (*CreateIamTokenResponse) GetExpiresAt

func (x *CreateIamTokenResponse) GetExpiresAt() *timestamppb.Timestamp

func (*CreateIamTokenResponse) GetIamToken

func (x *CreateIamTokenResponse) GetIamToken() string

func (*CreateIamTokenResponse) ProtoMessage

func (*CreateIamTokenResponse) ProtoMessage()

func (*CreateIamTokenResponse) ProtoReflect

func (x *CreateIamTokenResponse) ProtoReflect() protoreflect.Message

func (*CreateIamTokenResponse) Reset

func (x *CreateIamTokenResponse) Reset()

func (*CreateIamTokenResponse) String

func (x *CreateIamTokenResponse) String() string

type IamTokenServiceClient

type IamTokenServiceClient interface {
	// Creates an IAM token for the specified identity.
	Create(ctx context.Context, in *CreateIamTokenRequest, opts ...grpc.CallOption) (*CreateIamTokenResponse, error)
	// Create iam token for service account.
	CreateForServiceAccount(ctx context.Context, in *CreateIamTokenForServiceAccountRequest, opts ...grpc.CallOption) (*CreateIamTokenResponse, error)
}

IamTokenServiceClient is the client API for IamTokenService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type IamTokenServiceServer

type IamTokenServiceServer interface {
	// Creates an IAM token for the specified identity.
	Create(context.Context, *CreateIamTokenRequest) (*CreateIamTokenResponse, error)
	// Create iam token for service account.
	CreateForServiceAccount(context.Context, *CreateIamTokenForServiceAccountRequest) (*CreateIamTokenResponse, error)
	// contains filtered or unexported methods
}

IamTokenServiceServer is the server API for IamTokenService service. All implementations must embed UnimplementedIamTokenServiceServer for forward compatibility

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 Key_Algorithm `` /* 132-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 ReadFromJSONBytes

func ReadFromJSONBytes(keyBytes []byte) (*Key, error)

ReadFromJSONFile reads IAM Key from JSON bytes.

func ReadFromJSONFile

func ReadFromJSONFile(path string) (*Key, error)

ReadFromJSONFile reads IAM Key from JSON file.

func (*Key) Descriptor deprecated

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

Deprecated: Use Key.ProtoReflect.Descriptor instead.

func (*Key) GetCreatedAt

func (x *Key) GetCreatedAt() *timestamppb.Timestamp

func (*Key) GetDescription

func (x *Key) GetDescription() string

func (*Key) GetId

func (x *Key) GetId() string

func (*Key) GetKeyAlgorithm

func (x *Key) GetKeyAlgorithm() Key_Algorithm

func (*Key) GetPrivateKey

func (x *Key) GetPrivateKey() string

func (*Key) GetPublicKey

func (x *Key) GetPublicKey() string

func (*Key) GetServiceAccountId

func (x *Key) GetServiceAccountId() string

func (*Key) GetSubject

func (m *Key) GetSubject() isKey_Subject

func (*Key) GetUserAccountId

func (x *Key) GetUserAccountId() string

func (*Key) MarshalJSON

func (m *Key) MarshalJSON() ([]byte, error)

func (*Key) ProtoMessage

func (*Key) ProtoMessage()

func (*Key) ProtoReflect

func (x *Key) ProtoReflect() protoreflect.Message

func (*Key) Reset

func (x *Key) Reset()

func (*Key) String

func (x *Key) String() string

func (*Key) UnmarshalJSON

func (m *Key) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals IAM Key JSON data. Both snake_case (gRPC API) and camelCase (REST API) fields are accepted.

type Key_Algorithm

type Key_Algorithm int32
const (
	Key_ALGORITHM_UNSPECIFIED Key_Algorithm = 0
	// RSA with a 2048-bit key size. Default value.
	Key_RSA_2048 Key_Algorithm = 1
	// RSA with a 4096-bit key size.
	Key_RSA_4096 Key_Algorithm = 2
)

func (Key_Algorithm) Descriptor

func (Key_Algorithm) Enum

func (x Key_Algorithm) Enum() *Key_Algorithm

func (Key_Algorithm) EnumDescriptor deprecated

func (Key_Algorithm) EnumDescriptor() ([]byte, []int)

Deprecated: Use Key_Algorithm.Descriptor instead.

func (Key_Algorithm) Number

func (Key_Algorithm) String

func (x Key_Algorithm) String() string

func (Key_Algorithm) Type

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"`
}

type UnimplementedIamTokenServiceServer

type UnimplementedIamTokenServiceServer struct {
}

UnimplementedIamTokenServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedIamTokenServiceServer) Create

type UnsafeIamTokenServiceServer

type UnsafeIamTokenServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeIamTokenServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to IamTokenServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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