Skip to content

Commit c7d80a6

Browse files
committed
update encryptor initialization logic
1 parent 5fb4f93 commit c7d80a6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

internal/encryptor/encryptor.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ func NewEncryptor(decryptionURL string, encryptionURL string, enabled bool, time
3535
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
3636
defer cancel()
3737

38+
if len(audience) == 0 {
39+
return Encryptor{
40+
decryptionURL: decryptionURL,
41+
encryptionURL: encryptionURL,
42+
enabled: enabled,
43+
timeout: timeout,
44+
client: &http.Client{},
45+
}, nil
46+
}
47+
3848
client, err := idtoken.NewClient(ctx, audience)
3949
if err != nil {
4050
return Encryptor{}, err

0 commit comments

Comments
 (0)