mirror of
https://github.com/hashicorp/vault.git
synced 2026-06-09 00:33:28 -04:00
* Update config.go * added validation and parsing * tests * move pki external config structs and validation into separate file * update copywrite * update configuration * updates * Moved tests to pki_external_config.go, comments, refactoring * refactor * add tests * linter fix * Consolidate to table tests * consolidate to table tests * remove APIVersion from PKIExternalCA * added comments for explaining each struct * Added ParsePKIExternalCA Test * Update tests * Added remaining constraints * Added destination.template field * changes * Added validateListenerAddr * refactor * more comments * changes * Check for duplicates across blocks * Make RSA bits a required field * moved template to the top level * added comment for test explanation * move template to the top level * Move pki config into pkiexternalca directory * fix linting error * move pkiconfig back into config folder * fix failing unit tests * added comments * update to preserve order of templatePKIExternalCARefs * Added comment descriptions for each struct member * update to include warning * bring in warning logger from upstream into the pki config parser * Set default umask to 077 * added comments to each field in agent config * execute tests in parallel * combine tests into Validate * Use assertion error func for tests * assert error strings * Removed warning for now * removed normalization on values during validation * added tests to ensure that user values are not overridden * remove testparse * Update command/agent/config/config.go * change improvement to feature in changelog * updated to add line number in error * Added _ent suffix to files * Implement CA manager for ACME-based workflows (#12827) * Implement CA manager for ACME-based workflows * refactor tests into table tests * update with suggestions * format * fix challenge cleanup * make fmt * update with suggestions * add _ent + build flags * Add a runtime component for pkiexternalca (#12838) * Implement CA manager for ACME-based workflows * Add a runtime component for pkiexternalca * make fmt * refactor tests into table tests * update with suggestions * format * fix challenge cleanup * make fmt * update with suggestions * update with suggestions * add _ent + build flags * fix linters * delete duplicate files * fix changelog * rename test files * fix linter * try to bypass false positive linter err * fix * Rename file * fix linter * fix linter * remove go:build enterprise commends from _ent files * update order statuses to use kebab case + fix scanner failures * add missing order status * Template Integration For pki_external_ca resources (#13069) * Implement CA manager for ACME-based workflows * Add a runtime component for pkiexternalca * make fmt * refactor tests into table tests * update with suggestions * initial commit * fix test failure * changes * remove logger check * remove redundant config by name check * convert to table tests * added comments * updates * Fix tests * fix nil pointer issue * move changes to _ent files * remove ce duplicate files * updates * update template.go * added changelog.txt * create template_pem_ent_test.go * added comment explanation * update ca_manager_ent.go * update changelog * separate ce stubs into server_ce.go and common code into server.go * Moved helper functions to bottom of test file. Added godocs. * Make pkiExternalCA name required in template * remove go:build enterprise commends from _ent files * rename to template_pem_ent * include ent tag in server_ent.go * remove enterprise tag comment from server_ent.go * create pki_external_config_ce.go * update template_pem_ent_integration_test.go * rename integration test --------- --------- Co-authored-by: Jaired Jawed <jaired.jawed@hashicorp.com> Co-authored-by: Ben Ash <32777270+benashz@users.noreply.github.com> Co-authored-by: Zlaticanin <60530402+Zlaticanin@users.noreply.github.com> Co-authored-by: Milena Zlaticanin <Milena.Zlaticanin@ibm.com>
52 lines
1.2 KiB
Go
52 lines
1.2 KiB
Go
// Copyright IBM Corp. 2016, 2025
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
//go:build !enterprise
|
|
|
|
package pkiexternalca
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/hashicorp/vault/api"
|
|
"go.uber.org/atomic"
|
|
)
|
|
|
|
// Server is a CE stub; PKI external CA is an enterprise-only feature.
|
|
type Server struct {
|
|
DoneCh chan struct{}
|
|
stopped *atomic.Bool
|
|
}
|
|
|
|
// NewServer returns a stub server for CE builds.
|
|
func NewServer(cfg *ServerConfig) (*Server, error) {
|
|
if cfg == nil {
|
|
return nil, fmt.Errorf("server config cannot be nil")
|
|
}
|
|
return &Server{
|
|
DoneCh: make(chan struct{}),
|
|
stopped: atomic.NewBool(false),
|
|
}, nil
|
|
}
|
|
|
|
// Run waits for context cancellation; PKI external CA is never active in CE builds.
|
|
func (s *Server) Run(ctx context.Context, _ chan string, _ *api.Client) error {
|
|
<-ctx.Done()
|
|
return nil
|
|
}
|
|
|
|
// Stop closes DoneCh idempotently.
|
|
func (s *Server) Stop() {
|
|
if s.stopped.CAS(false, true) {
|
|
close(s.DoneCh)
|
|
}
|
|
}
|
|
|
|
// CertIssuedCh returns nil in CE builds.
|
|
func (s *Server) CertIssuedCh() <-chan struct{} { return nil }
|
|
|
|
// TemplatePEMByName returns an error in CE builds.
|
|
func (s *Server) TemplatePEMByName(_ string) (any, error) {
|
|
return nil, fmt.Errorf("pki_external_ca is not supported in this build")
|
|
}
|