Learn how to decrypt Onboardbase secrets coming directly into a Golang environment
Install CryptoJSAESDecrypt via Ruby Gems
go get github.com/Onboardbase/go-cryptojs-aes-decrypt/decrypt
Fetch Your Secrets From Onboardbase Public API
Refer to this API resource on how you can retrieve your secrets from Onboardbase. Your response should contain an array of secrets you have created as seen below
github.com/Onboardbase/go-cryptojs-aes-decrypt/decrypt
{
"status": "success",
"message": "Secret successfully fetched",
"data": {
"project": "my-project",
"environment": "development",
"secrets": [
"your secret",
]
}
}
Your secrets are encoded using AES-CBC (Cypher Block Chaining) cryptographic algorithm. To decode these secrets, you will need your API KEY passcode
. A passcode is an alphanumeric value that you provided when generating your API KEY
from your Onboardbase account settings.
To read more about authentication, Click here
package main
import (
"fmt"
aesdecrypt "github.com/Onboardbase/go-cryptojs-aes-decrypt/decrypt"
)
func main () {
cipher := "your secret"
// The passphrase that generated the cipher above
passphrase := "passcode"
decrypted := aesdecrypt.Run(cipher, passphrase)
// fmt.Println(decrypted)
// Outputs -> '{"id":"0a09a9e1-eee2-4a8e-bf77-901be943621c","key":"WHAT","value":"IS_THIS_NAH","comment":"","addedBy":{"name":"Aleem Isiaka","id":"a3748a40-3ab8-4dd1-bac6-e73c1047c95f"},"addedDate":"April 22, 2022 | 20:09 GMT","method":""}'
}