Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for checkAudience (0.18 sec)

  1. security/pkg/server/ca/authenticate/oidc.go

    	parts := strings.Split(sa.Sub, ":")
    	ns := parts[2]
    	ksa := parts[3]
    	if !checkAudience(sa.Aud, j.audiences) {
    		return nil, fmt.Errorf("invalid audiences %v", sa.Aud)
    	}
    	return &security.Caller{
    		AuthSource: security.AuthSourceIDToken,
    		Identities: []string{spiffe.MustGenSpiffeURI(j.meshHolder.Mesh(), ns, ksa)},
    	}, nil
    }
    
    // checkAudience() returns true if the audiences to check are in
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu May 23 21:07:03 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  2. security/pkg/server/ca/authenticate/oidc_test.go

    			expectRet:   true,
    			audToCheck:  []string{"aud1", "aud3"},
    			audExpected: []string{"aud1", "aud2"},
    		},
    	}
    
    	for _, tt := range tests {
    		t.Run(tt.name, func(t *testing.T) {
    			ret := checkAudience(tt.audToCheck, tt.audExpected)
    			if ret != tt.expectRet {
    				t.Errorf("expected return is %v while actual return is %v", tt.expectRet, ret)
    			}
    		})
    	}
    }
    
    func TestOIDCAuthenticate(t *testing.T) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu May 23 21:07:03 UTC 2024
    - 7.3K bytes
    - Viewed (0)
Back to top