diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 618f46a..d49c8aa 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,6 +7,8 @@ on: jobs: publish: runs-on: ubuntu-latest + permissions: + id-token: write # Required for authentication using OIDC steps: - name: Checkout @@ -50,7 +52,9 @@ jobs: run: dart pub publish --dry-run - name: Publish Package - run: dart pub publish -f + uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 + with: + environment: 'pub.dev' - name: Upload Coverage to CodeCov uses: codecov/codecov-action@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index b918e11..2ddbd4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## 5.0.4 + + ## 5.0.3 Updated dependencies diff --git a/pub_login.sh b/pub_login.sh index 441cffb..f13fdab 100644 --- a/pub_login.sh +++ b/pub_login.sh @@ -1,4 +1,4 @@ -# This script creates/updates credentials.json file which is used +# This script creates/updates ~/Library/Application\ Support/dart/pub-credentials.json file which is used # to authorize publisher when publishing packages to pub.dev # Checking whether the secrets are available as environment @@ -30,7 +30,7 @@ cat < $HOME/.config/dart/pub-credentials.json "refreshToken":"${PUB_DEV_PUBLISH_REFRESH_TOKEN}", "tokenEndpoint":"${PUB_DEV_PUBLISH_TOKEN_ENDPOINT}", "idToken": "${PUB_DEV_PUBLISH_ID_TOKEN}", - "scopes":["openid","https://www.googleapis.com/auth/userinfo.email"], + "scopes":["https://www.googleapis.com/auth/userinfo.email","openid"], "expiration":${PUB_DEV_PUBLISH_EXPIRATION} } EOF \ No newline at end of file diff --git a/test/network_tools_test.dart b/test/network_tools_test.dart index 2d46c86..c0af705 100644 --- a/test/network_tools_test.dart +++ b/test/network_tools_test.dart @@ -54,6 +54,10 @@ void main() { test('Running OpenPort tests', () { final actualOpenPort = openPort; final expectedOpenPort = OpenPort(port); + final json = { + 'port': expectedOpenPort.port, + 'isOpen': expectedOpenPort.isOpen, + }; if (actualOpenPort != null) { expect(actualOpenPort, expectedOpenPort); @@ -62,6 +66,35 @@ void main() { expect(expectedOpenPort.isOpen, equals(true)); // because default is true expect(expectedOpenPort.hashCode, expectedOpenPort.port.hashCode); expect(expectedOpenPort.toString(), expectedOpenPort.port.toString()); + expect(expectedOpenPort.toJson(), json); + expect(OpenPort.fromJson(json), expectedOpenPort); + }); + test('Running ARPData tests', () { + final json = { + 'hostname': 'Local', + 'iPAddress': '192.168.1.1', + 'macAddress': '00:00:3F:C1:DD:3E', + 'interfaceName': 'eth0', + 'interfaceType': 'bridge', + }; + + final arpData = ARPData.fromJson(json); + expect(arpData.toJson(), json); + expect(arpData.notNullIPAddress, true); + expect(arpData.notNullMacAddress, true); + expect(arpData.notNullInterfaceType, true); + }); + + test('Running Vendor tests', () { + final json = { + 'macPrefix': '00:00:0C', + 'vendorName': 'Cisco Systems, Inc', + 'private': 'false', + 'blockType': 'MA-L', + 'lastUpdate': '2015/11/17', + }; + final vendor = Vendor.fromJson(json); + expect(vendor.toJson(), json); }); });