MCPcopy Index your code
hub / github.com/rilldata/rill / decryptProjectVariables

Method decryptProjectVariables

admin/database/postgres/postgres.go:3888–3906  ·  view source on GitHub ↗
(res []*database.ProjectVariable)

Source from the content-addressed store, hash-verified

3886}
3887
3888func (c *connection) decryptProjectVariables(res []*database.ProjectVariable) error {
3889 for _, v := range res {
3890 if v.ValueEncryptionKeyID == "" {
3891 continue
3892 }
3893 dec, err := base64.StdEncoding.DecodeString(v.Value)
3894 if err != nil {
3895 return err
3896 }
3897
3898 decryptedValue, err := c.decrypt(dec, v.ValueEncryptionKeyID)
3899 if err != nil {
3900 return err
3901 }
3902
3903 v.Value = string(decryptedValue)
3904 }
3905 return nil
3906}
3907
3908// returns the encrypted text and the encryption key id used. The first key in the keyring is used for encryption. If the keyring is empty, the text is returned as is along with an empty key id.
3909func (c *connection) encrypt(text []byte) ([]byte, string, error) {

Callers 2

FindProjectVariablesMethod · 0.95
UpsertProjectVariableMethod · 0.95

Calls 1

decryptMethod · 0.95

Tested by

no test coverage detected