From 554a554f6093cd94c6a09f7d8945d08164d09f3d Mon Sep 17 00:00:00 2001 From: nyagamunene Date: Tue, 24 Sep 2024 13:47:27 +0300 Subject: [PATCH] Rebase from main Signed-off-by: nyagamunene --- postgres/init.go | 2 +- service.go | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/postgres/init.go b/postgres/init.go index 0b3f15c..9f52b7a 100644 --- a/postgres/init.go +++ b/postgres/init.go @@ -21,7 +21,7 @@ func Migration() *migrate.MemoryMigrationSource { revoked BOOLEAN, expiry_time TIMESTAMP, entity_id VARCHAR(36), - type TEXT CHECK (type IN ('RootCA', 'IntermediateCA', 'ClientCert')), + type TEXT CHECK (type IN ('RootCA', 'IntermediateCA', 'ClientCert')), PRIMARY KEY (serial_number) )`, }, diff --git a/service.go b/service.go index 6f6c1bd..251cdbb 100644 --- a/service.go +++ b/service.go @@ -86,17 +86,19 @@ type CA struct { } var ( - serialNumberLimit = new(big.Int).Lsh(big.NewInt(1), 128) - ErrNotFound = errors.New("entity not found") - ErrConflict = errors.New("entity already exists") - ErrCreateEntity = errors.New("failed to create entity") - ErrViewEntity = errors.New("view entity failed") - ErrGetToken = errors.New("failed to get token") - ErrUpdateEntity = errors.New("update entity failed") - ErrMalformedEntity = errors.New("malformed entity specification") - ErrRootCANotFound = errors.New("root CA not found") - ErrCertExpired = errors.New("certificate expired before renewal") - ErrCertRevoked = errors.New("certificate has been revoked and cannot be renewed") + serialNumberLimit = new(big.Int).Lsh(big.NewInt(1), 128) + ErrNotFound = errors.New("entity not found") + ErrConflict = errors.New("entity already exists") + ErrCreateEntity = errors.New("failed to create entity") + ErrViewEntity = errors.New("view entity failed") + ErrGetToken = errors.New("failed to get token") + ErrUpdateEntity = errors.New("update entity failed") + ErrMalformedEntity = errors.New("malformed entity specification") + ErrRootCANotFound = errors.New("root CA not found") + ErrIntermediateCANotFound = errors.New("intermediate CA not found") + ErrCertExpired = errors.New("certificate expired before renewal") + ErrCertRevoked = errors.New("certificate has been revoked and cannot be renewed") + ErrCertInvalidType = errors.New("invalid cert type") ) type SubjectOptions struct {