Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions api/service/certificateissuer/certificate_issuer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package certificateissuer

import (
"context"
)

type CertificateIssuer interface {
IssueCertificate(ctx context.Context, req *IssueCertificateRequest) (*IssueCertificateResponse, error)
}

type ValidityType int32

const (
Unspecified ValidityType = iota
Days
Months
Years
)

type IssueCertificateRequest struct {
// V1 Fields
CommonName string
Localities []string
Validity *CertificateValidity
PrivateKey *CertificatePrivateKey
}

type IssueCertificateResponse struct {
// V1 Fields
ChainPem string
}

type CertificateValidity struct {
// V1 Fields
Value int64
Type ValidityType
}

type CertificatePrivateKey struct {
// V1 Fields
Data []byte
}
73 changes: 73 additions & 0 deletions api/service/identitymanagement/identity_management.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package identitymanagement

import (
"context"
)

type IdentityManagement interface {
GetGroup(ctx context.Context, req *GetGroupRequest) (*GetGroupResponse, error)
ListGroups(ctx context.Context, req *ListGroupsRequest) (*ListGroupsResponse, error)
ListGroupUsers(ctx context.Context, req *ListGroupUsersRequest) (*ListGroupUsersResponse, error)
LetUserGroups(ctx context.Context, req *LetUserGroupsRequest) (*LetUserGroupsResponse, error)
}

type AuthContext struct {
// V1 Fields
Data map[string]string
}

type GetGroupRequest struct {
// V1 Fields
GroupName string
AuthContext AuthContext
}

type GetGroupResponse struct {
// V1 Fields
Group Group
}

type ListGroupsRequest struct {
// V1 Fields
AuthContext AuthContext
}

type ListGroupsResponse struct {
// V1 Fields
Groups []Group
}

type ListGroupUsersRequest struct {
// V1 Fields
GroupID string
AuthContext AuthContext
}

type ListGroupUsersResponse struct {
// V1 Fields
Users []User
}

type User struct {
// V1 Fields
ID string
Name string
Email string
}

type LetUserGroupsRequest struct {
// V1 Fields
UserID string
AuthContext AuthContext
}

type LetUserGroupsResponse struct {
// V1 Fields
Groups []Group
}

type Group struct {
// V1 Fields
ID string
Name string
}
5 changes: 5 additions & 0 deletions api/service/keystore/common.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package keystore

type InstanceConfig struct {
Values map[string]any
}
27 changes: 27 additions & 0 deletions api/service/keystore/keystore_management.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package keystore

import (
"context"
)

type KeystoreManagement interface {
CreateKeystore(ctx context.Context, req *CreateKeystoreRequest) (*CreateKeystoreResponse, error)
DeleteKeystore(ctx context.Context, req *DeleteKeystoreRequest) (*DeleteKeystoreResponse, error)
}

type CreateKeystoreRequest struct {
// V1 Fields
Values map[string]any
}

type CreateKeystoreResponse struct {
// V1 Fields
Config InstanceConfig
}

type DeleteKeystoreRequest struct {
// V1 Fields
Config InstanceConfig
}

type DeleteKeystoreResponse struct{}
165 changes: 165 additions & 0 deletions api/service/keystore/keystore_operations.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
package keystore

import (
"context"
)

type KeystoreOperations interface {
GetKey(ctx context.Context, req *GetKeyRequest) (*GetKeyResponse, error)
CreateKey(ctx context.Context, req *CreateKeyRequest) (*CreateKeyResponse, error)
DeleteKey(ctx context.Context, req *DeleteKeyRequest) (*DeleteKeyResponse, error)
EnableKey(ctx context.Context, req *EnableKeyRequest) (*EnableKeyResponse, error)
GetImportParameters(ctx context.Context, req *GetImportParametersRequest) (*GetImportParametersResponse, error)
ImportKeyMaterial(ctx context.Context, req *ImportKeyMaterialRequest) (*ImportKeyMaterialResponse, error)
ValidateKey(ctx context.Context, req *ValidateKeyRequest) (*ValidateKeyResponse, error)
ValidateKeyAccessData(ctx context.Context, req *ValidateKeyAccessDataRequest) (*ValidateKeyAccessDataResponse, error)
TransformCryptoAccessData(ctx context.Context, req *TransformCryptoAccessDataRequest) (*TransformCryptoAccessDataResponse, error)
ExtractKeyRegion(ctx context.Context, req *ExtractKeyRegionRequest) (*ExtractKeyRegionResponse, error)
}

type KeyAlgorithm int32

const (
UnspecifiedKeyAlgorithm KeyAlgorithm = iota
AES256K
RSA3072
RSA4096
)

type KeyType int32

const (
UnspecifiedKeyType KeyType = iota
SystemManaged
BYOK
HYOK
)

type RequestParameters struct {
// V1 Fields
Config InstanceConfig
KeyID string
}

type GetKeyRequest struct {
// V1 Fields
Parameters RequestParameters
}

type GetKeyResponse struct {
// V1 Fields
KeyID string
KeyAlgorithm KeyAlgorithm
Status string
Usage string
}

// CreateKeyRequest contains parameters for key creation
type CreateKeyRequest struct {
// V1 Fields
Config InstanceConfig
KeyAlgorithm KeyAlgorithm
ID *string
Region string
KeyType KeyType
}

type CreateKeyResponse struct {
// V1 Fields
KeyID string
Status string
}

// DeleteKeyRequest contains parameters for key deletion
type DeleteKeyRequest struct {
// V1 Fields
Parameters RequestParameters
Window *int32
}

type DeleteKeyResponse struct{}

// EnableKeyRequest contains parameters for key enablement
type EnableKeyRequest struct {
// V1 Fields
Parameters RequestParameters
}

type EnableKeyResponse struct{}

// DisableKeyRequest contains parameters for key disablement
type DisableKeyRequest struct {
// V1 Fields
Parameters RequestParameters
}

type DisableKeyResponse struct{}

type GetImportParametersRequest struct {
// V1 Fields
Parameters RequestParameters
KeyAlgorithm KeyAlgorithm
}

type GetImportParametersResponse struct {
// V1 Fields
KeyID string
ImportParameters map[string]any
}

type ImportKeyMaterialRequest struct {
// V1 Fields
Parameters RequestParameters
ImportParameters map[string]any
EncryptedKeyMaterial string
}

type ImportKeyMaterialResponse struct{}

type ValidateKeyRequest struct {
// V1 Fields
KeyType KeyType
KeyAlgorithm KeyAlgorithm
Region string
NativeKeyID string
}

type ValidateKeyResponse struct {
// V1 Fields
IsValid bool
Message string
}

type ValidateKeyAccessDataRequest struct {
// V1 Fields
Management map[string]any
Crypto map[string]any
}

type ValidateKeyAccessDataResponse struct {
// V1 Fields
IsValid bool
Message string
}

type TransformCryptoAccessDataRequest struct {
// V1 Fields
NativeKeyID string
AccessData []byte
}

type TransformCryptoAccessDataResponse struct {
// V1 Fields
TransformedAccessData map[string][]byte
}

type ExtractKeyRegionRequest struct {
// V1 Fields
NativeKeyID string
ManagementAccessData map[string]any
}

type ExtractKeyRegionResponse struct {
// V1 Fields
Region string
}
30 changes: 30 additions & 0 deletions api/service/notification/notification.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package notification

import "context"

type Notification interface {
Send(ctx context.Context, req *SendNotificationRequest) (*SendNotificationResponse, error)
}

type Type int32

const (
Unspecified Type = iota
Email
Text
Web
)

type SendNotificationRequest struct {
// V1 Fields
Type Type
Recipients []string
Subject string
Body string
}

type SendNotificationResponse struct {
// V1 Fields
Success bool
Message string
}
Loading
Loading