MCPcopy Create free account
hub / github.com/SignTools/SignTools / newEnvProfile

Function newEnvProfile

src/storage/profile_env.go:27–39  ·  view source on GitHub ↗

Attempts to parse a Profile from environment variables. Returns os.ErrNotExist if variables are missing, otherwise any other error.

(cfg *config.EnvProfile)

Source from the content-addressed store, hash-verified

25// Attempts to parse a Profile from environment variables.
26// Returns os.ErrNotExist if variables are missing, otherwise any other error.
27func newEnvProfile(cfg *config.EnvProfile) (*envProfile, error) {
28 p, err := parseEnvProfile(cfg)
29 if err != nil {
30 return nil, err
31 }
32 fixedCert, teamId, err := processP12(p.originalCert, p.certPass)
33 if err != nil {
34 return nil, errors.WithMessage(err, "validate certificate")
35 }
36 p.fixedCert = fixedCert
37 p.teamId = teamId
38 return p, nil
39}
40
41func parseEnvProfile(cfg *config.EnvProfile) (*envProfile, error) {
42 // cfg is empty, no envvars were set

Callers 1

refreshMethod · 0.85

Calls 2

parseEnvProfileFunction · 0.85
processP12Function · 0.85

Tested by

no test coverage detected