diff --git a/auth/api/iam/api_test.go b/auth/api/iam/api_test.go index 029ff76f17..453891b43b 100644 --- a/auth/api/iam/api_test.go +++ b/auth/api/iam/api_test.go @@ -36,11 +36,8 @@ import ( "github.com/nuts-foundation/nuts-node/auth/oauth" oauthServices "github.com/nuts-foundation/nuts-node/auth/services/oauth" "github.com/nuts-foundation/nuts-node/core" -<<<<<<< HEAD "github.com/nuts-foundation/nuts-node/jsonld" -======= "github.com/nuts-foundation/nuts-node/policy" ->>>>>>> af230925 (WIP, changing old PE store impl to use new backend and make sure tests run....) "github.com/nuts-foundation/nuts-node/storage" "github.com/nuts-foundation/nuts-node/vcr/pe" "github.com/nuts-foundation/nuts-node/vdr" diff --git a/auth/auth.go b/auth/auth.go index 10076c6ab7..90e81c178d 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -20,7 +20,6 @@ package auth import ( "errors" - "fmt" "github.com/nuts-foundation/nuts-node/vdr" "github.com/nuts-foundation/nuts-node/vdr/resolver" "net/url" diff --git a/auth/cmd/cmd_test.go b/auth/cmd/cmd_test.go index 70b246442c..dfdd20ed34 100644 --- a/auth/cmd/cmd_test.go +++ b/auth/cmd/cmd_test.go @@ -48,8 +48,6 @@ func TestFlagSet(t *testing.T) { ConfHTTPTimeout, ConfAutoUpdateIrmaSchemas, ConfIrmaSchemeManager, - ConfPresentationExchangeMappingFile, - ConfPublicURL, ConfV2APIEnabled, }, keys) } diff --git a/cmd/root_test.go b/cmd/root_test.go index 9f12c828d5..aee2367ab3 100644 --- a/cmd/root_test.go +++ b/cmd/root_test.go @@ -163,7 +163,7 @@ func Test_CreateSystem(t *testing.T) { system.VisitEngines(func(engine core.Engine) { numEngines++ }) - assert.Equal(t, 16, numEngines) + assert.Equal(t, 17, numEngines) } func Test_ClientCommand_ErrorHandlers(t *testing.T) { diff --git a/policy/api/v1/client/client.go b/policy/api/v1/client/client.go index 2e5be6cdf7..8dfac5a4bf 100644 --- a/policy/api/v1/client/client.go +++ b/policy/api/v1/client/client.go @@ -44,11 +44,7 @@ func NewHTTPClient(strictMode bool, timeout time.Duration, tlsConfig *tls.Config } } -<<<<<<< HEAD // PresentationDefinition retrieves the presentation definition from the presentation definition endpoint for the given scope and authorizer. -======= -// PresentationDefinition retrieves the presentation definition from the presentation definition endpoint for the given scope and . ->>>>>>> 6008f49e (added authorized client API and tests) func (hb HTTPClient) PresentationDefinition(ctx context.Context, serverAddress string, authorizer did.DID, scopes string) (*pe.PresentationDefinition, error) { _, err := core.ParsePublicURL(serverAddress, hb.strictMode) if err != nil { @@ -112,35 +108,3 @@ func (hb HTTPClient) Authorized(ctx context.Context, serverAddress string, reque return authorizedResponse.JSON200.Authorized, nil } - -func (hb HTTPClient) Authorized(ctx context.Context, serverAddress string, request AuthorizedRequest) (bool, error) { - _, err := core.ParsePublicURL(serverAddress, hb.strictMode) - if err != nil { - return false, err - } - - client, err := NewClient(serverAddress, WithHTTPClient(hb.httpClient)) - if err != nil { - return false, err - } - - response, err := client.CheckAuthorized(ctx, request) - if err != nil { - return false, fmt.Errorf("failed to call endpoint: %w", err) - } - if httpErr := core.TestResponseCode(http.StatusOK, response); httpErr != nil { - return false, httpErr - } - - var authorized bool - var data []byte - - if data, err = io.ReadAll(response.Body); err != nil { - return false, fmt.Errorf("unable to read response: %w", err) - } - if err = json.Unmarshal(data, &authorized); err != nil { - return false, fmt.Errorf("unable to unmarshal response: %w", err) - } - - return authorized, nil -}