ЛР7 на 4: HTTPS, mTLS, OpenBao AppRole и ротация leaf.
Skeleton contracts / contracts (pull_request) Blocked by required conditions

Smoke/security/grade4/persistence/failover пройдены; REPORT и DEFENSE.
This commit is contained in:
2026-12-02 23:08:27 +03:00
parent 20afc2c790
commit 2f2047909f
182 changed files with 15169 additions and 90 deletions
+25
View File
@@ -0,0 +1,25 @@
package studenttests_test
import (
"context"
"os"
"testing"
"time"
"gavrilenko-sxdees/lab7/internal/openbao"
)
func TestOpenBaoAppRole(t *testing.T) {
if os.Getenv("BAO_ADDR") == "" {
t.Setenv("BAO_ADDR", "https://127.0.0.1:8217")
}
os.Setenv("BAO_TLS_SERVER_NAME", "openbao.messenger.lab")
os.Setenv("BAO_CACERT", secretPath("ca.crt"))
os.Setenv("BAO_ROLE_ID_FILE", secretPath("bao_api_role_id.txt"))
os.Setenv("BAO_SECRET_ID_FILE", secretPath("bao_api_secret_id.txt"))
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
if err := openbao.VerifyAppRole(ctx, "api"); err != nil {
t.Fatalf("openbao approle: %v", err)
}
}