MCPcopy Create free account
hub / github.com/cli/cli / putSecret

Function putSecret

pkg/cmd/secret/set/http.go:75–83  ·  view source on GitHub ↗
(client *api.Client, host string, path safeurl.SafeURL, payload interface{})

Source from the content-addressed store, hash-verified

73}
74
75func putSecret(client *api.Client, host string, path safeurl.SafeURL, payload interface{}) error {
76 payloadBytes, err := json.Marshal(payload)
77 if err != nil {
78 return fmt.Errorf("failed to serialize: %w", err)
79 }
80 requestBody := bytes.NewReader(payloadBytes)
81
82 return client.REST(host, "PUT", path.String(), requestBody, nil)
83}
84
85func putOrgSecret(client *api.Client, host string, pk *PubKey, orgName, visibility, secretName, eValue string, repositoryIDs []int64, app shared.App) error {
86 path, err := safeurl.JoinPath("orgs", orgName, string(app), "secrets", secretName)

Callers 4

putOrgSecretFunction · 0.85
putUserSecretFunction · 0.85
putEnvSecretFunction · 0.85
putRepoSecretFunction · 0.85

Calls 3

ErrorfMethod · 0.65
RESTMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected