@@ -21,20 +21,21 @@ func TestPkgLipapiDoesNotImportAuthSDKPackages(t *testing.T) {
2121 assertGoListImportsExclude (t , "./pkg/lipapi" , forbidden )
2222}
2323
24+ // lipsdkAuthImportClosureForbidden is matched against every ImportPath in `go list -deps` for
25+ // ./pkg/lipsdk/auth (transitive closure, same policy as the former direct-imports-only check).
26+ var lipsdkAuthImportClosureForbidden = []forbiddenDep {
27+ {Substr : "/internal/core/" , ErrMsg : "pkg/lipsdk/auth must not depend on internal/core (transitively)" },
28+ {Substr : "/internal/plugins/" , ErrMsg : "pkg/lipsdk/auth must not depend on internal/plugins (transitively)" },
29+ {Substr : "github.com/openai/openai-go" , ErrMsg : "pkg/lipsdk/auth must not depend on OpenAI Go SDK (transitively)" },
30+ {Substr : "github.com/anthropics/anthropic-sdk-go" , ErrMsg : "pkg/lipsdk/auth must not depend on Anthropic SDK (transitively)" },
31+ {Substr : "github.com/aws/aws-sdk-go-v2" , ErrMsg : "pkg/lipsdk/auth must not depend on AWS SDKs (transitively)" },
32+ }
33+
2434// TestPkgLipsdkAuthImportClosure_staysSDKLocal ensures public auth DTOs do not pull core, plugins,
2535// or provider SDKs into the stable auth package (task 10.4, complements task 1.4).
2636func TestPkgLipsdkAuthImportClosure_staysSDKLocal (t * testing.T ) {
2737 t .Parallel ()
28- forbidden := []struct {
29- sub , msg string
30- }{
31- {"/internal/core/" , "pkg/lipsdk/auth must not import internal/core" },
32- {"/internal/plugins/" , "pkg/lipsdk/auth must not import concrete protocol plugins" },
33- {"github.com/openai/openai-go" , "pkg/lipsdk/auth must not import OpenAI provider SDK" },
34- {"github.com/anthropics/anthropic-sdk-go" , "pkg/lipsdk/auth must not import Anthropic SDK" },
35- {"github.com/aws/aws-sdk-go-v2" , "pkg/lipsdk/auth must not import AWS SDKs" },
36- }
37- assertGoListImportsExclude (t , "./pkg/lipsdk/auth" , forbidden )
38+ assertDepsExcludeForbidden (t , []string {"./pkg/lipsdk/auth" }, lipsdkAuthImportClosureForbidden )
3839}
3940
4041func assertGoListImportsExclude (t * testing.T , goListPattern string , forbidden []struct {
0 commit comments