@@ -170,6 +170,12 @@ func TestFetchSecretAuthorization(t *testing.T) {
170170 uri : "ate-secret://k8s.io/default/ns1/example-api/token" ,
171171 wantCode : codes .PermissionDenied ,
172172 },
173+ {
174+ name : "ateom identity" ,
175+ actorSpiffeID : "spiffe://substrate-actor.local/ateom-for-actor/team-a/my-actor" ,
176+ uri : "ate-secret://k8s.io/default/ns1/example-api/token" ,
177+ wantCode : codes .PermissionDenied ,
178+ },
173179 {
174180 name : "garbage identity" ,
175181 actorSpiffeID : "not-a-spiffe-uri" ,
@@ -268,7 +274,7 @@ func TestFetchSecret(t *testing.T) {
268274 t .Run (tc .name , func (t * testing.T ) {
269275 client := fake .NewSimpleClientset (secret , multiKey )
270276 srv := NewServer (client , & NamespaceAuthorizer {allowed : map [string ]map [string ]struct {}{"team-a" : {"ns1" : {}}}})
271- resp , err := srv .FetchSecret (context .Background (), & credproviderpb.FetchSecretRequest {Uri : tc .uri , ActorSpiffeId : "spiffe://substrate-actor.local/atespace /team-a/actor /my-actor" })
277+ resp , err := srv .FetchSecret (context .Background (), & credproviderpb.FetchSecretRequest {Uri : tc .uri , ActorSpiffeId : "spiffe://substrate-actor.local/actor /team-a/my-actor" })
272278 if tc .wantCode != codes .OK {
273279 if status .Code (err ) != tc .wantCode {
274280 t .Fatalf ("FetchSecret(%q) code = %v, want %v (err=%v)" , tc .uri , status .Code (err ), tc .wantCode , err )
@@ -331,7 +337,7 @@ func TestFetchSecretKubernetesErrors(t *testing.T) {
331337 client .PrependReactor ("get" , "secrets" , func (k8stesting.Action ) (bool , runtime.Object , error ) { return true , nil , tc .err })
332338 srv := NewServer (client , & NamespaceAuthorizer {allowed : map [string ]map [string ]struct {}{"team-a" : {"ns1" : {}}}})
333339 _ , err := srv .FetchSecret (t .Context (), & credproviderpb.FetchSecretRequest {
334- Uri : "ate-secret://k8s.io/default/ns1/api/token" , ActorSpiffeId : "spiffe://substrate-actor.local/atespace /team-a/actor /a" ,
340+ Uri : "ate-secret://k8s.io/default/ns1/api/token" , ActorSpiffeId : "spiffe://substrate-actor.local/actor /team-a/a" ,
335341 })
336342 if status .Code (err ) != tc .code {
337343 t .Fatalf ("FetchSecret: %v, want %v" , err , tc .code )
@@ -347,7 +353,7 @@ func TestFetchSecretObservesRotation(t *testing.T) {
347353 secret := & corev1.Secret {ObjectMeta : metav1.ObjectMeta {Name : "api" , Namespace : "ns1" }, Data : map [string ][]byte {"token" : []byte ("first" )}}
348354 client := fake .NewSimpleClientset (secret )
349355 srv := NewServer (client , & NamespaceAuthorizer {allowed : map [string ]map [string ]struct {}{"team-a" : {"ns1" : {}}}})
350- req := & credproviderpb.FetchSecretRequest {Uri : "ate-secret://k8s.io/default/ns1/api/token" , ActorSpiffeId : "spiffe://substrate-actor.local/atespace /team-a/actor /a" }
356+ req := & credproviderpb.FetchSecretRequest {Uri : "ate-secret://k8s.io/default/ns1/api/token" , ActorSpiffeId : "spiffe://substrate-actor.local/actor /team-a/a" }
351357 first , err := srv .FetchSecret (t .Context (), req )
352358 if err != nil || string (first .GetOpaqueBytes ()) != "first" {
353359 t .Fatalf ("first fetch: %v, %v" , first , err )
0 commit comments