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

Method decrypt

admin/database/postgres/postgres.go:3922–3937  ·  view source on GitHub ↗

returns the decrypted text, using the encryption key id provided. If the key id is empty, the text is returned as is.

(text []byte, encKeyID string)

Source from the content-addressed store, hash-verified

3920
3921// returns the decrypted text, using the encryption key id provided. If the key id is empty, the text is returned as is.
3922func (c *connection) decrypt(text []byte, encKeyID string) ([]byte, error) {
3923 if encKeyID == "" {
3924 return text, nil
3925 }
3926 var encKey *database.EncryptionKey
3927 for _, key := range c.encKeyring {
3928 if key.ID == encKeyID {
3929 encKey = key
3930 break
3931 }
3932 }
3933 if encKey == nil {
3934 return nil, fmt.Errorf("encryption key id %s not found in keyring", encKeyID)
3935 }
3936 return decrypt(text, encKey.Secret)
3937}
3938
3939func checkUpdateRow(target string, res sql.Result, err error) error {
3940 if err != nil {

Calls 2

decryptFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected