@@ -17,15 +17,15 @@ import (
1717func TestOAuth2TokenSource_Token (t * testing.T ) {
1818 t .Run ("ok" , func (t * testing.T ) {
1919 mux := http .NewServeMux ()
20- mux .HandleFunc ("/internal/auth/v2/did:web:example.com /request-service-access-token" , func (w http.ResponseWriter , r * http.Request ) {
20+ mux .HandleFunc ("/internal/auth/v2/123abc /request-service-access-token" , func (w http.ResponseWriter , r * http.Request ) {
2121 w .Header ().Set ("Content-Type" , "application/json" )
2222 w .WriteHeader (http .StatusOK )
2323 _ , _ = w .Write ([]byte (`{"access_token":"test","token_type":"bearer","expires_in":3600}` ))
2424 })
2525 httpServer := httptest .NewServer (mux )
2626 tokenSource := OAuth2TokenSource {
27- OwnDID : "did:web:example.com " ,
28- NutsAPIURL : httpServer .URL ,
27+ NutsSubject : "123abc " ,
28+ NutsAPIURL : httpServer .URL ,
2929 }
3030 expectedAuthServerURL , _ := url .Parse ("https://auth.example.com" )
3131 httpRequest , _ := http .NewRequestWithContext (context .Background (), "GET" , "https://resource.example.com" , nil )
@@ -43,16 +43,16 @@ func TestOAuth2TokenSource_Token(t *testing.T) {
4343 t .Run ("additional credentials" , func (t * testing.T ) {
4444 mux := http .NewServeMux ()
4545 var capturedRequest iam.ServiceAccessTokenRequest
46- mux .HandleFunc ("/internal/auth/v2/did:web:example.com /request-service-access-token" , func (w http.ResponseWriter , r * http.Request ) {
46+ mux .HandleFunc ("/internal/auth/v2/123abc /request-service-access-token" , func (w http.ResponseWriter , r * http.Request ) {
4747 require .NoError (t , json .NewDecoder (r .Body ).Decode (& capturedRequest ))
4848 w .Header ().Set ("Content-Type" , "application/json" )
4949 w .WriteHeader (http .StatusOK )
5050 _ , _ = w .Write ([]byte (`{"access_token":"test","token_type":"bearer","expires_in":3600}` ))
5151 })
5252 httpServer := httptest .NewServer (mux )
5353 tokenSource := OAuth2TokenSource {
54- OwnDID : "did:web:example.com " ,
55- NutsAPIURL : httpServer .URL ,
54+ NutsSubject : "123abc " ,
55+ NutsAPIURL : httpServer .URL ,
5656 }
5757 expectedAuthServerURL , _ := url .Parse ("https://auth.example.com" )
5858 requestCtx := WithAdditionalCredentials (context .Background (), []vc.VerifiableCredential {
0 commit comments