Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
feat: vc status client supports DID+IdentityHub resolution (#335)
Browse files Browse the repository at this point in the history
Signed-off-by: Filip Burlacu <Filip.Burlacu@gendigital.com>
  • Loading branch information
Moopli authored Mar 28, 2023
1 parent 7de3c50 commit c39a101
Show file tree
Hide file tree
Showing 11 changed files with 1,318 additions and 20 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/vc-status.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
# Copyright Gen Digital Inc. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
name: vc-status
on:
push:
paths:
- 'component/vc/status/**'
pull_request:
paths:
- 'component/vc/status/**'
jobs:
linter:
name: Go linter
timeout-minutes: 10
env:
LINT_PATH: component/vc/status
GOLANGCI_LINT_IMAGE: "golangci/golangci-lint:v1.50.0"
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2

- name: Checks linter
timeout-minutes: 10
run: make lint
unitTest:
name: Unit test
runs-on: ubuntu-18.04
timeout-minutes: 15
env:
UNIT_TESTS_PATH: component/vc/status
steps:
- name: Setup Go 1.19
uses: actions/setup-go@v2
with:
go-version: 1.19
id: go

- uses: actions/checkout@v2

- name: Run unit test
timeout-minutes: 15
run: make unit-test

- name: Upload coverage to Codecov
timeout-minutes: 10
if: github.repository == 'hyperledger/aries-framework-go-ext'
uses: codecov/codecov-action@v1.0.14
with:
file: ./coverage.out

109 changes: 109 additions & 0 deletions component/vc/status/.custom_golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#
# Copyright Gen Digital Inc. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

run:
concurrency: 4
deadline: 3m
issues-exit-code: 1
tests: true
build-tags: [""]
skip-dirs: [""]

output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true

linters-settings:
errcheck:
check-type-assertions: true
check-blank: true
govet:
check-shadowing: true
gofmt:
simplify: true
goimports:
local-prefixes: github.com/hyperledger/aries-framework-go-ext
gci:
sections:
- standard
- default
- prefix(github.com/hyperledger/aries-framework-go-ext)
- dot
gocyclo:
min-complexity: 10
dupl:
threshold: 500
goconst:
min-len: 3
min-occurrences: 3
misspell:
# default locale is a neutral variety of English.
locale:
ignore-words: []
lll:
line-length: 120
tab-width: 1
unused:
check-exported: false
unparam:
check-exported: false
nakedret:
max-func-lines: 0
gocritic:
enabled-tags:
- diagnostic
- performance
- style
- opinionated
disabled-checks:
- whyNoLint # TODO enable.
funlen:
lines: 60
statements: 40
wsl:
strict-append: true
allow-assign-and-call: true
allow-multiline-assign: true
allow-case-traling-whitespace: true
allow-cuddle-declarations: false
godot:
check-all: false
gomoddirectives:
replace-local: true

linters:
enable-all: true
disable:
- goerr113
- paralleltest
- exhaustivestruct
- exhaustruct
- interfacer # deprecated by the author https://github.com/mvdan/interfacer#interfacer
- scopelint # deprecated by the author https://github.com/kyoh86/scopelint#obsoleted
- maligned # deprecated by the author https://github.com/mdempsky/maligned
- cyclop # TODO consider replacing gocyclo with cyclop
- ifshort # TODO enable
- wrapcheck # TODO enable
- forbidigo # TODO enable
- typecheck

issues:
exclude-use-default: false
exclude-rules:
- path: _test\.go
linters:
- dupl
- funlen
- gomnd
- path: /
linters:
- exhaustruct
- typecheck

exclude:
- Line contains TODO/BUG/FIXME
- unnamedResult
2 changes: 1 addition & 1 deletion component/vc/status/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module github.com/hyperledger/aries-framework-go-ext/component/vc/status
go 1.19

require (
github.com/google/uuid v1.3.0
github.com/hyperledger/aries-framework-go v0.1.10-0.20230307184157-877172747719
github.com/stretchr/testify v1.8.1
)
Expand All @@ -20,7 +21,6 @@ require (
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/tink/go v1.7.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hyperledger/aries-framework-go/spi v0.0.0-20221025204933-b807371b6f1e // indirect
github.com/hyperledger/ursa-wrapper-go v0.3.1 // indirect
github.com/kilic/bls12-381 v0.1.1-0.20210503002446-7b7597926c69 // indirect
Expand Down
4 changes: 2 additions & 2 deletions component/vc/status/internal/bitstring/bitstring.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ func Decode(src string) ([]byte, error) {

b := bytes.NewReader(decodedBits)

r, err := gzip.NewReader(b)
zipReader, err := gzip.NewReader(b)
if err != nil {
return nil, err
}

buf := new(bytes.Buffer)
if _, err := buf.ReadFrom(r); err != nil {
if _, err := buf.ReadFrom(zipReader); err != nil {
return nil, err
}

Expand Down
Loading

0 comments on commit c39a101

Please sign in to comment.