Skip to content

Commit

Permalink
update encryptor initialization logic
Browse files Browse the repository at this point in the history
  • Loading branch information
spikelu2016 committed Jan 5, 2025
1 parent 5fb4f93 commit c7d80a6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/encryptor/encryptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ func NewEncryptor(decryptionURL string, encryptionURL string, enabled bool, time
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()

if len(audience) == 0 {
return Encryptor{
decryptionURL: decryptionURL,
encryptionURL: encryptionURL,
enabled: enabled,
timeout: timeout,
client: &http.Client{},
}, nil
}

client, err := idtoken.NewClient(ctx, audience)
if err != nil {
return Encryptor{}, err
Expand Down

0 comments on commit c7d80a6

Please sign in to comment.