refactor(10.2-01): nest framework packages under modules
- Move remaining beach packages and embedded admin assets\n- Rewrite framework, example, build, and gate paths
This commit is contained in:
21
modules/lagoon/laravel_decrypt_test.go
Normal file
21
modules/lagoon/laravel_decrypt_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package lagoon
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// Fixture produced by PHP openssl_encrypt AES-256-CBC + HMAC-SHA256 over iv+value,
|
||||
// matching Laravel's Encrypter payload (base64 JSON {iv,value,mac}) with serialize=false.
|
||||
const laravelTestPayload = "eyJpdiI6IlNVbEpTVWxKU1VsSlNVbEpTVWxKU1E9PSIsInZhbHVlIjoiYVJ6ODYrRitUM25oVFNoR0o5WGMxbUJtSW5DeWdaVWN6WktYR3RFV3liZz0iLCJtYWMiOiI4YmI4NTRmZDk0ZmQ0NDYzNjk3ZDhmYmQ3M2QyNzFhYzI1MGI1YjFhNzk2ZDdiOWVjN2YyYmQ3YzJjOTk4MzBiIn0="
|
||||
|
||||
func TestEncryptedDecryptLaravelPayload(t *testing.T) {
|
||||
key := bytes.Repeat([]byte("K"), 32)
|
||||
got, err := DecryptLaravelPayload(laravelTestPayload, key)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if string(got) != "sk-test-super-secret-api-key" {
|
||||
t.Fatalf("decrypted = %q", got)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user