docs: annotate Foundry source and deployment lifecycle in Chinese [skip ci]
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// 认证回归:数据库用例需要 PLATFORM_TEST_DATABASE_URL 指向隔离且已迁移的 fixture。
|
||||
package auth
|
||||
|
||||
import (
|
||||
@@ -14,6 +15,7 @@ import (
|
||||
_ "github.com/jackc/pgx/v5/stdlib"
|
||||
)
|
||||
|
||||
// sessionFixture 建随机项目账户,通过 t.Cleanup 级联删除相关数据并关闭连接池。
|
||||
func sessionFixture(t *testing.T) (*sql.DB, string, string) {
|
||||
t.Helper()
|
||||
dsn := os.Getenv("PLATFORM_TEST_DATABASE_URL")
|
||||
@@ -33,6 +35,7 @@ func sessionFixture(t *testing.T) (*sql.DB, string, string) {
|
||||
return db, project, account
|
||||
}
|
||||
|
||||
// TestSessionIdleAndAbsoluteExpiry 覆盖闲置/绝对过期与续期上限;过期记录的时间戳不得被认证请求更新。
|
||||
func TestSessionIdleAndAbsoluteExpiry(t *testing.T) {
|
||||
db, project, account := sessionFixture(t)
|
||||
for _, test := range []struct {
|
||||
@@ -85,6 +88,7 @@ func TestSessionIdleAndAbsoluteExpiry(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestSessionIsolationRevocationAndConcurrentRenewal 检查错误项目与坏凭据拒绝、四个并发续期受绝对期限限制、删除后不能重新续期。
|
||||
func TestSessionIsolationRevocationAndConcurrentRenewal(t *testing.T) {
|
||||
db, project, account := sessionFixture(t)
|
||||
value := token()
|
||||
@@ -116,6 +120,7 @@ func TestSessionIsolationRevocationAndConcurrentRenewal(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestOAuthExchangeIssuesLongLivedSessionAndMeReturnsRemainingLifetime 从真实 grant 兑换会话,检查三十天闲置/九十天绝对期限,以及 me 响应的续期头。
|
||||
func TestOAuthExchangeIssuesLongLivedSessionAndMeReturnsRemainingLifetime(t *testing.T) {
|
||||
db, project, account := sessionFixture(t)
|
||||
code, verifier := token(), token()
|
||||
|
||||
Reference in New Issue
Block a user