-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR enables spec.remoteSecrets and populates spec.app.properties.configuration.secrets based on it's configuration. It will copy the value from the specified secret in Azure KeyVault to the Container App secrets, making sure you don't have to specify any secrets in git.
- Loading branch information
1 parent
afd5db2
commit 6abbc60
Showing
23 changed files
with
785 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package azure | ||
|
||
import "github.com/Azure/azure-sdk-for-go/sdk/azidentity" | ||
|
||
func NewAzureCredential() (*azidentity.DefaultAzureCredential, error) { | ||
cred, err := azidentity.NewDefaultAzureCredential(nil) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return cred, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package cache | ||
|
||
import "time" | ||
|
||
type SecretCacheEntry struct { | ||
name string | ||
value string | ||
modified time.Time | ||
} | ||
type SecretCache map[string]SecretCacheEntry | ||
|
||
func NewSecretCache() *SecretCache { | ||
c := make(SecretCache) | ||
return &c | ||
} | ||
|
||
func (c *SecretCache) Set(name string, value string, modified time.Time) { | ||
(*c)[name] = SecretCacheEntry{ | ||
name, | ||
value, | ||
modified, | ||
} | ||
} | ||
|
||
func (c *SecretCache) Get(name string) (string, bool) { | ||
entry, ok := (*c)[name] | ||
return entry.value, ok | ||
} | ||
|
||
func (c *SecretCache) NeedsUpdate(name string, modified time.Time) bool { | ||
entry, ok := (*c)[name] | ||
if !ok { | ||
return true | ||
} | ||
|
||
if modified != entry.modified { | ||
return true | ||
} | ||
|
||
return false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.