Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ilia-medvedev-codefresh committed Dec 10, 2024
1 parent 309c89c commit 54cfa22
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion codefresh/cfclient/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,15 @@ func (client *Client) GetContext(name string) (*Context, error) {
return nil, err
}

// This is so not to break existing behavior while adding support for forbidDecrypt feature flag
// The provider used to always decrypt the contexts, hence we treat all contexts as decrypted unless forbidDecrypt is set
isEncryptedType := slices.Contains(encryptedContextTypes, respContext.Spec.Type)
respContext.IsEncrypred = isEncryptedType && !forbidDecrypt

respContext.IsEncrypred = false

if forbidDecrypt && isEncryptedType {
respContext.IsEncrypred = true
}

return &respContext, nil
}
Expand Down

0 comments on commit 54cfa22

Please sign in to comment.