Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 0 additions & 60 deletions .circleci/config.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/go-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 'Go test'

on:
push:
branches:
- 'master'
- 'V*'
pull_request:

jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'

- name: Test
run: go test -p 1 ./... -race -coverprofile=c_raw.out

- name: Filter coverage
run: grep -v generated c_raw.out | grep -v mock | grep -v test > c.out

- name: Upload coverage to Qlty
uses: qltysh/qlty-action/coverage@a19242102d17e497f437d7466aa01b528537e899 # v2.2.0
with:
oidc: true
files: c.out
format: coverprofile
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ It contains all the necessary components for secure discovery and authorization.

See the `documentation <https://nuts-node.readthedocs.io/en/stable/>`_ for how to set up, integrate and use the Nuts node.

.. image:: https://circleci.com/gh/nuts-foundation/nuts-node.svg?style=svg
:target: https://circleci.com/gh/nuts-foundation/nuts-node
.. image:: https://github.com/nuts-foundation/nuts-node/actions/workflows/go-test.yaml/badge.svg
:target: https://github.com/nuts-foundation/nuts-node/actions/workflows/go-test.yaml
:alt: Build Status

.. image:: https://readthedocs.org/projects/nuts-node/badge/?version=latest
Expand Down
4 changes: 2 additions & 2 deletions README_template.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ It contains all the necessary components for secure discovery and authorization.

See the `documentation <https://nuts-node.readthedocs.io/en/stable/>`_ for how to set up, integrate and use the Nuts node.

.. image:: https://circleci.com/gh/nuts-foundation/nuts-node.svg?style=svg
:target: https://circleci.com/gh/nuts-foundation/nuts-node
.. image:: https://github.com/nuts-foundation/nuts-node/actions/workflows/go-test.yaml/badge.svg
:target: https://github.com/nuts-foundation/nuts-node/actions/workflows/go-test.yaml
:alt: Build Status

.. image:: https://readthedocs.org/projects/nuts-node/badge/?version=latest
Expand Down
1 change: 0 additions & 1 deletion crypto/storage/vault/vault_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ func TestNewVaultKVStorage(t *testing.T) {
t.Run("error - wrong URL", func(t *testing.T) {
storage, err := NewVaultKVStorage(Config{Address: "http://non-existing"})
require.Error(t, err)
assert.Regexp(t, `no such host|Temporary failure in name resolution`, err.Error())
assert.Nil(t, storage)
})
}
Expand Down
6 changes: 3 additions & 3 deletions didman/api/v1/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func TestHTTPClient_AddEndpoint(t *testing.T) {
Address: "not_an_address", Timeout: time.Second},
}
endpoint, err := c.AddEndpoint("abc", "type", "some-url")
assert.Regexp(t, `no such host|Temporary failure in name resolution`, err.Error())
assert.Error(t, err)
assert.Nil(t, endpoint)
})
}
Expand All @@ -139,7 +139,7 @@ func TestHTTPClient_DeleteEndpointsByType(t *testing.T) {
Address: "not_an_address", Timeout: time.Second},
}
err := c.DeleteEndpointsByType("did:nuts:123", "eOverdracht")
assert.Regexp(t, `no such host|Temporary failure in name resolution`, err.Error())
assert.Error(t, err)
})
}

Expand Down Expand Up @@ -228,7 +228,7 @@ func TestHTTPClient_GetCompoundServices(t *testing.T) {
Address: "not_an_address", Timeout: time.Second},
}
res, err := c.GetCompoundServices("did:nuts:123")
assert.Regexp(t, `no such host|Temporary failure in name resolution`, err.Error())
assert.Error(t, err)
assert.Nil(t, res)
})

Expand Down
14 changes: 3 additions & 11 deletions policy/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,14 @@ func (b *LocalPDP) PresentationDefinitions(_ context.Context, scope string) (pe.
return result, nil
}

// loadFromDirectory traverses all .json files in the given directory and loads them
// loadFromDirectory traverses all .json files in the given directory and loads them.
// Entries are processed in lexical order so duplicate-scope detection is deterministic.
func (b *LocalPDP) loadFromDirectory(directory string) error {
// open the directory
dir, err := os.Open(directory)
files, err := os.ReadDir(directory)
if err != nil {
return err
}
defer dir.Close()

// read all the files in the directory
files, err := dir.Readdir(0)
if err != nil {
return err
}

// load all the files
for _, file := range files {
if file.IsDir() {
continue
Expand Down
Loading