You've already forked aws-iam-anywhere-refresher
How is the target directory over 100 gigs?
Some checks failed
🏗️✨ Test Build Workflow / 🖥️ 🔨 Build (push) Has been cancelled
Some checks failed
🏗️✨ Test Build Workflow / 🖥️ 🔨 Build (push) Has been cancelled
This commit is contained in:
39
main.go
39
main.go
@@ -1,7 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
helper "gitea.siteworxpro.com/Siteworxpro/aws-iam-anywhere-refresher/aws_signing_helper"
|
||||
"gitea.siteworxpro.com/Siteworxpro/aws-iam-anywhere-refresher/cmd"
|
||||
appConfig "gitea.siteworxpro.com/Siteworxpro/aws-iam-anywhere-refresher/config"
|
||||
@@ -29,38 +28,14 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
privateKey, err := base64.StdEncoding.DecodeString(c.PrivateKey())
|
||||
if err != nil {
|
||||
l.Error("Failed to decode private key", "error", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if len(privateKey) == 0 {
|
||||
l.Error("Private key is empty")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
certificate, err := base64.StdEncoding.DecodeString(c.Certificate())
|
||||
if err != nil {
|
||||
l.Error("Failed to decode certificate", "error", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if len(certificate) == 0 {
|
||||
l.Error("Certificate is empty")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
credentials, err := cmd.Run(&helper.CredentialsOpts{
|
||||
PrivateKeyId: string(privateKey),
|
||||
CertificateId: string(certificate),
|
||||
CertIdentifier: helper.CertIdentifier{
|
||||
SystemStoreName: "MY",
|
||||
},
|
||||
RoleArn: c.RoleArn(),
|
||||
ProfileArnStr: c.ProfileArn(),
|
||||
TrustAnchorArnStr: c.TrustedAnchor(),
|
||||
SessionDuration: int(c.SessionDuration()),
|
||||
PrivateKeyId: c.PrivateKey(),
|
||||
CertificateId: c.Certificate(),
|
||||
CertificateBundleId: c.BundleId(),
|
||||
RoleArn: c.RoleArn(),
|
||||
ProfileArnStr: c.ProfileArn(),
|
||||
TrustAnchorArnStr: c.TrustedAnchor(),
|
||||
SessionDuration: int(c.SessionDuration()),
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user