diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 000000000..fae8c9ce2 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,57 @@ +name: "CodeQL" + +on: + push: + branches: [ master, development* ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ master, development* ] + schedule: + - cron: '21 5 * * 6' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'go' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index bcf8cdafe..d14ef3a03 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-go@v2 with: - go-version: 1.15 + go-version: 1.18 - run: go test -json ./... > report.json diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index b3498d7aa..22e447a5f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - go-version: [1.14, 1.15, 1.16, "^1"] + go-version: [1.17, 1.18, "^1"] steps: - uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index 6becfd021..519f0d3ad 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ coverage.out # idea files .idea + +# Generated binaries +/_examples/docscan/docscan diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 545c83118..7230056ab 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,5 @@ +default_stages: + - commit repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.4.0 @@ -25,14 +27,16 @@ repos: language: 'script' description: "Go imports" - - repo: git://github.com/dnephin/pre-commit-golang + - repo: https://github.com/dnephin/pre-commit-golang rev: v0.3.5 hooks: - id: go-vet exclude: _examples - id: go-cyclo - args: [-over=15] + exclude: _examples + args: [ "-over", "15", "-ignore", ".pb.go" ] - id: golangci-lint args: ["-e", "SA1019"] - id: go-unit-tests args: ["-race", "./..."] + stages: [ push ] # only run tests on push, not on commit diff --git a/README.md b/README.md index 99f16ee07..7447a16d0 100644 --- a/README.md +++ b/README.md @@ -35,13 +35,14 @@ Supported Go Versions: ## Enabling the SDK -_As of version **2.4.0**, [modules](https://github.com/golang/go/wiki/Modules) are used. This means it's not necessary to get a copy or fetch all dependencies, as the Go toolchain will fetch them as necessary. You can simply add a `require github.com/getyoti/yoti-go-sdk/v3` to go.mod._ - -You can reference the project URL by adding the following import: - +Simply add `github.com/getyoti/yoti-go-sdk/v3` as an import: ```Go import "github.com/getyoti/yoti-go-sdk/v3" ``` +or add the following line to your go.mod file (check https://github.com/getyoti/yoti-go-sdk/releases for the latest version) +``` +require github.com/getyoti/yoti-go-sdk/v3 v3.0.0 +``` ## Setup diff --git a/_docs/DOC_SCAN.md b/_docs/DOC_SCAN.md deleted file mode 100644 index a390fdb0e..000000000 --- a/_docs/DOC_SCAN.md +++ /dev/null @@ -1,9 +0,0 @@ - # Yoti Doc Scan - - ## About - Yoti Doc Scan can be seamlessly integrated with your website, app or custom product so you can perform secure identity checks. You'll be able to request specific ID documents from users directly from your website or app. - - See the [Developer Docs](https://developers.yoti.com/yoti/getting-started-docscan) for more information. - - ## Running the example -- See the [_examples/docscan](../_examples/docscan) folder for instructions on how to run the Doc Scan Example project \ No newline at end of file diff --git a/_docs/IDV.md b/_docs/IDV.md new file mode 100644 index 000000000..ba3b66c40 --- /dev/null +++ b/_docs/IDV.md @@ -0,0 +1,9 @@ + # Yoti IDV (Doc Scan) + + ## About + Yoti IDV can be seamlessly integrated with your website, app or custom product so you can perform secure identity checks. You'll be able to request specific ID documents from users directly from your website or app. + + See the [Developer Docs](https://developers.yoti.com/identity-verification/getting-started) for more information. + + ## Running the example +- See the [_examples/idv](../_examples/idv) folder for instructions on how to run the IDV Example project \ No newline at end of file diff --git a/_docs/DOC_SCAN_SANDBOX.md b/_docs/IDV_SANDBOX.md similarity index 82% rename from _docs/DOC_SCAN_SANDBOX.md rename to _docs/IDV_SANDBOX.md index 32b3fc7f1..5de276f9e 100644 --- a/_docs/DOC_SCAN_SANDBOX.md +++ b/_docs/IDV_SANDBOX.md @@ -1,6 +1,6 @@ -# Yoti Go Doc Scan Sandbox Module +# Yoti Go IDV (Doc Scan) Sandbox Module -This module contains the tools you need to test your Go back-end integration with the Doc Scan Sandbox service. +This module contains the tools you need to test your Go back-end integration with the IDV Sandbox service. ## Importing the Sandbox @@ -22,4 +22,4 @@ Please do not open the PEM file, as this might corrupt the key, and you will nee ## Examples -- [Doc Scan Sandbox WebDriver Example](../_examples/docscansandbox/) \ No newline at end of file +- [IDV Sandbox WebDriver Example](../_examples/docscansandbox/) \ No newline at end of file diff --git a/_examples/aml/go.mod b/_examples/aml/go.mod index 47ca30174..16e5ef7ad 100644 --- a/_examples/aml/go.mod +++ b/_examples/aml/go.mod @@ -1,10 +1,12 @@ module aml -go 1.12 +go 1.17 require ( github.com/getyoti/yoti-go-sdk/v3 v3.0.0 github.com/joho/godotenv v1.3.0 ) +require google.golang.org/protobuf v1.28.0 // indirect + replace github.com/getyoti/yoti-go-sdk/v3 => ../../ diff --git a/_examples/aml/go.sum b/_examples/aml/go.sum index ddc28fe08..ddfb878d8 100644 --- a/_examples/aml/go.sum +++ b/_examples/aml/go.sum @@ -1,24 +1,11 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gotest.tools/v3 v3.2.0 h1:I0DwBVMGAx26dttAj1BtJLAkVGncrkkUXfJLC4Flt/I= diff --git a/_examples/docscan/go.mod b/_examples/docscan/go.mod deleted file mode 100644 index 1083a8519..000000000 --- a/_examples/docscan/go.mod +++ /dev/null @@ -1,11 +0,0 @@ -module docscan - -go 1.12 - -require ( - github.com/getyoti/yoti-go-sdk/v3 v3.0.0 - github.com/gin-gonic/gin v1.7.0 - github.com/joho/godotenv v1.3.0 -) - -replace github.com/getyoti/yoti-go-sdk/v3 => ../../ diff --git a/_examples/docscan/templates/check.html b/_examples/docscan/templates/check.html deleted file mode 100644 index ab04c3e56..000000000 --- a/_examples/docscan/templates/check.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - {{ if .Report }} - {{ if .Report.Recommendation }} - - - - - {{ end }} - {{ if .Report.Breakdown }} - - - - - {{ end }} - {{ end }} - - {{ if .GeneratedMedia}} - - - - - {{end}} - -
ID{{ .ID}}
State - - {{ .State }} - -
Created{{ .Created }}
Last Updated{{ .LastUpdated }}
Resources Used - {{ range $index, $element := .ResourcesUsed}} - {{if $index}},{{end}} - {{$element}} - {{end}} -
Recommendation - - - - - - - - - - - - - - - -
Value{{ .Report.Recommendation.Value }}
Reason{{ .Report.Recommendation.Reason }}
Recovery Suggestion{{ .Report.Recommendation.RecoverySuggestion }}
-
Breakdown - {{ range $breakdown := .Report.Breakdown}} - - - - - - - - - - - {{ if $breakdown.Details }} - - - - - {{ end }} - -
Sub Check{{ $breakdown.SubCheck }}
Result{{ $breakdown.Result }}
Details - - - {{ range $detail := $breakdown.Details}} - - - - - {{ end }} - -
{{ $detail.Name }}{{ $detail.Value }}
-
- {{ end }} -
Generated Media - {{ range $media := .GeneratedMedia }} - - - - - - - - - - - -
ID{{ $media.ID }}
Type{{ $media.Type }}
- {{ end }} -
\ No newline at end of file diff --git a/_examples/docscansandbox/README.md b/_examples/docscansandbox/README.md index 3b7142c5d..80b107b18 100644 --- a/_examples/docscansandbox/README.md +++ b/_examples/docscansandbox/README.md @@ -1,4 +1,4 @@ -# Doc Scan Sandbox Example +# IDV (Doc Scan) Sandbox Example An example of configuring a session response can be found in the [Demo Test](./demo_test.go) diff --git a/_examples/docscansandbox/go.mod b/_examples/docscansandbox/go.mod index 038397ca0..7e73a8ffb 100644 --- a/_examples/docscansandbox/go.mod +++ b/_examples/docscansandbox/go.mod @@ -1,6 +1,6 @@ module docscansandbox -go 1.12 +go 1.17 require ( github.com/cucumber/godog v0.10.0 @@ -10,4 +10,18 @@ require ( github.com/tebeka/selenium v0.9.9 ) +require ( + github.com/blang/semver v3.5.1+incompatible // indirect + github.com/cucumber/gherkin-go/v11 v11.0.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/gofrs/uuid v3.2.0+incompatible // indirect + github.com/gogo/protobuf v1.3.1 // indirect + github.com/hashicorp/go-immutable-radix v1.2.0 // indirect + github.com/hashicorp/go-memdb v1.2.1 // indirect + github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/stretchr/testify v1.6.1 // indirect + gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect +) + replace github.com/getyoti/yoti-go-sdk/v3 => ../../ diff --git a/_examples/docscansandbox/go.sum b/_examples/docscansandbox/go.sum index 1cbb0b335..b22e2ec15 100644 --- a/_examples/docscansandbox/go.sum +++ b/_examples/docscansandbox/go.sum @@ -35,16 +35,11 @@ github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github/v27 v27.0.4/go.mod h1:/0Gr8pJ55COkmv+S/yPKCczSkUPIM/LnFyubufRNIS0= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -76,11 +71,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= @@ -144,9 +136,6 @@ golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190624190245-7f2218787638/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -162,9 +151,7 @@ google.golang.org/genproto v0.0.0-20190626174449-989357319d63/go.mod h1:z3L6/3dT google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= @@ -173,8 +160,7 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= +gotest.tools/v3 v3.2.0 h1:I0DwBVMGAx26dttAj1BtJLAkVGncrkkUXfJLC4Flt/I= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/_examples/docscan/.env.example b/_examples/idv/.env.example similarity index 100% rename from _examples/docscan/.env.example rename to _examples/idv/.env.example diff --git a/_examples/docscan/README.md b/_examples/idv/README.md similarity index 70% rename from _examples/docscan/README.md rename to _examples/idv/README.md index c02169aa1..d405755bb 100644 --- a/_examples/docscan/README.md +++ b/_examples/idv/README.md @@ -1,8 +1,8 @@ -# Doc Scan Example +# IDV (Doc Scan) Example ## Running the example 1. Rename the [.env.example](.env.example) file to `.env` and fill in the required configuration values 1. Create the binary executable file: `go build` -1. Run the executable: `./docscan` (UNIX) or `docscan.exe` (Windows) +1. Run the executable: `./idv` (UNIX) or `idv.exe` (Windows) 1. Visit `https://localhost:8080` \ No newline at end of file diff --git a/_examples/idv/go.mod b/_examples/idv/go.mod new file mode 100644 index 000000000..3c3ed9b52 --- /dev/null +++ b/_examples/idv/go.mod @@ -0,0 +1,30 @@ +module idv + +go 1.17 + +require ( + github.com/getyoti/yoti-go-sdk/v3 v3.0.0 + github.com/gin-gonic/gin v1.7.0 + github.com/joho/godotenv v1.3.0 +) + +require ( + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-playground/locales v0.13.0 // indirect + github.com/go-playground/universal-translator v0.17.0 // indirect + github.com/go-playground/validator/v10 v10.4.1 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/json-iterator/go v1.1.9 // indirect + github.com/leodido/go-urn v1.2.0 // indirect + github.com/mattn/go-isatty v0.0.12 // indirect + github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect + github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect + github.com/ugorji/go/codec v1.1.7 // indirect + golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect + golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect + google.golang.org/protobuf v1.28.0 // indirect + gopkg.in/yaml.v2 v2.2.8 // indirect +) + +replace github.com/getyoti/yoti-go-sdk/v3 => ../../ diff --git a/_examples/docscan/go.sum b/_examples/idv/go.sum similarity index 82% rename from _examples/docscan/go.sum rename to _examples/idv/go.sum index 367357fc1..92c57b27c 100644 --- a/_examples/docscan/go.sum +++ b/_examples/idv/go.sum @@ -17,7 +17,6 @@ github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaW github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -33,42 +32,37 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OH github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= +gotest.tools/v3 v3.2.0 h1:I0DwBVMGAx26dttAj1BtJLAkVGncrkkUXfJLC4Flt/I= diff --git a/_examples/docscan/handlers.session.go b/_examples/idv/handlers.session.go similarity index 77% rename from _examples/docscan/handlers.session.go rename to _examples/idv/handlers.session.go index ca5f841c4..3ee4c0233 100644 --- a/_examples/docscan/handlers.session.go +++ b/_examples/idv/handlers.session.go @@ -1,6 +1,7 @@ package main import ( + "errors" "fmt" "io/ioutil" "net/http" @@ -24,25 +25,35 @@ var ( ) func showIndexPage(c *gin.Context) { - initialiseDocScanClient(c) + err := initialiseDocScanClient() + if err != nil { + c.HTML( + http.StatusUnprocessableEntity, + "error.html", + gin.H{ + "ErrorTitle": "Error initialising Doc Scan (IDV) Client", + "ErrorMessage": errors.Unwrap(err)}) + return + } sessionSpec, err := buildSessionSpec() if err != nil { c.HTML( - http.StatusBadRequest, + http.StatusInternalServerError, "error.html", gin.H{ "ErrorTitle": "Error when building sessions spec", "ErrorMessage": err.Error()}) + return } createSessionResult, err = client.CreateSession(sessionSpec) if err != nil { c.HTML( - http.StatusBadRequest, + http.StatusInternalServerError, "error.html", gin.H{ - "ErrorTitle": "Error when creating Doc Scan session", + "ErrorTitle": "Error when creating Doc Scan (IDV) session", "ErrorMessage": err.Error()}) return } @@ -70,12 +81,21 @@ func getIframeURL(sessionID, sessionToken string) string { } func showSuccessPage(c *gin.Context) { - ensureDocScanClientInitialised(c) + err := ensureDocScanClientInitialised() + if err != nil { + c.HTML( + http.StatusUnprocessableEntity, + "error.html", + gin.H{ + "ErrorTitle": "error setting the Doc Scan (IDV) Client", + "ErrorMessage": err.Error()}) + return + } sessionId, err := c.Cookie("session_id") if err != nil || sessionId == "" { c.HTML( - http.StatusBadRequest, + http.StatusUnprocessableEntity, "error.html", gin.H{ "ErrorTitle": "Failed to get session ID", @@ -88,7 +108,7 @@ func showSuccessPage(c *gin.Context) { getSessionResult, err := client.GetSession(sessionId) if err != nil { c.HTML( - http.StatusBadRequest, + http.StatusInternalServerError, "error.html", gin.H{ "ErrorTitle": "Get Session Failed", @@ -110,44 +130,35 @@ func showSuccessPage(c *gin.Context) { return } -func ensureDocScanClientInitialised(c *gin.Context) { +func ensureDocScanClientInitialised() error { if client == nil { - initialiseDocScanClient(c) + return initialiseDocScanClient() } - return + return nil } -func initialiseDocScanClient(c *gin.Context) { +func initialiseDocScanClient() error { var err error sdkID = os.Getenv("YOTI_CLIENT_SDK_ID") keyFilePath := os.Getenv("YOTI_KEY_FILE_PATH") key, err = ioutil.ReadFile(keyFilePath) if err != nil { - c.HTML( - http.StatusBadRequest, - "error.html", - gin.H{ - "ErrorTitle": "Failed to get key from YOTI_KEY_FILE_PATH", - "ErrorMessage": err.Error()}) + return fmt.Errorf("failed to get key from YOTI_KEY_FILE_PATH :: %w", err) } client, err = docscan.NewClient(sdkID, key) if err != nil { - c.HTML( - http.StatusBadRequest, - "error.html", - gin.H{ - "ErrorTitle": "Failed to initialise Yoti Doc Scan client", - "ErrorMessage": err.Error()}) + return fmt.Errorf("failed to initialise Yoti Doc Scan (IDV) client :: %w", err) } - return + + return nil } func getMedia(c *gin.Context) { sessionId, err := c.Cookie("session_id") if err != nil || sessionId == "" { c.HTML( - http.StatusBadRequest, + http.StatusInternalServerError, "error.html", gin.H{ "ErrorTitle": "Failed to get session ID", @@ -158,12 +169,6 @@ func getMedia(c *gin.Context) { mediaID := c.Query("mediaId") media, err := client.GetMediaContent(sessionId, mediaID) - - if media == nil && err == nil { - c.Status(http.StatusNoContent) - return - } - if err != nil || sessionId == "" { c.HTML( http.StatusBadRequest, @@ -174,6 +179,11 @@ func getMedia(c *gin.Context) { return } + if media == nil { + c.Status(http.StatusNoContent) + return + } + c.Header("Content-Type", media.MIME()) c.Data(http.StatusOK, media.MIME(), media.Data()) return diff --git a/_examples/docscan/main.go b/_examples/idv/main.go similarity index 100% rename from _examples/docscan/main.go rename to _examples/idv/main.go diff --git a/_examples/docscan/middleware.auth.go b/_examples/idv/middleware.auth.go similarity index 100% rename from _examples/docscan/middleware.auth.go rename to _examples/idv/middleware.auth.go diff --git a/_examples/docscan/models.sessionspec.go b/_examples/idv/models.sessionspec.go similarity index 82% rename from _examples/docscan/models.sessionspec.go rename to _examples/idv/models.sessionspec.go index 2c5e6d981..1a4d77073 100644 --- a/_examples/docscan/models.sessionspec.go +++ b/_examples/idv/models.sessionspec.go @@ -33,31 +33,51 @@ func buildSessionSpec() (sessionSpec *create.SessionSpecification, err error) { return nil, err } - var textExtractionTask *task.RequestedTextExtractionTask - textExtractionTask, err = task.NewRequestedTextExtractionTaskBuilder(). - WithManualCheckAlways(). + var idDocsComparisonCheck *check.RequestedIDDocumentComparisonCheck + idDocsComparisonCheck, err = check.NewRequestedIDDocumentComparisonCheckBuilder(). Build() if err != nil { return nil, err } - var idDocsComparisonCheck *check.RequestedIDDocumentComparisonCheck - idDocsComparisonCheck, err = check.NewRequestedIDDocumentComparisonCheckBuilder(). + var thirdPartyCheck *check.RequestedThirdPartyIdentityCheck + thirdPartyCheck, err = check.NewRequestedThirdPartyIdentityCheckBuilder(). Build() if err != nil { return nil, err } - var supplementaryDocTextExtractionTask *task.RequestedSupplementaryDocTextExtractionTask - supplementaryDocTextExtractionTask, err = task.NewRequestedSupplementaryDocTextExtractionTaskBuilder(). + var watchlistScreeningCheck *check.RequestedWatchlistScreeningCheck + watchlistScreeningCheck, err = check.NewRequestedWatchlistScreeningCheckBuilder(). + WithAdverseMediaCategory(). + WithSanctionsCategory(). + Build() + if err != nil { + return nil, err + } + + yotiAccountWatchlistAdvancedCACheck, err := check.NewRequestedWatchlistAdvancedCACheckYotiAccountBuilder(). + WithRemoveDeceased(true). + WithShareURL(true). + WithSources(check.RequestedTypeListSources{ + Types: []string{"pep", "fitness-probity", "warning"}}). + WithMatchingStrategy(check.RequestedFuzzyMatchingStrategy{Fuzziness: 0.5}). + Build() + if err != nil { + return nil, err + } + + var textExtractionTask *task.RequestedTextExtractionTask + textExtractionTask, err = task.NewRequestedTextExtractionTaskBuilder(). WithManualCheckAlways(). Build() if err != nil { return nil, err } - var thirdPartyCheck *check.RequestedThirdPartyIdentityCheck - thirdPartyCheck, err = check.NewRequestedThirdPartyIdentityCheckBuilder(). + var supplementaryDocTextExtractionTask *task.RequestedSupplementaryDocTextExtractionTask + supplementaryDocTextExtractionTask, err = task.NewRequestedSupplementaryDocTextExtractionTaskBuilder(). + WithManualCheckAlways(). Build() if err != nil { return nil, err @@ -75,7 +95,6 @@ func buildSessionSpec() (sessionSpec *create.SessionSpecification, err error) { WithErrorUrl("https://localhost:8080/error"). WithPrivacyPolicyUrl("https://localhost:8080/privacy-policy"). Build() - if err != nil { return nil, err } @@ -95,6 +114,9 @@ func buildSessionSpec() (sessionSpec *create.SessionSpecification, err error) { } idDoc, err := filter.NewRequiredIDDocumentBuilder().Build() + if err != nil { + return nil, err + } proofOfAddressObjective, err := objective.NewProofOfAddressObjectiveBuilder().Build() if err != nil { @@ -117,6 +139,8 @@ func buildSessionSpec() (sessionSpec *create.SessionSpecification, err error) { WithRequestedCheck(livenessCheck). WithRequestedCheck(idDocsComparisonCheck). WithRequestedCheck(thirdPartyCheck). + WithRequestedCheck(watchlistScreeningCheck). + WithRequestedCheck(yotiAccountWatchlistAdvancedCACheck). WithRequestedTask(textExtractionTask). WithRequestedTask(supplementaryDocTextExtractionTask). WithSDKConfig(sdkConfig). diff --git a/_examples/docscan/routes.go b/_examples/idv/routes.go similarity index 100% rename from _examples/docscan/routes.go rename to _examples/idv/routes.go diff --git a/_examples/docscan/static/images/favicon.png b/_examples/idv/static/images/favicon.png similarity index 100% rename from _examples/docscan/static/images/favicon.png rename to _examples/idv/static/images/favicon.png diff --git a/_examples/docscan/static/images/logo.svg b/_examples/idv/static/images/logo.svg similarity index 100% rename from _examples/docscan/static/images/logo.svg rename to _examples/idv/static/images/logo.svg diff --git a/_examples/docscan/static/style.css b/_examples/idv/static/style.css similarity index 100% rename from _examples/docscan/static/style.css rename to _examples/idv/static/style.css diff --git a/_examples/idv/templates/check.html b/_examples/idv/templates/check.html new file mode 100644 index 000000000..5069e4859 --- /dev/null +++ b/_examples/idv/templates/check.html @@ -0,0 +1,218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + {{ if .Report }} + {{ if .Report.Recommendation }} + + + + + {{ end }} + {{ if .Report.Breakdown }} + + + + + {{ end }} + + {{ if .Report }} + {{ if .Report.WatchlistSummary }} + + + + + {{ end }} + {{ end }} + {{ end }} + + {{ if .GeneratedMedia}} + + + + + {{end}} + + {{ if .GeneratedProfile}} + + + + + {{end}} + +
ID{{ .ID}}
State + + {{ .State }} + +
Created{{ .Created }}
Last Updated{{ .LastUpdated }}
Resources Used + {{ range $index, $element := .ResourcesUsed}} + {{if $index}},{{end}} + {{$element}} + {{end}} +
Recommendation + + + + + + + + + + + + + + + +
Value{{ .Report.Recommendation.Value }}
Reason{{ .Report.Recommendation.Reason }}
Recovery Suggestion{{ .Report.Recommendation.RecoverySuggestion }}
+
Breakdown + {{ range $breakdown := .Report.Breakdown}} + + + + + + + + + + + {{ if $breakdown.Details }} + + + + + {{ end }} + +
Sub Check{{ $breakdown.SubCheck }}
Result{{ $breakdown.Result }}
Details + + + {{ range $detail := $breakdown.Details}} + + + + + {{ end }} + +
{{ $detail.Name }}{{ $detail.Value }}
+
+ {{ end }} +
Watchlist Summary + + + + + + + {{ if .Report.WatchlistSummary.AssociatedCountryCodes }} + + + + + {{ end }} + {{ if and .Report.WatchlistSummary.RawResults .Report.WatchlistSummary.RawResults.Media }} }} + + + + + {{ end }} + {{ if and .Report.WatchlistSummary.SearchConfig .Report.WatchlistSummary.SearchConfig.Categories }} + + + + + {{ end }} + +
Total hits{{ .Report.WatchlistSummary.TotalHits }}
Associated country codes + {{ range $cc := .Report.WatchlistSummary.AssociatedCountryCodes }} + {{ $cc }} + {{ end }} +
Raw results + + + + + + + +
Media + + + + + + {{ .Report.WatchlistSummary.RawResults.Media.ID }} + + + + + + + +
ID
Type{{ .Report.WatchlistSummary.RawResults.Media.Type }}
+
+
Search config + + + + + + + +
Categories + {{ range $c := .Report.WatchlistSummary.SearchConfig.Categories }} + {{ $c }} + {{ end }} +
+
+
Generated Media + {{ range $media := .GeneratedMedia }} + + + + + + + + + + + +
ID{{ $media.ID }}
Type{{ $media.Type }}
+ {{ end }} +
Generated Profile + + + + + + + + + + + +
ID{{ .GeneratedProfile.Media.ID }}
Type{{ .GeneratedProfile.Media.Type }}
+
\ No newline at end of file diff --git a/_examples/docscan/templates/error.html b/_examples/idv/templates/error.html similarity index 100% rename from _examples/docscan/templates/error.html rename to _examples/idv/templates/error.html diff --git a/_examples/docscan/templates/footer.html b/_examples/idv/templates/footer.html similarity index 100% rename from _examples/docscan/templates/footer.html rename to _examples/idv/templates/footer.html diff --git a/_examples/docscan/templates/header.html b/_examples/idv/templates/header.html similarity index 92% rename from _examples/docscan/templates/header.html rename to _examples/idv/templates/header.html index 2480c4123..0671dd2a4 100644 --- a/_examples/docscan/templates/header.html +++ b/_examples/idv/templates/header.html @@ -4,7 +4,7 @@ - Yoti Doc Scan + Yoti IDV @@ -15,6 +15,6 @@ diff --git a/_examples/docscan/templates/index.html b/_examples/idv/templates/index.html similarity index 100% rename from _examples/docscan/templates/index.html rename to _examples/idv/templates/index.html diff --git a/_examples/docscan/templates/privacy.html b/_examples/idv/templates/privacy.html similarity index 100% rename from _examples/docscan/templates/privacy.html rename to _examples/idv/templates/privacy.html diff --git a/_examples/docscan/templates/success.html b/_examples/idv/templates/success.html similarity index 92% rename from _examples/docscan/templates/success.html rename to _examples/idv/templates/success.html index 948ea6641..a0dc216ce 100644 --- a/_examples/docscan/templates/success.html +++ b/_examples/idv/templates/success.html @@ -128,7 +128,7 @@

{{ range $check := .getSessionResult.LivenessChecks }} - {{ template "check.html" $check}} + {{ template "check.html" $check}} {{ end }}
@@ -148,7 +148,7 @@

{{ range $check := .getSessionResult.IDDocumentComparisonChecks }} - {{ template "check.html" $check}} + {{ template "check.html" $check}} {{ end }}
@@ -197,6 +197,47 @@

{{ end }} + {{ if .getSessionResult.WatchlistScreeningChecks }} +
+
+

+ +

+
+
+
+ {{ range $check := .getSessionResult.WatchlistScreeningChecks }} + {{ template "check.html" $check }} + {{ end }} +
+
+
+ {{ end }} + + {{ if .getSessionResult.WatchlistAdvancedCAChecks }} +
+
+

+ +

+
+
+
+ {{ range $check := .getSessionResult.WatchlistAdvancedCAChecks }} + {{ template "check.html" $check }} + {{ end }} +
+
+
+ {{ end }} diff --git a/_examples/docscan/templates/task.html b/_examples/idv/templates/task.html similarity index 100% rename from _examples/docscan/templates/task.html rename to _examples/idv/templates/task.html diff --git a/_examples/docscan/yotiSelfSignedCert.pem b/_examples/idv/yotiSelfSignedCert.pem similarity index 100% rename from _examples/docscan/yotiSelfSignedCert.pem rename to _examples/idv/yotiSelfSignedCert.pem diff --git a/_examples/docscan/yotiSelfSignedKey.pem b/_examples/idv/yotiSelfSignedKey.pem similarity index 100% rename from _examples/docscan/yotiSelfSignedKey.pem rename to _examples/idv/yotiSelfSignedKey.pem diff --git a/_examples/profile/.gitignore b/_examples/profile/.gitignore index 2568002de..8c1a71dae 100644 --- a/_examples/profile/.gitignore +++ b/_examples/profile/.gitignore @@ -3,3 +3,6 @@ # Example project generated self-signed certificate /yotiSelfSignedCert.pem /yotiSelfSignedKey.pem + +# Compiled binary +/profile diff --git a/_examples/profile/README.md b/_examples/profile/README.md index 423dc3751..c2bd667c3 100644 --- a/_examples/profile/README.md +++ b/_examples/profile/README.md @@ -40,7 +40,7 @@ Keeping your settings and access keys outside your repository is highly recommen 1. Set the application domain of your app to `localhost:8080` 2. Set the scenario callback URL to `/profile` 3. Rename the [.env.example](_examples/profile/.env.example) file to `.env` and fill in the required configuration values (mentioned in the [Configuration](#configuration) section) -4. Retrieve dependencies with `go get` -5. Start the server with `go run main.go certificatehelper.go` +4. Build with `go build` +5. Start the compiled program by running `./profile` Visiting `https://localhost:8080/` should show a webpage with a Yoti button rendered on it diff --git a/_examples/profile/dbscheck.go b/_examples/profile/dbscheck.go new file mode 100644 index 000000000..e6ab4f9ac --- /dev/null +++ b/_examples/profile/dbscheck.go @@ -0,0 +1,49 @@ +package main + +import ( + "context" + "fmt" + "net/http" + + "github.com/getyoti/yoti-go-sdk/v3/dynamic" +) + +func dbsCheck(w http.ResponseWriter, req *http.Request) { + identityProfile := []byte(`{ + "trust_framework": "UK_TFIDA", + "scheme": { + "type": "DBS", + "objective": "BASIC" + } + }`) + + policy, err := (&dynamic.PolicyBuilder{}). + WithIdentityProfileRequirements(identityProfile). + Build() + if err != nil { + errorPage(w, req.WithContext(context.WithValue( + req.Context(), + contextKey("yotiError"), + fmt.Sprintf(scenarioBuilderErr, err), + ))) + return + } + + subject := []byte(`{ + "subject_id": "my_subject_id" + }`) + scenario, err := (&dynamic.ScenarioBuilder{}). + WithPolicy(policy). + WithSubject(subject). + WithCallbackEndpoint(profileEndpoint).Build() + if err != nil { + errorPage(w, req.WithContext(context.WithValue( + req.Context(), + contextKey("yotiError"), + fmt.Sprintf(scenarioBuilderErr, err), + ))) + return + } + + pageFromScenario(w, req, "DBS Check Example", scenario) +} diff --git a/_examples/profile/dynamicshare.go b/_examples/profile/dynamicshare.go new file mode 100644 index 000000000..a136238ad --- /dev/null +++ b/_examples/profile/dynamicshare.go @@ -0,0 +1,96 @@ +package main + +import ( + "context" + "fmt" + "html/template" + "io/ioutil" + "net/http" + "os" + + "github.com/getyoti/yoti-go-sdk/v3" + "github.com/getyoti/yoti-go-sdk/v3/dynamic" +) + +func dynamicShare(w http.ResponseWriter, req *http.Request) { + policy, err := (&dynamic.PolicyBuilder{}).WithFullName().WithEmail().Build() + if err != nil { + errorPage(w, req.WithContext(context.WithValue( + req.Context(), + contextKey("yotiError"), + fmt.Sprintf(scenarioBuilderErr, err), + ))) + return + } + scenario, err := (&dynamic.ScenarioBuilder{}).WithPolicy(policy).WithCallbackEndpoint(profileEndpoint).Build() + if err != nil { + errorPage(w, req.WithContext(context.WithValue( + req.Context(), + contextKey("yotiError"), + fmt.Sprintf(scenarioBuilderErr, err), + ))) + return + } + + pageFromScenario(w, req, "Dynamic Share example", scenario) +} + +func pageFromScenario(w http.ResponseWriter, req *http.Request, title string, scenario dynamic.Scenario) { + sdkID := os.Getenv("YOTI_CLIENT_SDK_ID") + + key, err := ioutil.ReadFile(os.Getenv("YOTI_KEY_FILE_PATH")) + if err != nil { + errorPage(w, req.WithContext(context.WithValue( + req.Context(), + contextKey("yotiError"), + fmt.Sprintf("Unable to retrieve `YOTI_KEY_FILE_PATH`. Error: `%s`", err.Error()), + ))) + return + } + + client, err := yoti.NewClient(sdkID, key) + if err != nil { + errorPage(w, req.WithContext(context.WithValue( + req.Context(), + contextKey("yotiError"), + fmt.Sprintf("%s", err), + ))) + } + + share, err := client.CreateShareURL(&scenario) + if err != nil { + errorPage(w, req.WithContext(context.WithValue( + req.Context(), + contextKey("yotiError"), + fmt.Sprintf("%s", err.Error()), + ))) + return + } + + templateVars := map[string]interface{}{ + "pageTitle": title, + "yotiClientSdkID": sdkID, + "yotiShareURL": share.ShareURL, + } + + var t *template.Template + t, err = template.ParseFiles("dynamic-share.html") + if err != nil { + errorPage(w, req.WithContext(context.WithValue( + req.Context(), + contextKey("yotiError"), + fmt.Sprintf("error parsing template: "+err.Error()), + ))) + return + } + + err = t.Execute(w, templateVars) + if err != nil { + errorPage(w, req.WithContext(context.WithValue( + req.Context(), + contextKey("yotiError"), + fmt.Sprintf("error applying the parsed template: "+err.Error()), + ))) + return + } +} diff --git a/_examples/profile/error.go b/_examples/profile/error.go new file mode 100644 index 000000000..71739df2d --- /dev/null +++ b/_examples/profile/error.go @@ -0,0 +1,24 @@ +package main + +import ( + "html/template" + "log" + "net/http" +) + +func errorPage(w http.ResponseWriter, r *http.Request) { + templateVars := map[string]interface{}{ + "yotiError": r.Context().Value(contextKey("yotiError")).(string), + } + log.Printf("%s", templateVars["yotiError"]) + t, err := template.ParseFiles("error.html") + if err != nil { + panic(errParsingTheTemplate + err.Error()) + } + + err = t.Execute(w, templateVars) + if err != nil { + panic(errApplyingTheParsedTemplate + err.Error()) + } + +} diff --git a/_examples/profile/go.mod b/_examples/profile/go.mod index c4dddedab..d25fc9599 100644 --- a/_examples/profile/go.mod +++ b/_examples/profile/go.mod @@ -1,10 +1,12 @@ module profile -go 1.12 +go 1.17 require ( github.com/getyoti/yoti-go-sdk/v3 v3.0.0 github.com/joho/godotenv v1.3.0 ) +require google.golang.org/protobuf v1.28.0 // indirect + replace github.com/getyoti/yoti-go-sdk/v3 => ../../ diff --git a/_examples/profile/go.sum b/_examples/profile/go.sum index ddc28fe08..ddfb878d8 100644 --- a/_examples/profile/go.sum +++ b/_examples/profile/go.sum @@ -1,24 +1,11 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gotest.tools/v3 v3.2.0 h1:I0DwBVMGAx26dttAj1BtJLAkVGncrkkUXfJLC4Flt/I= diff --git a/_examples/profile/main.go b/_examples/profile/main.go index 73bba4345..11c8730d1 100644 --- a/_examples/profile/main.go +++ b/_examples/profile/main.go @@ -1,21 +1,15 @@ package main import ( - "bytes" "context" "fmt" "html/template" - "image" - "image/jpeg" - "io" - "io/ioutil" "log" "net/http" "os" "path" "github.com/getyoti/yoti-go-sdk/v3" - "github.com/getyoti/yoti-go-sdk/v3/dynamic" _ "github.com/joho/godotenv/autoload" ) @@ -62,248 +56,6 @@ func home(w http.ResponseWriter, req *http.Request) { } } -func sourceConstraints(w http.ResponseWriter, req *http.Request) { - constraint, err := (&dynamic.SourceConstraintBuilder{}).WithDrivingLicence("").WithPassport("").Build() - if err != nil { - errorPage(w, req.WithContext(context.WithValue( - req.Context(), - contextKey("yotiError"), - fmt.Sprintf("Constraint Builder Error: `%s`", err), - ))) - return - } - - policy, err := (&dynamic.PolicyBuilder{}).WithFullName(constraint).WithStructuredPostalAddress(constraint).Build() - if err != nil { - errorPage(w, req.WithContext(context.WithValue( - req.Context(), - contextKey("yotiError"), - fmt.Sprintf("Policy Builder Error: `%s`", err), - ))) - return - } - - scenario, err := (&dynamic.ScenarioBuilder{}).WithPolicy(policy). - WithCallbackEndpoint(profileEndpoint).Build() - if err != nil { - errorPage(w, req.WithContext(context.WithValue( - req.Context(), - contextKey("yotiError"), - fmt.Sprintf(scenarioBuilderErr, err), - ))) - return - } - - pageFromScenario(w, req, "Source Constraint example", scenario) -} - -func dynamicShare(w http.ResponseWriter, req *http.Request) { - policy, err := (&dynamic.PolicyBuilder{}).WithFullName().WithEmail().Build() - if err != nil { - errorPage(w, req.WithContext(context.WithValue( - req.Context(), - contextKey("yotiError"), - fmt.Sprintf(scenarioBuilderErr, err), - ))) - return - } - scenario, err := (&dynamic.ScenarioBuilder{}).WithPolicy(policy).WithCallbackEndpoint(profileEndpoint).Build() - if err != nil { - errorPage(w, req.WithContext(context.WithValue( - req.Context(), - contextKey("yotiError"), - fmt.Sprintf(scenarioBuilderErr, err), - ))) - return - } - - pageFromScenario(w, req, "Dynamic Share example", scenario) -} - -func pageFromScenario(w http.ResponseWriter, req *http.Request, title string, scenario dynamic.Scenario) { - sdkID := os.Getenv("YOTI_CLIENT_SDK_ID") - - key, err := ioutil.ReadFile(os.Getenv("YOTI_KEY_FILE_PATH")) - if err != nil { - errorPage(w, req.WithContext(context.WithValue( - req.Context(), - contextKey("yotiError"), - fmt.Sprintf("Unable to retrieve `YOTI_KEY_FILE_PATH`. Error: `%s`", err.Error()), - ))) - return - } - - client, err := yoti.NewClient(sdkID, key) - if err != nil { - errorPage(w, req.WithContext(context.WithValue( - req.Context(), - contextKey("yotiError"), - fmt.Sprintf("%s", err), - ))) - } - - share, err := client.CreateShareURL(&scenario) - if err != nil { - errorPage(w, req.WithContext(context.WithValue( - req.Context(), - contextKey("yotiError"), - fmt.Sprintf("%s", err.Error()), - ))) - return - } - - templateVars := map[string]interface{}{ - "pageTitle": title, - "yotiClientSdkID": sdkID, - "yotiShareURL": share.ShareURL, - } - - var t *template.Template - t, err = template.ParseFiles("dynamic-share.html") - if err != nil { - errorPage(w, req.WithContext(context.WithValue( - req.Context(), - contextKey("yotiError"), - fmt.Sprintf("error parsing template: "+err.Error()), - ))) - return - } - - err = t.Execute(w, templateVars) - if err != nil { - errorPage(w, req.WithContext(context.WithValue( - req.Context(), - contextKey("yotiError"), - fmt.Sprintf("error applying the parsed template: "+err.Error()), - ))) - return - } -} - -func errorPage(w http.ResponseWriter, r *http.Request) { - templateVars := map[string]interface{}{ - "yotiError": r.Context().Value(contextKey("yotiError")).(string), - } - log.Printf("%s", templateVars["yotiError"]) - t, err := template.ParseFiles("error.html") - if err != nil { - panic(errParsingTheTemplate + err.Error()) - } - - err = t.Execute(w, templateVars) - if err != nil { - panic(errApplyingTheParsedTemplate + err.Error()) - } - -} - -func profile(w http.ResponseWriter, r *http.Request) { - var err error - key, err = ioutil.ReadFile(os.Getenv("YOTI_KEY_FILE_PATH")) - sdkID = os.Getenv("YOTI_CLIENT_SDK_ID") - - if err != nil { - errorPage(w, r.WithContext(context.WithValue( - r.Context(), - contextKey("yotiError"), - fmt.Sprintf("Unable to retrieve `YOTI_KEY_FILE_PATH`. Error: `%s`", err.Error()), - ))) - return - } - - client, err = yoti.NewClient(sdkID, key) - if err != nil { - errorPage(w, r.WithContext(context.WithValue( - r.Context(), - contextKey("yotiError"), - fmt.Sprintf("%s", err), - ))) - } - - yotiOneTimeUseToken := r.URL.Query().Get("token") - - activityDetails, err := client.GetActivityDetails(yotiOneTimeUseToken) - if err != nil { - errorPage(w, r.WithContext(context.WithValue( - r.Context(), - contextKey("yotiError"), - err.Error(), - ))) - return - } - - userProfile := activityDetails.UserProfile - - selfie := userProfile.Selfie() - var base64URL string - if selfie != nil { - base64URL = selfie.Value().Base64URL() - - decodedImage := decodeImage(selfie.Value().Data()) - file := createImage() - saveImage(decodedImage, file) - } - - dob, err := userProfile.DateOfBirth() - if err != nil { - errorPage(w, r.WithContext(context.WithValue( - r.Context(), - contextKey("yotiError"), - fmt.Sprintf("Error parsing Date of Birth attribute. Error %q", err.Error()), - ))) - return - } - - var dateOfBirthString string - if dob != nil { - dateOfBirthString = dob.Value().String() - } - - templateVars := map[string]interface{}{ - "profile": userProfile, - "selfieBase64URL": template.URL(base64URL), - "rememberMeID": activityDetails.RememberMeID(), - "dateOfBirth": dateOfBirthString, - } - - var t *template.Template - t, err = template.New("profile.html"). - Funcs(template.FuncMap{ - "escapeURL": func(s string) template.URL { - return template.URL(s) - }, - "marshalAttribute": func(name string, icon string, property interface{}, prevalue string) interface{} { - return struct { - Name string - Icon string - Prop interface{} - Prevalue string - }{ - name, - icon, - property, - prevalue, - } - }, - }). - ParseFiles("profile.html") - if err != nil { - fmt.Println(err) - return - } - - err = t.Execute(w, templateVars) - - if err != nil { - errorPage(w, r.WithContext(context.WithValue( - r.Context(), - contextKey("yotiError"), - fmt.Sprintf("Error applying the parsed profile template. Error: `%s`", err), - ))) - return - } -} - func main() { // Check if the cert files are available. certificatePresent := certificatePresenceCheck(selfSignedCertName, selfSignedKeyName) @@ -319,6 +71,7 @@ func main() { http.HandleFunc(profileEndpoint, profile) http.HandleFunc("/dynamic-share", dynamicShare) http.HandleFunc("/source-constraints", sourceConstraints) + http.HandleFunc("/dbs-check", dbsCheck) rootdir, err := os.Getwd() if err != nil { @@ -336,33 +89,3 @@ func main() { panic("Error when calling `ListenAndServeTLS`: " + err.Error()) } } - -func decodeImage(imageBytes []byte) image.Image { - decodedImage, _, err := image.Decode(bytes.NewReader(imageBytes)) - - if err != nil { - panic("Error when decoding the image: " + err.Error()) - } - - return decodedImage -} - -func createImage() (file *os.File) { - file, err := os.Create("./images/YotiSelfie.jpeg") - - if err != nil { - panic("Error when creating the image: " + err.Error()) - } - return -} - -func saveImage(img image.Image, file io.Writer) { - var opt jpeg.Options - opt.Quality = 100 - - err := jpeg.Encode(file, img, &opt) - - if err != nil { - panic("Error when saving the image: " + err.Error()) - } -} diff --git a/_examples/profile/profile.go b/_examples/profile/profile.go new file mode 100644 index 000000000..9492d49c5 --- /dev/null +++ b/_examples/profile/profile.go @@ -0,0 +1,160 @@ +package main + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "html/template" + "image" + "image/jpeg" + "io" + "io/ioutil" + "net/http" + "os" + + "github.com/getyoti/yoti-go-sdk/v3" +) + +func profile(w http.ResponseWriter, r *http.Request) { + var err error + key, err = ioutil.ReadFile(os.Getenv("YOTI_KEY_FILE_PATH")) + sdkID = os.Getenv("YOTI_CLIENT_SDK_ID") + + if err != nil { + errorPage(w, r.WithContext(context.WithValue( + r.Context(), + contextKey("yotiError"), + fmt.Sprintf("Unable to retrieve `YOTI_KEY_FILE_PATH`. Error: `%s`", err.Error()), + ))) + return + } + + client, err = yoti.NewClient(sdkID, key) + if err != nil { + errorPage(w, r.WithContext(context.WithValue( + r.Context(), + contextKey("yotiError"), + fmt.Sprintf("%s", err), + ))) + } + + yotiOneTimeUseToken := r.URL.Query().Get("token") + + activityDetails, err := client.GetActivityDetails(yotiOneTimeUseToken) + if err != nil { + errorPage(w, r.WithContext(context.WithValue( + r.Context(), + contextKey("yotiError"), + err.Error(), + ))) + return + } + + userProfile := activityDetails.UserProfile + + selfie := userProfile.Selfie() + var base64URL string + if selfie != nil { + base64URL = selfie.Value().Base64URL() + + decodedImage := decodeImage(selfie.Value().Data()) + file := createImage() + saveImage(decodedImage, file) + } + + dob, err := userProfile.DateOfBirth() + if err != nil { + errorPage(w, r.WithContext(context.WithValue( + r.Context(), + contextKey("yotiError"), + fmt.Sprintf("Error parsing Date of Birth attribute. Error %q", err.Error()), + ))) + return + } + + var dateOfBirthString string + if dob != nil { + dateOfBirthString = dob.Value().String() + } + + templateVars := map[string]interface{}{ + "profile": userProfile, + "selfieBase64URL": template.URL(base64URL), + "rememberMeID": activityDetails.RememberMeID(), + "dateOfBirth": dateOfBirthString, + } + + var t *template.Template + t, err = template.New("profile.html"). + Funcs(template.FuncMap{ + "escapeURL": func(s string) template.URL { + return template.URL(s) + }, + "marshalAttribute": func(name string, icon string, property interface{}, prevalue string) interface{} { + return struct { + Name string + Icon string + Prop interface{} + Prevalue string + }{ + name, + icon, + property, + prevalue, + } + }, + "jsonMarshallIndent": func(data interface{}) string { + json, err := json.MarshalIndent(data, "", "\t") + if err != nil { + fmt.Println(err) + } + return string(json) + }, + }). + ParseFiles("profile.html") + if err != nil { + fmt.Println(err) + return + } + + err = t.Execute(w, templateVars) + + if err != nil { + errorPage(w, r.WithContext(context.WithValue( + r.Context(), + contextKey("yotiError"), + fmt.Sprintf("Error applying the parsed profile template. Error: `%s`", err), + ))) + return + } +} +func decodeImage(imageBytes []byte) image.Image { + decodedImage, _, err := image.Decode(bytes.NewReader(imageBytes)) + + if err != nil { + panic("Error when decoding the image: " + err.Error()) + } + + return decodedImage +} + +func createImage() (file *os.File) { + file, err := os.Create("./images/YotiSelfie.jpeg") + + if err != nil { + panic("Error when creating the image: " + err.Error()) + } + return +} + +func saveImage(img image.Image, file io.Writer) { + var opt jpeg.Options + opt.Quality = 100 + + err := jpeg.Encode(file, img, &opt) + + if err != nil { + panic("Error when saving the image: " + err.Error()) + } +} diff --git a/_examples/profile/profile.html b/_examples/profile/profile.html index 6077798bb..8a54cf2fd 100644 --- a/_examples/profile/profile.html +++ b/_examples/profile/profile.html @@ -46,6 +46,15 @@ {{ end }} + {{ else if eq .Prop.Name "identity_profile_report" }} + + {{ range $key, $value := .Prop.Value }} + + + + + {{ end }} +
{{ $key }}{{ jsonMarshallIndent $value }}
{{ else }} {{ .Prevalue }} {{ .Prop.Value }} @@ -132,6 +141,7 @@ {{ if .profile.Gender }} {{ template "attribute" marshalAttribute "Gender" "yoti-icon-gender" .profile.Gender "" }} {{ end }} {{ if .profile.DocumentDetails }} {{ template "attribute" marshalAttribute "Document Details" "yoti-icon-document" .profile.DocumentDetails "" }} {{ end }} {{ if .profile.DocumentImages }} {{ template "attribute" marshalAttribute "Document Images" "yoti-icon-profile" .profile.DocumentImages "" }} {{ end }} + {{ if .profile.IdentityProfileReport }} {{ template "attribute" marshalAttribute "Identity Profile Report" "yoti-icon-profile" .profile.IdentityProfileReport "" }} {{ end }} diff --git a/_examples/profile/sourceconstraints.go b/_examples/profile/sourceconstraints.go new file mode 100644 index 000000000..f24f5a5a8 --- /dev/null +++ b/_examples/profile/sourceconstraints.go @@ -0,0 +1,44 @@ +package main + +import ( + "context" + "fmt" + "net/http" + + "github.com/getyoti/yoti-go-sdk/v3/dynamic" +) + +func sourceConstraints(w http.ResponseWriter, req *http.Request) { + constraint, err := (&dynamic.SourceConstraintBuilder{}).WithDrivingLicence("").WithPassport("").Build() + if err != nil { + errorPage(w, req.WithContext(context.WithValue( + req.Context(), + contextKey("yotiError"), + fmt.Sprintf("Constraint Builder Error: `%s`", err), + ))) + return + } + + policy, err := (&dynamic.PolicyBuilder{}).WithFullName(constraint).WithStructuredPostalAddress(constraint).Build() + if err != nil { + errorPage(w, req.WithContext(context.WithValue( + req.Context(), + contextKey("yotiError"), + fmt.Sprintf("Policy Builder Error: `%s`", err), + ))) + return + } + + scenario, err := (&dynamic.ScenarioBuilder{}).WithPolicy(policy). + WithCallbackEndpoint(profileEndpoint).Build() + if err != nil { + errorPage(w, req.WithContext(context.WithValue( + req.Context(), + contextKey("yotiError"), + fmt.Sprintf(scenarioBuilderErr, err), + ))) + return + } + + pageFromScenario(w, req, "Source Constraint example", scenario) +} diff --git a/_examples/profilesandbox/go.mod b/_examples/profilesandbox/go.mod index 8ead95d4c..c45018fdd 100644 --- a/_examples/profilesandbox/go.mod +++ b/_examples/profilesandbox/go.mod @@ -1,11 +1,16 @@ module profilesandbox -go 1.12 +go 1.17 require ( github.com/getyoti/yoti-go-sdk/v3 v3.0.0 github.com/joho/godotenv v1.3.0 - gotest.tools/v3 v3.0.3 + gotest.tools/v3 v3.2.0 +) + +require ( + github.com/google/go-cmp v0.5.5 // indirect + google.golang.org/protobuf v1.28.0 // indirect ) replace github.com/getyoti/yoti-go-sdk/v3 => ../../ diff --git a/_examples/profilesandbox/go.sum b/_examples/profilesandbox/go.sum index ddc28fe08..3798409c5 100644 --- a/_examples/profilesandbox/go.sum +++ b/_examples/profilesandbox/go.sum @@ -1,24 +1,35 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gotest.tools/v3 v3.2.0 h1:I0DwBVMGAx26dttAj1BtJLAkVGncrkkUXfJLC4Flt/I= +gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= diff --git a/consts/attribute_names.go b/consts/attribute_names.go index 7b201f784..21e3b238f 100644 --- a/consts/attribute_names.go +++ b/consts/attribute_names.go @@ -15,6 +15,7 @@ const ( AttrNationality = "nationality" AttrDocumentImages = "document_images" AttrDocumentDetails = "document_details" + AttrIdentityProfileReport = "identity_profile_report" AttrAgeOver = "age_over:%d" AttrAgeUnder = "age_under:%d" ) diff --git a/consts/version.go b/consts/version.go index 25b61d97e..951c3c537 100644 --- a/consts/version.go +++ b/consts/version.go @@ -2,5 +2,5 @@ package consts const ( SDKIdentifier = "Go" - SDKVersionIdentifier = "3.5.0" + SDKVersionIdentifier = "3.6.0" ) diff --git a/cryptoutil/crypto_utils_test.go b/cryptoutil/crypto_utils_test.go index 2c524fdc1..4b425feea 100644 --- a/cryptoutil/crypto_utils_test.go +++ b/cryptoutil/crypto_utils_test.go @@ -13,7 +13,7 @@ import ( "github.com/getyoti/yoti-go-sdk/v3/file" "github.com/getyoti/yoti-go-sdk/v3/util" "github.com/getyoti/yoti-go-sdk/v3/yotiprotocom" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "gotest.tools/v3/assert" ) diff --git a/docscan/client.go b/docscan/client.go index 37048ea99..1595594fe 100644 --- a/docscan/client.go +++ b/docscan/client.go @@ -67,7 +67,7 @@ func getAPIURL() string { } } -// CreateSession creates a Doc Scan session using the supplied session specification +// CreateSession creates a Doc Scan (IDV) session using the supplied session specification func (c *Client) CreateSession(sessionSpec *create.SessionSpecification) (*create.SessionResult, error) { requestBody, err := marshalJSON(c.jsonMarshaler, sessionSpec) if err != nil { @@ -106,7 +106,7 @@ func (c *Client) CreateSession(sessionSpec *create.SessionSpecification) (*creat return &result, err } -// GetSession retrieves the state of a previously created Yoti Doc Scan session +// GetSession retrieves the state of a previously created Yoti Doc Scan (IDV) session func (c *Client) GetSession(sessionID string) (*retrieve.GetSessionResult, error) { if sessionID == "" { return nil, fmt.Errorf(mustNotBeEmptyString, "sessionID") @@ -141,7 +141,7 @@ func (c *Client) GetSession(sessionID string) (*retrieve.GetSessionResult, error return &result, err } -// DeleteSession deletes a previously created Yoti Doc Scan session and all of its related resources +// DeleteSession deletes a previously created Yoti Doc Scan (IDV) session and all of its related resources func (c *Client) DeleteSession(sessionID string) error { if sessionID == "" { return fmt.Errorf(mustNotBeEmptyString, "sessionID") @@ -166,7 +166,7 @@ func (c *Client) DeleteSession(sessionID string) error { return nil } -// GetMediaContent retrieves media related to a Yoti Doc Scan session based on the supplied media ID +// GetMediaContent retrieves media related to a Yoti Doc Scan (IDV) session based on the supplied media ID func (c *Client) GetMediaContent(sessionID, mediaID string) (media.Media, error) { if sessionID == "" { return nil, fmt.Errorf(mustNotBeEmptyString, "sessionID") @@ -213,7 +213,7 @@ func (c *Client) GetMediaContent(sessionID, mediaID string) (media.Media, error) return result, err } -// DeleteMediaContent deletes media related to a Yoti Doc Scan session based on the supplied media ID +// DeleteMediaContent deletes media related to a Yoti Doc Scan (IDV) session based on the supplied media ID func (c *Client) DeleteMediaContent(sessionID, mediaID string) error { if sessionID == "" { return fmt.Errorf(mustNotBeEmptyString, "sessionID") diff --git a/docscan/constants/constants.go b/docscan/constants/constants.go index 9b578a878..a9ca13a59 100644 --- a/docscan/constants/constants.go +++ b/docscan/constants/constants.go @@ -9,8 +9,18 @@ const ( SupplementaryDocumentTextDataCheck string = "SUPPLEMENTARY_DOCUMENT_TEXT_DATA_CHECK" ThirdPartyIdentityCheck string = "THIRD_PARTY_IDENTITY" SupplementaryDocumentTextDataExtraction string = "SUPPLEMENTARY_DOCUMENT_TEXT_DATA_EXTRACTION" - Liveness string = "LIVENESS" - Zoom string = "ZOOM" + WatchlistScreening string = "WATCHLIST_SCREENING" + WatchlistAdvancedCA string = "WATCHLIST_ADVANCED_CA" + + WithYotiAccounts = "WITH_YOTI_ACCOUNT" + WithCustomAccount = "WITH_CUSTOM_ACCOUNT" + TypeList = "TYPE_LIST" + Profiles = "PROFILE" + Exact = "EXACT" + Fuzzy = "FUZZY" + + Liveness string = "LIVENESS" + Zoom string = "ZOOM" Camera string = "CAMERA" CameraAndUpload string = "CAMERA_AND_UPLOAD" @@ -20,6 +30,9 @@ const ( CheckCompletion string = "CHECK_COMPLETION" SessionCompletion string = "SESSION_COMPLETION" + Sanctions string = "SANCTIONS" + AdverseMedia string = "ADVERSE-MEDIA" + Always string = "ALWAYS" Fallback string = "FALLBACK" Never string = "NEVER" diff --git a/docscan/sandbox/request/task/text_data_extraction_recommendation_test.go b/docscan/sandbox/request/task/text_data_extraction_recommendation_test.go index b8cdddf18..5c4dcb14e 100644 --- a/docscan/sandbox/request/task/text_data_extraction_recommendation_test.go +++ b/docscan/sandbox/request/task/text_data_extraction_recommendation_test.go @@ -9,6 +9,10 @@ func ExampleTextDataExtractionRecommendationBuilder() { reason, err := NewTextDataExtractionReasonBuilder(). ForQuality(). Build() + if err != nil { + fmt.Printf("error: %s", err.Error()) + return + } recommendation, err := NewTextDataExtractionRecommendationBuilder(). ForShouldTryAgain(). diff --git a/docscan/session/create/check/third_party_identity.go b/docscan/session/create/check/third_party_identity.go index ec2a1b34b..6af6d40d6 100644 --- a/docscan/session/create/check/third_party_identity.go +++ b/docscan/session/create/check/third_party_identity.go @@ -47,7 +47,7 @@ func NewRequestedThirdPartyIdentityCheckBuilder() *RequestedThirdPartyIdentityCh return &RequestedThirdPartyIdentityCheckBuilder{} } -// Build builds te RequestedThirdPartyIdentityCheck +// Build builds the RequestedThirdPartyIdentityCheck func (b *RequestedThirdPartyIdentityCheckBuilder) Build() (*RequestedThirdPartyIdentityCheck, error) { return &RequestedThirdPartyIdentityCheck{ config: b.config, diff --git a/docscan/session/create/check/third_party_identity_test.go b/docscan/session/create/check/third_party_identity_test.go index a8bbdbe03..4a8c7fc36 100644 --- a/docscan/session/create/check/third_party_identity_test.go +++ b/docscan/session/create/check/third_party_identity_test.go @@ -7,7 +7,6 @@ import ( func ExampleRequestedThirdPartyIdentityCheck() { thirdPartyCheck, err := NewRequestedThirdPartyIdentityCheckBuilder().Build() - if err != nil { fmt.Printf("error: %s", err.Error()) return diff --git a/docscan/session/create/check/watchlist_advanced_ca.go b/docscan/session/create/check/watchlist_advanced_ca.go new file mode 100644 index 000000000..c2ccd698b --- /dev/null +++ b/docscan/session/create/check/watchlist_advanced_ca.go @@ -0,0 +1,9 @@ +package check + +type RequestedWatchlistAdvancedCAConfig struct { + Type string `json:"type,omitempty"` + RemoveDeceased bool `json:"remove_deceased,omitempty"` + ShareUrl bool `json:"share_url,omitempty"` + Sources RequestedCASources `json:"sources,omitempty"` + MatchingStrategy RequestedCAMatchingStrategy `json:"matching_strategy,omitempty"` +} diff --git a/docscan/session/create/check/watchlist_advanced_ca_custom.go b/docscan/session/create/check/watchlist_advanced_ca_custom.go new file mode 100644 index 000000000..61e6aa357 --- /dev/null +++ b/docscan/session/create/check/watchlist_advanced_ca_custom.go @@ -0,0 +1,120 @@ +package check + +import ( + "encoding/json" + + "github.com/getyoti/yoti-go-sdk/v3/docscan/constants" +) + +type RequestedWatchlistAdvancedCACustomAccountCheck struct { + config RequestedWatchlistAdvancedCACustomAccountConfig +} + +// Type is the type of the requested check +func (c RequestedWatchlistAdvancedCACustomAccountCheck) Type() string { + return constants.WatchlistAdvancedCA +} + +// Config is the configuration of the requested check +func (c RequestedWatchlistAdvancedCACustomAccountCheck) Config() RequestedCheckConfig { + return RequestedCheckConfig(c.config) +} + +// MarshalJSON returns the JSON encoding +func (c RequestedWatchlistAdvancedCACustomAccountCheck) MarshalJSON() ([]byte, error) { + return json.Marshal(&struct { + Type string `json:"type"` + Config RequestedCheckConfig `json:"config,omitempty"` + }{ + Type: c.Type(), + Config: c.Config(), + }) +} + +func NewRequestedWatchlistAdvancedCACheckCustomAccountBuilder() *RequestedWatchlistAdvancedCACheckCustomAccountBuilder { + return &RequestedWatchlistAdvancedCACheckCustomAccountBuilder{} +} + +type RequestedWatchlistAdvancedCACustomAccountConfig struct { + RequestedWatchlistAdvancedCAConfig + APIKey string `json:"api_key,omitempty"` + Monitoring bool `json:"monitoring,omitempty"` + Tags map[string]string `json:"tags,omitempty"` + ClientRef string `json:"client_ref,omitempty"` +} + +type RequestedWatchlistAdvancedCACheckCustomAccountBuilder struct { + removeDeceased bool + shareURL bool + requestedCASources RequestedCASources + requestedCAMatchingStrategy RequestedCAMatchingStrategy + apiKey string + monitoring bool + tags map[string]string + clientRef string +} + +// WithAPIKey sets the API key for the Watchlist Advanced CA check (custom account). +func (b *RequestedWatchlistAdvancedCACheckCustomAccountBuilder) WithAPIKey(apiKey string) *RequestedWatchlistAdvancedCACheckCustomAccountBuilder { + b.apiKey = apiKey + return b +} + +// WithMonitoring sets whether monitoring is used for the Watchlist Advanced CA check (custom account). +func (b *RequestedWatchlistAdvancedCACheckCustomAccountBuilder) WithMonitoring(monitoring bool) *RequestedWatchlistAdvancedCACheckCustomAccountBuilder { + b.monitoring = monitoring + return b +} + +// WithTags sets tags used for custom account Watchlist Advanced CA check. +// Please note this will override any previously set tags +func (b *RequestedWatchlistAdvancedCACheckCustomAccountBuilder) WithTags(tags map[string]string) *RequestedWatchlistAdvancedCACheckCustomAccountBuilder { + b.tags = tags + return b +} + +// WithClientRef sets the client reference for the Watchlist Advanced CA check (custom account). +func (b *RequestedWatchlistAdvancedCACheckCustomAccountBuilder) WithClientRef(clientRef string) *RequestedWatchlistAdvancedCACheckCustomAccountBuilder { + b.clientRef = clientRef + return b +} + +func (b *RequestedWatchlistAdvancedCACheckCustomAccountBuilder) WithRemoveDeceased(removeDeceased bool) *RequestedWatchlistAdvancedCACheckCustomAccountBuilder { + b.removeDeceased = removeDeceased + return b +} + +func (b *RequestedWatchlistAdvancedCACheckCustomAccountBuilder) WithShareURL(shareURL bool) *RequestedWatchlistAdvancedCACheckCustomAccountBuilder { + b.shareURL = shareURL + return b +} + +func (b *RequestedWatchlistAdvancedCACheckCustomAccountBuilder) WithSources(requestedCASources RequestedCASources) *RequestedWatchlistAdvancedCACheckCustomAccountBuilder { + b.requestedCASources = requestedCASources + return b +} + +func (b *RequestedWatchlistAdvancedCACheckCustomAccountBuilder) WithMatchingStrategy(requestedCAMatchingStrategy RequestedCAMatchingStrategy) *RequestedWatchlistAdvancedCACheckCustomAccountBuilder { + b.requestedCAMatchingStrategy = requestedCAMatchingStrategy + return b +} + +func (b RequestedWatchlistAdvancedCACheckCustomAccountBuilder) Build() (RequestedWatchlistAdvancedCACustomAccountCheck, error) { + config := RequestedWatchlistAdvancedCACustomAccountConfig{ + RequestedWatchlistAdvancedCAConfig: RequestedWatchlistAdvancedCAConfig{ + Type: constants.WithCustomAccount, + RemoveDeceased: b.removeDeceased, + ShareUrl: b.shareURL, + Sources: b.requestedCASources, + MatchingStrategy: b.requestedCAMatchingStrategy, + }, + APIKey: b.apiKey, + Monitoring: b.monitoring, + Tags: b.tags, + ClientRef: b.clientRef, + } + + return RequestedWatchlistAdvancedCACustomAccountCheck{ + config: config, + }, nil +} diff --git a/docscan/session/create/check/watchlist_advanced_ca_custom_test.go b/docscan/session/create/check/watchlist_advanced_ca_custom_test.go new file mode 100644 index 000000000..7478ac7ac --- /dev/null +++ b/docscan/session/create/check/watchlist_advanced_ca_custom_test.go @@ -0,0 +1,32 @@ +package check_test + +import ( + "fmt" + + "github.com/getyoti/yoti-go-sdk/v3/docscan/session/create/check" +) + +func ExampleRequestedWatchlistAdvancedCACheckCustomAccountBuilder_Build() { + advancedCACustomAccountCheck, err := check.NewRequestedWatchlistAdvancedCACheckCustomAccountBuilder(). + WithAPIKey("api-key"). + WithMonitoring(true). + WithTags(map[string]string{ + "tag_name": "value", + }). + WithClientRef("client-ref"). + WithMatchingStrategy(check.RequestedExactMatchingStrategy{ExactMatch: true}). + Build() + if err != nil { + fmt.Printf("error: %s", err.Error()) + return + } + + data, err := advancedCACustomAccountCheck.MarshalJSON() + if err != nil { + fmt.Printf("error: %s", err.Error()) + return + } + + fmt.Println(string(data)) + // Output: {"type":"WATCHLIST_ADVANCED_CA","config":{"type":"WITH_CUSTOM_ACCOUNT","matching_strategy":{"type":"EXACT","exact_match":true},"api_key":"api-key","monitoring":true,"tags":{"tag_name":"value"},"client_ref":"client-ref"}} +} diff --git a/docscan/session/create/check/watchlist_advanced_ca_matching_strategy.go b/docscan/session/create/check/watchlist_advanced_ca_matching_strategy.go new file mode 100644 index 000000000..136381b5c --- /dev/null +++ b/docscan/session/create/check/watchlist_advanced_ca_matching_strategy.go @@ -0,0 +1,48 @@ +package check + +import ( + "encoding/json" + + "github.com/getyoti/yoti-go-sdk/v3/docscan/constants" +) + +// RequestedCAMatchingStrategy is the base type which other CA matching strategies must satisfy +type RequestedCAMatchingStrategy interface { + Type() string +} + +func NewRequestedFuzzyMatchingStrategy() *RequestedFuzzyMatchingStrategy { + return &RequestedFuzzyMatchingStrategy{} +} + +type RequestedFuzzyMatchingStrategy struct { + RequestedCAMatchingStrategy + Fuzziness float64 +} + +// MarshalJSON returns the JSON encoding +func (c RequestedFuzzyMatchingStrategy) MarshalJSON() ([]byte, error) { + return json.Marshal(&struct { + Type string `json:"type"` + Fuzziness float64 `json:"fuzziness"` + }{ + Type: constants.Fuzzy, + Fuzziness: c.Fuzziness, + }) +} + +type RequestedExactMatchingStrategy struct { + RequestedCAMatchingStrategy + ExactMatch bool +} + +// MarshalJSON returns the JSON encoding +func (c RequestedExactMatchingStrategy) MarshalJSON() ([]byte, error) { + return json.Marshal(&struct { + Type string `json:"type"` + ExactMatch bool `json:"exact_match"` + }{ + Type: constants.Exact, + ExactMatch: c.ExactMatch, + }) +} diff --git a/docscan/session/create/check/watchlist_advanced_ca_sources.go b/docscan/session/create/check/watchlist_advanced_ca_sources.go new file mode 100644 index 000000000..cd209f0b5 --- /dev/null +++ b/docscan/session/create/check/watchlist_advanced_ca_sources.go @@ -0,0 +1,34 @@ +package check + +import ( + "encoding/json" + + "github.com/getyoti/yoti-go-sdk/v3/docscan/constants" +) + +// RequestedCASources is the base type which other CA sources must satisfy +type RequestedCASources interface { + Type() string + MarshalJSON() ([]byte, error) +} + +type RequestedTypeListSources struct { + RequestedCASources + Types []string +} + +// Type is the type of the Requested Check +func (c RequestedTypeListSources) Type() string { + return constants.TypeList +} + +// MarshalJSON returns the JSON encoding +func (c RequestedTypeListSources) MarshalJSON() ([]byte, error) { + return json.Marshal(&struct { + Type string `json:"type"` + Types []string `json:"types"` + }{ + Type: c.Type(), + Types: c.Types, + }) +} diff --git a/docscan/session/create/check/watchlist_advanced_ca_yoti.go b/docscan/session/create/check/watchlist_advanced_ca_yoti.go new file mode 100644 index 000000000..407d9ceb2 --- /dev/null +++ b/docscan/session/create/check/watchlist_advanced_ca_yoti.go @@ -0,0 +1,84 @@ +package check + +import ( + "encoding/json" + + "github.com/getyoti/yoti-go-sdk/v3/docscan/constants" +) + +type RequestedWatchlistAdvancedCAYotiAccountCheck struct { + config RequestedWatchlistAdvancedCAYotiAccountConfig +} + +// Type is the type of the requested check +func (c RequestedWatchlistAdvancedCAYotiAccountCheck) Type() string { + return constants.WatchlistAdvancedCA +} + +// Config is the configuration of the requested check +func (c RequestedWatchlistAdvancedCAYotiAccountCheck) Config() RequestedCheckConfig { + return RequestedCheckConfig(c.config) +} + +// MarshalJSON returns the JSON encoding +func (c RequestedWatchlistAdvancedCAYotiAccountCheck) MarshalJSON() ([]byte, error) { + return json.Marshal(&struct { + Type string `json:"type"` + Config RequestedCheckConfig `json:"config,omitempty"` + }{ + Type: c.Type(), + Config: c.Config(), + }) +} + +type RequestedWatchlistAdvancedCACheckYotiAccountBuilder struct { + removeDeceased bool + shareURL bool + requestedCASources RequestedCASources + requestedCAMatchingStrategy RequestedCAMatchingStrategy +} + +type RequestedWatchlistAdvancedCAYotiAccountConfig struct { + RequestedWatchlistAdvancedCAConfig +} + +// NewRequestedWatchlistAdvancedCACheckYotiAccountBuilder creates a new builder for RequestedWatchlistAdvancedCACheckYotiAccountBuilder +func NewRequestedWatchlistAdvancedCACheckYotiAccountBuilder() *RequestedWatchlistAdvancedCACheckYotiAccountBuilder { + return &RequestedWatchlistAdvancedCACheckYotiAccountBuilder{} +} + +func (b *RequestedWatchlistAdvancedCACheckYotiAccountBuilder) WithRemoveDeceased(removeDeceased bool) *RequestedWatchlistAdvancedCACheckYotiAccountBuilder { + b.removeDeceased = removeDeceased + return b +} + +func (b *RequestedWatchlistAdvancedCACheckYotiAccountBuilder) WithShareURL(shareURL bool) *RequestedWatchlistAdvancedCACheckYotiAccountBuilder { + b.shareURL = shareURL + return b +} + +func (b *RequestedWatchlistAdvancedCACheckYotiAccountBuilder) WithSources(requestedCASources RequestedCASources) *RequestedWatchlistAdvancedCACheckYotiAccountBuilder { + b.requestedCASources = requestedCASources + return b +} + +func (b *RequestedWatchlistAdvancedCACheckYotiAccountBuilder) WithMatchingStrategy(requestedCAMatchingStrategy RequestedCAMatchingStrategy) *RequestedWatchlistAdvancedCACheckYotiAccountBuilder { + b.requestedCAMatchingStrategy = requestedCAMatchingStrategy + return b +} + +func (b RequestedWatchlistAdvancedCACheckYotiAccountBuilder) Build() (RequestedWatchlistAdvancedCAYotiAccountCheck, error) { + config := RequestedWatchlistAdvancedCAYotiAccountConfig{ + RequestedWatchlistAdvancedCAConfig{ + Type: constants.WithYotiAccounts, + RemoveDeceased: b.removeDeceased, + ShareUrl: b.shareURL, + Sources: b.requestedCASources, + MatchingStrategy: b.requestedCAMatchingStrategy, + }, + } + + return RequestedWatchlistAdvancedCAYotiAccountCheck{ + config: config, + }, nil +} diff --git a/docscan/session/create/check/watchlist_advanced_ca_yoti_test.go b/docscan/session/create/check/watchlist_advanced_ca_yoti_test.go new file mode 100644 index 000000000..112d464ad --- /dev/null +++ b/docscan/session/create/check/watchlist_advanced_ca_yoti_test.go @@ -0,0 +1,30 @@ +package check_test + +import ( + "fmt" + + "github.com/getyoti/yoti-go-sdk/v3/docscan/session/create/check" +) + +func ExampleNewRequestedWatchlistAdvancedCACheckYotiAccountBuilder() { + advancedCAYotiAccountCheck, err := check.NewRequestedWatchlistAdvancedCACheckYotiAccountBuilder(). + WithRemoveDeceased(true). + WithShareURL(true). + WithSources(check.RequestedTypeListSources{ + Types: []string{"pep", "fitness-probity", "warning"}}). + WithMatchingStrategy(check.RequestedFuzzyMatchingStrategy{Fuzziness: 0.5}). + Build() + if err != nil { + fmt.Printf("error: %s", err.Error()) + return + } + + data, err := advancedCAYotiAccountCheck.MarshalJSON() + if err != nil { + fmt.Printf("error: %s", err.Error()) + return + } + + fmt.Println(string(data)) + // Output: {"type":"WATCHLIST_ADVANCED_CA","config":{"type":"WITH_YOTI_ACCOUNT","remove_deceased":true,"share_url":true,"sources":{"type":"TYPE_LIST","types":["pep","fitness-probity","warning"]},"matching_strategy":{"type":"FUZZY","fuzziness":0.5}}} +} diff --git a/docscan/session/create/check/watchlist_screening.go b/docscan/session/create/check/watchlist_screening.go new file mode 100644 index 000000000..9172b37cb --- /dev/null +++ b/docscan/session/create/check/watchlist_screening.go @@ -0,0 +1,77 @@ +package check + +import ( + "encoding/json" + + "github.com/getyoti/yoti-go-sdk/v3/docscan/constants" +) + +// RequestedWatchlistScreeningCheck requests creation of a Watchlist Screening Check. +// To request a RequestedWatchlistScreeningCheck you must request task.RequestedTextExtractionTask as a minimum +type RequestedWatchlistScreeningCheck struct { + config RequestedWatchlistScreeningCheckConfig +} + +// Type is the type of the requested check +func (c *RequestedWatchlistScreeningCheck) Type() string { + return constants.WatchlistScreening +} + +// Config is the configuration of the requested check +func (c *RequestedWatchlistScreeningCheck) Config() RequestedCheckConfig { + return RequestedCheckConfig(c.config) +} + +// MarshalJSON returns the JSON encoding +func (c *RequestedWatchlistScreeningCheck) MarshalJSON() ([]byte, error) { + return json.Marshal(&struct { + Type string `json:"type"` + Config RequestedCheckConfig `json:"config,omitempty"` + }{ + Type: c.Type(), + Config: c.Config(), + }) +} + +// RequestedWatchlistScreeningCheckConfig is the configuration applied when creating +// a watchlist screening check +type RequestedWatchlistScreeningCheckConfig struct { + Categories []string `json:"categories"` +} + +// RequestedWatchlistScreeningCheckBuilder builds a RequestedWatchlistScreeningCheck +type RequestedWatchlistScreeningCheckBuilder struct { + categories []string +} + +// NewRequestedWatchlistScreeningCheckBuilder creates a new builder for RequestedWatchlistScreeningCheck +func NewRequestedWatchlistScreeningCheckBuilder() *RequestedWatchlistScreeningCheckBuilder { + return &RequestedWatchlistScreeningCheckBuilder{} +} + +// WithCategory adds a category to the list of categories used for watchlist screening +func (b *RequestedWatchlistScreeningCheckBuilder) WithCategory(category string) *RequestedWatchlistScreeningCheckBuilder { + b.categories = append(b.categories, category) + return b +} + +// WithAdverseMediaCategory adds ADVERSE_MEDIA to the list of categories used for watchlist screening +func (b *RequestedWatchlistScreeningCheckBuilder) WithAdverseMediaCategory() *RequestedWatchlistScreeningCheckBuilder { + return b.WithCategory(constants.AdverseMedia) +} + +// WithSanctionsCategory adds SANCTIONS to the list of categories used for watchlist screening +func (b *RequestedWatchlistScreeningCheckBuilder) WithSanctionsCategory() *RequestedWatchlistScreeningCheckBuilder { + return b.WithCategory(constants.Sanctions) +} + +// Build builds the RequestedWatchlistScreeningCheck +func (b *RequestedWatchlistScreeningCheckBuilder) Build() (*RequestedWatchlistScreeningCheck, error) { + config := RequestedWatchlistScreeningCheckConfig{ + Categories: b.categories, + } + + return &RequestedWatchlistScreeningCheck{ + config: config, + }, nil +} diff --git a/docscan/session/create/check/watchlist_screening_test.go b/docscan/session/create/check/watchlist_screening_test.go new file mode 100644 index 000000000..81e80966a --- /dev/null +++ b/docscan/session/create/check/watchlist_screening_test.go @@ -0,0 +1,26 @@ +package check + +import ( + "encoding/json" + "fmt" +) + +func ExampleNewRequestedWatchlistScreeningCheckBuilder() { + watchlistScreeningCheck, err := NewRequestedWatchlistScreeningCheckBuilder(). + WithAdverseMediaCategory(). + WithSanctionsCategory(). + Build() + if err != nil { + fmt.Printf("error: %s", err.Error()) + return + } + + data, err := json.Marshal(watchlistScreeningCheck) + if err != nil { + fmt.Printf("error: %s", err.Error()) + return + } + + fmt.Println(string(data)) + // Output: {"type":"WATCHLIST_SCREENING","config":{"categories":["ADVERSE-MEDIA","SANCTIONS"]}} +} diff --git a/docscan/session/create/notification_config.go b/docscan/session/create/notification_config.go index dc6c8436e..9391a1fc5 100644 --- a/docscan/session/create/notification_config.go +++ b/docscan/session/create/notification_config.go @@ -2,8 +2,8 @@ package create import "github.com/getyoti/yoti-go-sdk/v3/docscan/constants" -// NotificationConfig represents the configuration properties for notifications within the Doc Scan system. -// Notifications can be configured within a Doc Scan session to allow your backend to be +// NotificationConfig represents the configuration properties for notifications within the Doc Scan (IDV) system. +// Notifications can be configured within a Doc Scan (IDV) session to allow your backend to be // notified of certain events, without having to constantly poll for the state of a session. type NotificationConfig struct { AuthToken string `json:"auth_token,omitempty"` diff --git a/docscan/session/create/session_spec.go b/docscan/session/create/session_spec.go index 3c874e99a..da12ad921 100644 --- a/docscan/session/create/session_spec.go +++ b/docscan/session/create/session_spec.go @@ -6,7 +6,7 @@ import ( "github.com/getyoti/yoti-go-sdk/v3/docscan/session/create/task" ) -// SessionSpecification is the definition for the Doc Scan Session to be created +// SessionSpecification is the definition for the Doc Scan (IDV) Session to be created type SessionSpecification struct { // ClientSessionTokenTTL Client-session-token time-to-live to apply to the created Session ClientSessionTokenTTL int `json:"client_session_token_ttl,omitempty"` diff --git a/docscan/session/retrieve/ca_sources.go b/docscan/session/retrieve/ca_sources.go new file mode 100644 index 000000000..72bfe6b12 --- /dev/null +++ b/docscan/session/retrieve/ca_sources.go @@ -0,0 +1,7 @@ +package retrieve + +type CASourcesResponse struct { + Type string `json:"type"` + SearchProfile string `json:"search_profile"` + Types []string `json:"types"` +} diff --git a/docscan/session/retrieve/check_response.go b/docscan/session/retrieve/check_response.go index b5d1233e7..fe2cb12a5 100644 --- a/docscan/session/retrieve/check_response.go +++ b/docscan/session/retrieve/check_response.go @@ -6,14 +6,15 @@ import ( // CheckResponse represents the attributes of a check, for any given session type CheckResponse struct { - ID string `json:"id"` - Type string `json:"type"` - State string `json:"state"` - ResourcesUsed []string `json:"resources_used"` - GeneratedMedia []*GeneratedMedia `json:"generated_media"` - Report *ReportResponse `json:"report"` - Created *time.Time `json:"created"` - LastUpdated *time.Time `json:"last_updated"` + ID string `json:"id"` + Type string `json:"type"` + State string `json:"state"` + ResourcesUsed []string `json:"resources_used"` + GeneratedMedia []*GeneratedMedia `json:"generated_media"` + GeneratedProfile *GeneratedProfileResponse `json:"generated_profile"` + Report *ReportResponse `json:"report"` + Created *time.Time `json:"created"` + LastUpdated *time.Time `json:"last_updated"` } // AuthenticityCheckResponse represents a Document Authenticity check for a given session @@ -36,7 +37,7 @@ type TextDataCheckResponse struct { *CheckResponse } -// IDDocumentComparisonCheckResponse represents a identity document comparison check for a given session +// IDDocumentComparisonCheckResponse represents an identity document comparison check for a given session type IDDocumentComparisonCheckResponse struct { *CheckResponse } @@ -46,7 +47,17 @@ type SupplementaryDocumentTextDataCheckResponse struct { *CheckResponse } -// ThirdPartyCheckResponse represents a check with an external credit reference agency +// ThirdPartyIdentityCheckResponse represents a check with an external credit reference agency type ThirdPartyIdentityCheckResponse struct { *CheckResponse } + +// WatchlistScreeningCheckResponse represents a watchlist screening check +type WatchlistScreeningCheckResponse struct { + *CheckResponse +} + +// WatchlistAdvancedCACheckResponse represents an advanced CA watchlist screening check +type WatchlistAdvancedCACheckResponse struct { + *CheckResponse +} diff --git a/docscan/session/retrieve/generated_profile.go b/docscan/session/retrieve/generated_profile.go new file mode 100644 index 000000000..99ba465e7 --- /dev/null +++ b/docscan/session/retrieve/generated_profile.go @@ -0,0 +1,6 @@ +package retrieve + +// GeneratedProfileResponse represents a profile that has been generated by the session +type GeneratedProfileResponse struct { + Media MediaResponse `json:"media"` +} diff --git a/docscan/session/retrieve/get_session_result.go b/docscan/session/retrieve/get_session_result.go index 6ae475eb0..a699ce34b 100644 --- a/docscan/session/retrieve/get_session_result.go +++ b/docscan/session/retrieve/get_session_result.go @@ -24,6 +24,8 @@ type GetSessionResult struct { thirdPartyIdentityChecks []*ThirdPartyIdentityCheckResponse idDocumentComparisonChecks []*IDDocumentComparisonCheckResponse supplementaryDocumentTextDataChecks []*SupplementaryDocumentTextDataCheckResponse + watchlistScreeningChecks []*WatchlistScreeningCheckResponse + watchlistAdvancedCAChecks []*WatchlistAdvancedCACheckResponse } // AuthenticityChecks filters the checks, returning only document authenticity checks @@ -67,6 +69,16 @@ func (g *GetSessionResult) SupplementaryDocumentTextDataChecks() []*Supplementar return g.supplementaryDocumentTextDataChecks } +// WatchlistScreeningChecks filters the checks, returning only the Watchlist Screening checks +func (g *GetSessionResult) WatchlistScreeningChecks() []*WatchlistScreeningCheckResponse { + return g.watchlistScreeningChecks +} + +// WatchlistAdvancedCAChecks filters the checks, returning only the Watchlist Advanced CA Screening checks +func (g *GetSessionResult) WatchlistAdvancedCAChecks() []*WatchlistAdvancedCACheckResponse { + return g.watchlistAdvancedCAChecks +} + // UnmarshalJSON handles the custom JSON unmarshalling func (g *GetSessionResult) UnmarshalJSON(data []byte) error { type result GetSessionResult // declared as "type" to prevent recursive unmarshalling @@ -92,7 +104,11 @@ func (g *GetSessionResult) UnmarshalJSON(data []byte) error { g.idDocumentComparisonChecks = append(g.idDocumentComparisonChecks, &IDDocumentComparisonCheckResponse{CheckResponse: check}) case constants.ThirdPartyIdentityCheck: - g.thirdPartyIdentityChecks = append(g.thirdPartyIdentityChecks, &ThirdPartyIdentityCheckResponse{CheckResponse: check}) + g.thirdPartyIdentityChecks = append( + g.thirdPartyIdentityChecks, + &ThirdPartyIdentityCheckResponse{ + CheckResponse: check, + }) case constants.SupplementaryDocumentTextDataCheck: g.supplementaryDocumentTextDataChecks = append( @@ -101,6 +117,22 @@ func (g *GetSessionResult) UnmarshalJSON(data []byte) error { CheckResponse: check, }, ) + + case constants.WatchlistScreening: + g.watchlistScreeningChecks = append( + g.watchlistScreeningChecks, + &WatchlistScreeningCheckResponse{ + CheckResponse: check, + }, + ) + + case constants.WatchlistAdvancedCA: + g.watchlistAdvancedCAChecks = append( + g.watchlistAdvancedCAChecks, + &WatchlistAdvancedCACheckResponse{ + CheckResponse: check, + }, + ) } } diff --git a/docscan/session/retrieve/get_session_result_test.go b/docscan/session/retrieve/get_session_result_test.go index 9ae4dda36..7c3642f50 100644 --- a/docscan/session/retrieve/get_session_result_test.go +++ b/docscan/session/retrieve/get_session_result_test.go @@ -1,4 +1,4 @@ -package retrieve +package retrieve_test import ( "encoding/json" @@ -6,48 +6,60 @@ import ( "time" "github.com/getyoti/yoti-go-sdk/v3/docscan/constants" + "github.com/getyoti/yoti-go-sdk/v3/docscan/session/retrieve" + "github.com/getyoti/yoti-go-sdk/v3/file" "gotest.tools/v3/assert" ) func TestGetSessionResult_UnmarshalJSON(t *testing.T) { - authenticityCheckResponse := &CheckResponse{ + authenticityCheckResponse := &retrieve.CheckResponse{ Type: constants.IDDocumentAuthenticity, State: "DONE", } testDate := time.Date(2020, 01, 01, 1, 2, 3, 4, time.UTC) - faceMatchCheckResponse := &CheckResponse{ + faceMatchCheckResponse := &retrieve.CheckResponse{ Type: constants.IDDocumentFaceMatch, Created: &testDate, } - textDataCheckResponse := &CheckResponse{ + textDataCheckResponse := &retrieve.CheckResponse{ Type: constants.IDDocumentTextDataCheck, - Report: &ReportResponse{}, + Report: &retrieve.ReportResponse{}, } - livenessCheckResponse := &CheckResponse{ + livenessCheckResponse := &retrieve.CheckResponse{ Type: constants.Liveness, LastUpdated: &testDate, } - idDocComparisonCheckResponse := &CheckResponse{ + idDocComparisonCheckResponse := &retrieve.CheckResponse{ Type: constants.IDDocumentComparison, State: "PENDING", } - thirdPartyIdentityCheckResponse := &CheckResponse{ + thirdPartyIdentityCheckResponse := &retrieve.CheckResponse{ Type: constants.ThirdPartyIdentityCheck, State: "PENDING", } - supplementaryTextDataCheckResponse := &CheckResponse{ + supplementaryTextDataCheckResponse := &retrieve.CheckResponse{ Type: constants.SupplementaryDocumentTextDataCheck, - Report: &ReportResponse{}, + Report: &retrieve.ReportResponse{}, } - var checks []*CheckResponse - checks = append(checks, &CheckResponse{Type: "OTHER_TYPE", ID: "id"}) + watchlistScreeningCheckResponse := &retrieve.CheckResponse{ + Type: constants.WatchlistScreening, + State: "DONE", + } + + advancedWatchlistScreeningCheckResponse := &retrieve.CheckResponse{ + Type: constants.WatchlistAdvancedCA, + State: "PENDING", + } + + var checks []*retrieve.CheckResponse + checks = append(checks, &retrieve.CheckResponse{Type: "OTHER_TYPE", ID: "id"}) checks = append(checks, authenticityCheckResponse) checks = append(checks, faceMatchCheckResponse) checks = append(checks, textDataCheckResponse) @@ -55,21 +67,23 @@ func TestGetSessionResult_UnmarshalJSON(t *testing.T) { checks = append(checks, idDocComparisonCheckResponse) checks = append(checks, thirdPartyIdentityCheckResponse) checks = append(checks, supplementaryTextDataCheckResponse) + checks = append(checks, watchlistScreeningCheckResponse) + checks = append(checks, advancedWatchlistScreeningCheckResponse) biometricConsentTimestamp := time.Date(2020, 01, 01, 1, 2, 3, 4, time.UTC) - getSessionResult := GetSessionResult{ + getSessionResult := retrieve.GetSessionResult{ Checks: checks, BiometricConsentTimestamp: &biometricConsentTimestamp, } marshalled, err := json.Marshal(&getSessionResult) assert.NilError(t, err) - var result GetSessionResult + var result retrieve.GetSessionResult err = json.Unmarshal(marshalled, &result) assert.NilError(t, err) - assert.Equal(t, 8, len(result.Checks)) + assert.Equal(t, 10, len(result.Checks)) assert.Equal(t, 1, len(result.AuthenticityChecks())) assert.Equal(t, "DONE", result.AuthenticityChecks()[0].State) @@ -78,10 +92,10 @@ func TestGetSessionResult_UnmarshalJSON(t *testing.T) { assert.Check(t, result.FaceMatchChecks()[0].Created.Equal(testDate)) assert.Equal(t, 1, len(result.TextDataChecks())) - assert.DeepEqual(t, &ReportResponse{}, result.TextDataChecks()[0].Report) + assert.DeepEqual(t, &retrieve.ReportResponse{}, result.TextDataChecks()[0].Report) assert.Equal(t, 1, len(result.IDDocumentTextDataChecks())) - assert.DeepEqual(t, &ReportResponse{}, result.TextDataChecks()[0].Report) + assert.DeepEqual(t, &retrieve.ReportResponse{}, result.IDDocumentTextDataChecks()[0].Report) assert.Equal(t, 1, len(result.LivenessChecks())) assert.Check(t, result.LivenessChecks()[0].LastUpdated.Equal(testDate)) @@ -93,19 +107,83 @@ func TestGetSessionResult_UnmarshalJSON(t *testing.T) { assert.Equal(t, "PENDING", result.ThirdPartyIdentityChecks()[0].State) assert.Equal(t, 1, len(result.SupplementaryDocumentTextDataChecks())) - assert.DeepEqual(t, &ReportResponse{}, result.SupplementaryDocumentTextDataChecks()[0].Report) + assert.DeepEqual(t, &retrieve.ReportResponse{}, result.SupplementaryDocumentTextDataChecks()[0].Report) + assert.Assert(t, result.SupplementaryDocumentTextDataChecks()[0].Report.WatchlistSummary == nil) + assert.Assert(t, result.SupplementaryDocumentTextDataChecks()[0].GeneratedProfile == nil) + + assert.Equal(t, 1, len(result.WatchlistScreeningChecks())) + assert.DeepEqual(t, "DONE", result.WatchlistScreeningChecks()[0].State) + + assert.Equal(t, 1, len(result.WatchlistAdvancedCAChecks())) + assert.DeepEqual(t, "PENDING", result.WatchlistAdvancedCAChecks()[0].State) assert.Equal(t, biometricConsentTimestamp, *result.BiometricConsentTimestamp) } +func TestGetSessionResult_UnmarshalJSON_Watchlist(t *testing.T) { + bytes, err := file.ReadFile("../../../test/fixtures/watchlist_screening.json") + assert.NilError(t, err) + + var result retrieve.GetSessionResult + err = result.UnmarshalJSON(bytes) + assert.NilError(t, err) + + assert.Equal(t, 1, len(result.WatchlistScreeningChecks())) + watchlistScreeningCheck := result.WatchlistScreeningChecks()[0] + assert.Equal(t, watchlistScreeningCheck.GeneratedProfile.Media.Type, "JSON") + + watchlistSummary := watchlistScreeningCheck.Report.WatchlistSummary + + assert.Equal(t, 0, watchlistSummary.TotalHits) + assert.Equal(t, 2, len(watchlistSummary.SearchConfig.Categories)) + assert.Equal(t, watchlistSummary.SearchConfig.Categories[0], "ADVERSE-MEDIA") + assert.Equal(t, watchlistSummary.SearchConfig.Categories[1], "SANCTIONS") + assert.Equal(t, watchlistSummary.RawResults.Media.Type, "JSON") + assert.Equal(t, watchlistSummary.AssociatedCountryCodes[0], "GBR") +} + +func TestGetSessionResult_UnmarshalJSON_Watchlist_Advanced_CA(t *testing.T) { + bytes, err := file.ReadFile("../../../test/fixtures/watchlist_advanced_ca_profile_custom.json") + assert.NilError(t, err) + + var result retrieve.GetSessionResult + err = result.UnmarshalJSON(bytes) + assert.NilError(t, err) + + assert.Equal(t, 1, len(result.WatchlistAdvancedCAChecks())) + watchlistAdvancedCACheck := result.WatchlistAdvancedCAChecks()[0] + assert.Equal(t, 1, len(watchlistAdvancedCACheck.GeneratedMedia)) + assert.Equal(t, watchlistAdvancedCACheck.GeneratedMedia[0].Type, "JSON") + + assert.Equal(t, watchlistAdvancedCACheck.GeneratedProfile.Media.Type, "JSON") + + watchlistSummary := watchlistAdvancedCACheck.Report.WatchlistSummary + assert.Equal(t, watchlistSummary.RawResults.Media.Type, "JSON") + assert.Equal(t, watchlistSummary.AssociatedCountryCodes[0], "GBR") + assert.Equal(t, watchlistSummary.RawResults.Media.Type, "JSON") + assert.Equal(t, watchlistSummary.AssociatedCountryCodes[0], "GBR") + + searchConfig := watchlistSummary.SearchConfig + assert.Equal(t, "WITH_CUSTOM_ACCOUNT", searchConfig.Type) + assert.Equal(t, true, searchConfig.RemoveDeceased) + assert.Equal(t, true, searchConfig.ShareURL) + assert.Equal(t, "FUZZY", searchConfig.MatchingStrategy.Type) + assert.Equal(t, 0.6, searchConfig.MatchingStrategy.Fuzziness) + assert.Equal(t, "PROFILE", searchConfig.Sources.Type) + assert.Equal(t, "b41d82de-9a1d-4494-97a6-8b1b9895a908", searchConfig.Sources.SearchProfile) + assert.Equal(t, "gQ2vf0STnF5nGy9SSdyuGJuYMFfNASmV", searchConfig.APIKey) + assert.Equal(t, "111111", searchConfig.ClientRef) + assert.Equal(t, true, searchConfig.Monitoring) +} + func TestGetSessionResult_UnmarshalJSON_Invalid(t *testing.T) { - var result GetSessionResult + var result retrieve.GetSessionResult err := result.UnmarshalJSON([]byte("some-invalid-json")) assert.ErrorContains(t, err, "invalid character") } func TestGetSessionResult_UnmarshalJSON_WithoutBiometricConsentTimestamp(t *testing.T) { - var result GetSessionResult + var result retrieve.GetSessionResult err := result.UnmarshalJSON([]byte("{}")) assert.NilError(t, err) assert.Check(t, result.BiometricConsentTimestamp == nil) diff --git a/docscan/session/retrieve/report_response.go b/docscan/session/retrieve/report_response.go index cfdcd119d..96af2e292 100644 --- a/docscan/session/retrieve/report_response.go +++ b/docscan/session/retrieve/report_response.go @@ -2,6 +2,7 @@ package retrieve // ReportResponse represents a report for a given check type ReportResponse struct { - Recommendation *RecommendationResponse `json:"recommendation"` - Breakdown []*BreakdownResponse `json:"breakdown"` + Recommendation RecommendationResponse `json:"recommendation"` + Breakdown []BreakdownResponse `json:"breakdown"` + WatchlistSummary *WatchlistSummaryResponse `json:"watchlist_summary"` } diff --git a/docscan/session/retrieve/resource_container.go b/docscan/session/retrieve/resource_container.go index e10f9ba76..3ab135a99 100644 --- a/docscan/session/retrieve/resource_container.go +++ b/docscan/session/retrieve/resource_container.go @@ -6,7 +6,7 @@ import ( "github.com/getyoti/yoti-go-sdk/v3/docscan/constants" ) -// ResourceContainer contains different resources that are part of the Yoti Doc Scan session +// ResourceContainer contains different resources that are part of the Yoti IDV session type ResourceContainer struct { IDDocuments []*IDDocumentResourceResponse `json:"id_documents"` SupplementaryDocuments []*SupplementaryDocumentResourceResponse `json:"supplementary_documents"` diff --git a/docscan/session/retrieve/search_config.go b/docscan/session/retrieve/search_config.go new file mode 100644 index 000000000..fd74d719b --- /dev/null +++ b/docscan/session/retrieve/search_config.go @@ -0,0 +1,20 @@ +package retrieve + +type SearchConfig struct { + Type string `json:"type"` + Categories []string `json:"categories"` + RemoveDeceased bool `json:"remove_deceased"` + ShareURL bool `json:"share_url"` + Sources CASourcesResponse `json:"sources"` + MatchingStrategy CAMatchingStrategyResponse `json:"matching_strategy"` + APIKey string `json:"api_key"` + Monitoring bool `json:"monitoring"` + Tags map[string]string `json:"tags"` + ClientRef string `json:"client_ref"` +} + +type CAMatchingStrategyResponse struct { + Type string `json:"type"` + ExactMatch string `json:"exact_match"` + Fuzziness float64 `json:"fuzziness"` +} diff --git a/docscan/session/retrieve/watchlist.go b/docscan/session/retrieve/watchlist.go new file mode 100644 index 000000000..4ce123f4f --- /dev/null +++ b/docscan/session/retrieve/watchlist.go @@ -0,0 +1,12 @@ +package retrieve + +type RawResults struct { + Media MediaResponse `json:"media"` +} + +type WatchlistSummaryResponse struct { + TotalHits int `json:"total_hits"` + RawResults RawResults `json:"raw_results"` + AssociatedCountryCodes []string `json:"associated_country_codes"` + SearchConfig SearchConfig `json:"search_config"` +} diff --git a/dynamic/policy_builder.go b/dynamic/policy_builder.go index fc9771dae..7147b6b64 100644 --- a/dynamic/policy_builder.go +++ b/dynamic/policy_builder.go @@ -16,17 +16,19 @@ const ( // PolicyBuilder constructs a json payload specifying the dynamic policy // for a dynamic scenario type PolicyBuilder struct { - wantedAttributes map[string]WantedAttribute - wantedAuthTypes map[int]bool - isWantedRememberMe bool - err error + wantedAttributes map[string]WantedAttribute + wantedAuthTypes map[int]bool + isWantedRememberMe bool + err error + identityProfileRequirements *json.RawMessage } // Policy represents a dynamic policy for a share type Policy struct { - attributes []WantedAttribute - authTypes []int - rememberMeID bool + attributes []WantedAttribute + authTypes []int + rememberMeID bool + identityProfileRequirements *json.RawMessage } // WithWantedAttribute adds an attribute from WantedAttributeBuilder to the policy @@ -198,12 +200,19 @@ func (b *PolicyBuilder) WithPinAuth() *PolicyBuilder { return b.WithWantedAuthType(authTypePinConst) } +// WithIdentityProfileRequirements adds Identity Profile Requirements to the policy. Must be valid JSON. +func (b *PolicyBuilder) WithIdentityProfileRequirements(identityProfile json.RawMessage) *PolicyBuilder { + b.identityProfileRequirements = &identityProfile + return b +} + // Build constructs a dynamic policy object func (b *PolicyBuilder) Build() (Policy, error) { return Policy{ - attributes: b.attributesAsList(), - authTypes: b.authTypesAsList(), - rememberMeID: b.isWantedRememberMe, + attributes: b.attributesAsList(), + authTypes: b.authTypesAsList(), + rememberMeID: b.isWantedRememberMe, + identityProfileRequirements: b.identityProfileRequirements, }, b.err } @@ -228,12 +237,14 @@ func (b *PolicyBuilder) authTypesAsList() []int { // MarshalJSON returns the JSON encoding func (policy *Policy) MarshalJSON() ([]byte, error) { return json.Marshal(&struct { - Wanted []WantedAttribute `json:"wanted"` - WantedAuthTypes []int `json:"wanted_auth_types"` - WantedRememberMe bool `json:"wanted_remember_me"` + Wanted []WantedAttribute `json:"wanted"` + WantedAuthTypes []int `json:"wanted_auth_types"` + WantedRememberMe bool `json:"wanted_remember_me"` + IdentityProfileRequirements *json.RawMessage `json:"identity_profile_requirements,omitempty"` }{ - Wanted: policy.attributes, - WantedAuthTypes: policy.authTypes, - WantedRememberMe: policy.rememberMeID, + Wanted: policy.attributes, + WantedAuthTypes: policy.authTypes, + WantedRememberMe: policy.rememberMeID, + IdentityProfileRequirements: policy.identityProfileRequirements, }) } diff --git a/dynamic/policy_builder_test.go b/dynamic/policy_builder_test.go index 766a5e95e..47bce5934 100644 --- a/dynamic/policy_builder_test.go +++ b/dynamic/policy_builder_test.go @@ -1,7 +1,10 @@ package dynamic import ( + "encoding/json" + "errors" "fmt" + "reflect" "strings" "testing" @@ -412,3 +415,50 @@ func TestDynamicPolicyBuilder_WithAgeDerivedAttribute_InvalidOptionsShouldPanic( t.Error("Expected Panic") } + +func ExamplePolicyBuilder_WithIdentityProfileRequirements() { + identityProfile := []byte(`{ + "trust_framework": "UK_TFIDA", + "scheme": { + "type": "DBS", + "objective": "STANDARD" + } + }`) + + policy, err := (&PolicyBuilder{}).WithIdentityProfileRequirements(identityProfile).Build() + if err != nil { + fmt.Printf("error: %s", err.Error()) + return + } + + data, err := policy.MarshalJSON() + if err != nil { + fmt.Printf("error: %s", err.Error()) + return + } + + fmt.Println(string(data)) + // Output: {"wanted":[],"wanted_auth_types":[],"wanted_remember_me":false,"identity_profile_requirements":{"trust_framework":"UK_TFIDA","scheme":{"type":"DBS","objective":"STANDARD"}}} +} + +func TestPolicyBuilder_WithIdentityProfileRequirements_ShouldFailForInvalidJSON(t *testing.T) { + identityProfile := []byte(`{ + "trust_framework": UK_TFIDA", + , + }`) + + policy, err := (&PolicyBuilder{}).WithIdentityProfileRequirements(identityProfile).Build() + if err != nil { + fmt.Printf("error: %s", err.Error()) + return + } + + _, err = policy.MarshalJSON() + if err == nil { + t.Error("expected an error") + } + var marshallerErr *json.MarshalerError + if !errors.As(err, &marshallerErr) { + t.Errorf("wanted err to be of type '%v', got: '%v'", reflect.TypeOf(marshallerErr), reflect.TypeOf(err)) + } +} diff --git a/dynamic/scenario_builder.go b/dynamic/scenario_builder.go index 6ff68d059..fdb4df495 100644 --- a/dynamic/scenario_builder.go +++ b/dynamic/scenario_builder.go @@ -15,6 +15,7 @@ type Scenario struct { policy *Policy extensions []interface{} callbackEndpoint string + subject *json.RawMessage } // WithPolicy attaches a DynamicPolicy to the DynamicScenario @@ -35,6 +36,12 @@ func (builder *ScenarioBuilder) WithCallbackEndpoint(endpoint string) *ScenarioB return builder } +// WithSubject adds a subject to the scenario. Must be valid JSON. +func (builder *ScenarioBuilder) WithSubject(subject json.RawMessage) *ScenarioBuilder { + builder.scenario.subject = &subject + return builder +} + // Build constructs the DynamicScenario func (builder *ScenarioBuilder) Build() (Scenario, error) { if builder.scenario.extensions == nil { @@ -53,12 +60,14 @@ func (builder *ScenarioBuilder) Build() (Scenario, error) { // MarshalJSON returns the JSON encoding func (scenario Scenario) MarshalJSON() ([]byte, error) { return json.Marshal(&struct { - Policy Policy `json:"policy"` - Extensions []interface{} `json:"extensions"` - CallbackEndpoint string `json:"callback_endpoint"` + Policy Policy `json:"policy"` + Extensions []interface{} `json:"extensions"` + CallbackEndpoint string `json:"callback_endpoint"` + Subject *json.RawMessage `json:"subject,omitempty"` }{ Policy: *scenario.policy, Extensions: scenario.extensions, CallbackEndpoint: scenario.callbackEndpoint, + Subject: scenario.subject, }) } diff --git a/dynamic/scenario_builder_test.go b/dynamic/scenario_builder_test.go index 05d07c716..cbef8cb63 100644 --- a/dynamic/scenario_builder_test.go +++ b/dynamic/scenario_builder_test.go @@ -1,7 +1,11 @@ package dynamic import ( + "encoding/json" + "errors" "fmt" + "reflect" + "testing" "github.com/getyoti/yoti-go-sdk/v3/extension" ) @@ -75,5 +79,46 @@ func ExampleScenarioBuilder_WithExtension() { fmt.Println(string(data)) // Output: {"policy":{"wanted":[{"name":"full_name","accept_self_asserted":false}],"wanted_auth_types":[],"wanted_remember_me":false},"extensions":[{"type":"TRANSACTIONAL_FLOW","content":"Transactional Flow Extension"}],"callback_endpoint":""} +} + +func ExampleScenarioBuilder_WithSubject() { + subject := []byte(`{ + "subject_id": "some_subject_id_string" + }`) + + scenario, err := (&ScenarioBuilder{}).WithSubject(subject).WithCallbackEndpoint("/foo").Build() + if err != nil { + fmt.Printf("error: %s", err.Error()) + return + } + + data, err := scenario.MarshalJSON() + if err != nil { + fmt.Printf("error: %s", err.Error()) + return + } + + fmt.Println(string(data)) + // Output: {"policy":{"wanted":[],"wanted_auth_types":[],"wanted_remember_me":false},"extensions":[],"callback_endpoint":"/foo","subject":{"subject_id":"some_subject_id_string"}} +} + +func TestScenarioBuilder_WithSubject_ShouldFailForInvalidJSON(t *testing.T) { + subject := []byte(`{ + subject_id: some_subject_id_string + }`) + + scenario, err := (&ScenarioBuilder{}).WithSubject(subject).WithCallbackEndpoint("/foo").Build() + if err != nil { + fmt.Printf("error: %s", err.Error()) + return + } + _, err = scenario.MarshalJSON() + if err == nil { + t.Error("expected an error") + } + var marshallerErr *json.MarshalerError + if !errors.As(err, &marshallerErr) { + t.Errorf("wanted err to be of type '%v', got: '%v'", reflect.TypeOf(marshallerErr), reflect.TypeOf(err)) + } } diff --git a/extra/extra_data.go b/extra/extra_data.go index 3decaeb50..b61ba4ec8 100644 --- a/extra/extra_data.go +++ b/extra/extra_data.go @@ -3,7 +3,7 @@ package extra import ( "github.com/getyoti/yoti-go-sdk/v3/profile/attribute" "github.com/getyoti/yoti-go-sdk/v3/yotiprotoshare" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // Data represents extra pieces information on the receipt. diff --git a/extra/extra_data_test.go b/extra/extra_data_test.go index 5be0b4b37..816dfaa5f 100644 --- a/extra/extra_data_test.go +++ b/extra/extra_data_test.go @@ -8,7 +8,7 @@ import ( "github.com/getyoti/yoti-go-sdk/v3/profile/attribute" "github.com/getyoti/yoti-go-sdk/v3/test" "github.com/getyoti/yoti-go-sdk/v3/yotiprotoshare" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" diff --git a/go.mod b/go.mod index 8e737a2ce..f51172315 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,10 @@ module github.com/getyoti/yoti-go-sdk/v3 require ( - github.com/golang/protobuf v1.5.2 - gotest.tools/v3 v3.0.3 + google.golang.org/protobuf v1.28.0 + gotest.tools/v3 v3.2.0 ) -go 1.11 +require github.com/google/go-cmp v0.5.5 // indirect + +go 1.17 diff --git a/go.sum b/go.sum index c66bd5880..8c39aed0c 100644 --- a/go.sum +++ b/go.sum @@ -1,22 +1,33 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gotest.tools/v3 v3.2.0 h1:I0DwBVMGAx26dttAj1BtJLAkVGncrkkUXfJLC4Flt/I= +gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= diff --git a/profile/attribute/anchor/anchor_parser.go b/profile/attribute/anchor/anchor_parser.go index 634a59369..d1476c4f5 100644 --- a/profile/attribute/anchor/anchor_parser.go +++ b/profile/attribute/anchor/anchor_parser.go @@ -9,7 +9,7 @@ import ( "github.com/getyoti/yoti-go-sdk/v3/yotiprotoattr" "github.com/getyoti/yoti-go-sdk/v3/yotiprotocom" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) type anchorExtension struct { @@ -34,7 +34,7 @@ func ParseAnchors(protoAnchors []*yotiprotoattr.Anchor) []*Anchor { continue } - processedAnchor := newAnchor(anchorType, parsedCerts, *parsedSignedTimestamp, protoAnchor.SubType, extension) + processedAnchor := newAnchor(anchorType, parsedCerts, parsedSignedTimestamp, protoAnchor.SubType, extension) processedAnchors = append(processedAnchors, processedAnchor) } diff --git a/profile/attribute/anchor/anchor_parser_test.go b/profile/attribute/anchor/anchor_parser_test.go index 1426efbee..13849a3d6 100644 --- a/profile/attribute/anchor/anchor_parser_test.go +++ b/profile/attribute/anchor/anchor_parser_test.go @@ -8,7 +8,7 @@ import ( "github.com/getyoti/yoti-go-sdk/v3/test" "github.com/getyoti/yoti-go-sdk/v3/yotiprotoattr" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "gotest.tools/v3/assert" ) diff --git a/profile/attribute/anchor/anchors.go b/profile/attribute/anchor/anchors.go index a04332411..839a6e116 100644 --- a/profile/attribute/anchor/anchors.go +++ b/profile/attribute/anchor/anchors.go @@ -19,7 +19,7 @@ type Anchor struct { value string } -func newAnchor(anchorType Type, originServerCerts []*x509.Certificate, signedTimestamp yotiprotocom.SignedTimestamp, subtype string, value string) *Anchor { +func newAnchor(anchorType Type, originServerCerts []*x509.Certificate, signedTimestamp *yotiprotocom.SignedTimestamp, subtype string, value string) *Anchor { return &Anchor{ anchorType: anchorType, originServerCerts: originServerCerts, diff --git a/profile/attribute/anchor/signed_timestamp.go b/profile/attribute/anchor/signed_timestamp.go index f618d3aa7..2081b7d6c 100644 --- a/profile/attribute/anchor/signed_timestamp.go +++ b/profile/attribute/anchor/signed_timestamp.go @@ -12,7 +12,7 @@ type SignedTimestamp struct { timestamp *time.Time } -func convertSignedTimestamp(protoSignedTimestamp yotiprotocom.SignedTimestamp) SignedTimestamp { +func convertSignedTimestamp(protoSignedTimestamp *yotiprotocom.SignedTimestamp) SignedTimestamp { uintTimestamp := protoSignedTimestamp.Timestamp intTimestamp := int64(uintTimestamp) unixTime := time.Unix(intTimestamp/1e6, (intTimestamp%1e6)*1e3) diff --git a/profile/attribute/attribute_details.go b/profile/attribute/attribute_details.go index c3e55b40e..a380150b7 100644 --- a/profile/attribute/attribute_details.go +++ b/profile/attribute/attribute_details.go @@ -10,6 +10,7 @@ type attributeDetails struct { name string contentType string anchors []*anchor.Anchor + id *string } // Name gets the attribute name @@ -17,6 +18,11 @@ func (a attributeDetails) Name() string { return a.name } +// ID gets the attribute ID +func (a attributeDetails) ID() *string { + return a.id +} + // ContentType gets the attribute's content type description func (a attributeDetails) ContentType() string { return a.contentType diff --git a/profile/attribute/date_attribute.go b/profile/attribute/date_attribute.go index f572f2767..cdc55ce3e 100644 --- a/profile/attribute/date_attribute.go +++ b/profile/attribute/date_attribute.go @@ -27,6 +27,7 @@ func NewDate(a *yotiprotoattr.Attribute) (*DateAttribute, error) { name: a.Name, contentType: a.ContentType.String(), anchors: parsedAnchors, + id: &a.EphemeralId, }, value: &parsedTime, }, nil diff --git a/profile/attribute/document_details_attribute.go b/profile/attribute/document_details_attribute.go index 4eac906a5..a18ccabad 100644 --- a/profile/attribute/document_details_attribute.go +++ b/profile/attribute/document_details_attribute.go @@ -48,6 +48,7 @@ func NewDocumentDetails(a *yotiprotoattr.Attribute) (*DocumentDetailsAttribute, name: a.Name, contentType: a.ContentType.String(), anchors: parsedAnchors, + id: &a.EphemeralId, }, value: details, }, nil diff --git a/profile/attribute/generic_attribute.go b/profile/attribute/generic_attribute.go index 199b58c98..c729e30bc 100644 --- a/profile/attribute/generic_attribute.go +++ b/profile/attribute/generic_attribute.go @@ -26,6 +26,7 @@ func NewGeneric(a *yotiprotoattr.Attribute) *GenericAttribute { name: a.Name, contentType: a.ContentType.String(), anchors: parsedAnchors, + id: &a.EphemeralId, }, value: value, } diff --git a/profile/attribute/helper_test.go b/profile/attribute/helper_test.go index aae53a63e..47c28eae9 100644 --- a/profile/attribute/helper_test.go +++ b/profile/attribute/helper_test.go @@ -5,7 +5,7 @@ import ( "github.com/getyoti/yoti-go-sdk/v3/test" "github.com/getyoti/yoti-go-sdk/v3/yotiprotoattr" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "gotest.tools/v3/assert" ) diff --git a/profile/attribute/image_attribute.go b/profile/attribute/image_attribute.go index 2ad065053..fd9d7f144 100644 --- a/profile/attribute/image_attribute.go +++ b/profile/attribute/image_attribute.go @@ -17,17 +17,18 @@ type ImageAttribute struct { // NewImage creates a new Image attribute func NewImage(a *yotiprotoattr.Attribute) (*ImageAttribute, error) { imageValue, err := parseImageValue(a.ContentType, a.Value) - parsedAnchors := anchor.ParseAnchors(a.Anchors) - if err != nil { return nil, err } + parsedAnchors := anchor.ParseAnchors(a.Anchors) + return &ImageAttribute{ attributeDetails: attributeDetails{ name: a.Name, contentType: a.ContentType.String(), anchors: parsedAnchors, + id: &a.EphemeralId, }, value: imageValue, }, nil diff --git a/profile/attribute/image_slice_attribute.go b/profile/attribute/image_slice_attribute.go index 6b96eeafd..de507ab6a 100644 --- a/profile/attribute/image_slice_attribute.go +++ b/profile/attribute/image_slice_attribute.go @@ -40,6 +40,7 @@ func NewImageSlice(a *yotiprotoattr.Attribute) (*ImageSliceAttribute, error) { name: a.Name, contentType: a.ContentType.String(), anchors: anchor.ParseAnchors(a.Anchors), + id: &a.EphemeralId, }, value: imageSliceValue, }, nil diff --git a/profile/attribute/issuance_details.go b/profile/attribute/issuance_details.go index 0f8cfc43c..381d4e99e 100644 --- a/profile/attribute/issuance_details.go +++ b/profile/attribute/issuance_details.go @@ -7,7 +7,7 @@ import ( "time" "github.com/getyoti/yoti-go-sdk/v3/yotiprotoshare" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // IssuanceDetails contains information about the attribute(s) issued by a third party diff --git a/profile/attribute/issuance_details_test.go b/profile/attribute/issuance_details_test.go index d3e5f0010..462d863ef 100644 --- a/profile/attribute/issuance_details_test.go +++ b/profile/attribute/issuance_details_test.go @@ -7,7 +7,7 @@ import ( "github.com/getyoti/yoti-go-sdk/v3/test" "github.com/getyoti/yoti-go-sdk/v3/yotiprotoshare" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "gotest.tools/v3/assert" diff --git a/profile/attribute/json_attribute.go b/profile/attribute/json_attribute.go index 68c90ffdd..be40920df 100644 --- a/profile/attribute/json_attribute.go +++ b/profile/attribute/json_attribute.go @@ -34,6 +34,7 @@ func NewJSON(a *yotiprotoattr.Attribute) (*JSONAttribute, error) { name: a.Name, contentType: a.ContentType.String(), anchors: parsedAnchors, + id: &a.EphemeralId, }, value: interfaceValue, }, nil diff --git a/profile/attribute/multivalue_attribute.go b/profile/attribute/multivalue_attribute.go index bd1c9095c..926141f97 100644 --- a/profile/attribute/multivalue_attribute.go +++ b/profile/attribute/multivalue_attribute.go @@ -5,7 +5,7 @@ import ( "github.com/getyoti/yoti-go-sdk/v3/profile/attribute/anchor" "github.com/getyoti/yoti-go-sdk/v3/yotiprotoattr" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) // MultiValueAttribute is a Yoti attribute which returns a multi-valued attribute @@ -27,6 +27,7 @@ func NewMultiValue(a *yotiprotoattr.Attribute) (*MultiValueAttribute, error) { name: a.Name, contentType: a.ContentType.String(), anchors: anchor.ParseAnchors(a.Anchors), + id: &a.EphemeralId, }, items: attributeItems, }, nil diff --git a/profile/attribute/multivalue_attribute_test.go b/profile/attribute/multivalue_attribute_test.go index 02192ba6d..15a24f998 100644 --- a/profile/attribute/multivalue_attribute_test.go +++ b/profile/attribute/multivalue_attribute_test.go @@ -5,7 +5,7 @@ import ( "github.com/getyoti/yoti-go-sdk/v3/media" "github.com/getyoti/yoti-go-sdk/v3/yotiprotoattr" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) diff --git a/profile/attribute/string_attribute.go b/profile/attribute/string_attribute.go index f339f1f5b..73346b9af 100644 --- a/profile/attribute/string_attribute.go +++ b/profile/attribute/string_attribute.go @@ -20,6 +20,7 @@ func NewString(a *yotiprotoattr.Attribute) *StringAttribute { name: a.Name, contentType: a.ContentType.String(), anchors: parsedAnchors, + id: &a.EphemeralId, }, value: string(a.Value), } diff --git a/profile/base_profile.go b/profile/base_profile.go index 0c1e805bb..df5ad75fa 100644 --- a/profile/base_profile.go +++ b/profile/base_profile.go @@ -19,6 +19,27 @@ func (p baseProfile) GetAttribute(attributeName string) *attribute.GenericAttrib return nil } +// GetAttributeByID retrieve an attribute by ID on the Yoti profile. Will return nil if attribute is not present. +func (p baseProfile) GetAttributeByID(attributeID string) *attribute.GenericAttribute { + for _, a := range p.attributeSlice { + if a.EphemeralId == attributeID { + return attribute.NewGeneric(a) + } + } + return nil +} + +// GetAttributes retrieve a list of attributes by name on the Yoti profile. Will return an empty list of attribute is not present. +func (p baseProfile) GetAttributes(attributeName string) []*attribute.GenericAttribute { + var attributes []*attribute.GenericAttribute + for _, a := range p.attributeSlice { + if a.Name == attributeName { + attributes = append(attributes, attribute.NewGeneric(a)) + } + } + return attributes +} + // GetStringAttribute retrieves a string attribute by name. Will return nil if attribute is not present. func (p baseProfile) GetStringAttribute(attributeName string) *attribute.StringAttribute { for _, a := range p.attributeSlice { diff --git a/profile/data_objects.go b/profile/data_objects.go index a12a10ee9..27d4b65e6 100644 --- a/profile/data_objects.go +++ b/profile/data_objects.go @@ -15,7 +15,13 @@ type receiptDO struct { Timestamp string `json:"timestamp"` } +type errorDetailsDO struct { + ErrorCode *string `json:"error_code"` + Description *string `json:"description"` +} + type profileDO struct { - SessionData string `json:"session_data"` - Receipt receiptDO `json:"receipt"` + SessionData string `json:"session_data"` + Receipt receiptDO `json:"receipt"` + ErrorDetails *errorDetailsDO `json:"error_details"` } diff --git a/profile/receipt_parser.go b/profile/receipt_parser.go index 7b2183ebb..5fff5a0b5 100644 --- a/profile/receipt_parser.go +++ b/profile/receipt_parser.go @@ -7,7 +7,7 @@ import ( "github.com/getyoti/yoti-go-sdk/v3/util" "github.com/getyoti/yoti-go-sdk/v3/yotiprotoattr" "github.com/getyoti/yoti-go-sdk/v3/yotiprotocom" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) func parseApplicationProfile(receipt *receiptDO, key *rsa.PrivateKey) (result *yotiprotoattr.AttributeList, err error) { diff --git a/profile/service.go b/profile/service.go index 6413e609b..60aa07d4c 100644 --- a/profile/service.go +++ b/profile/service.go @@ -69,37 +69,37 @@ func handleSuccessfulResponse(responseBytes []byte, key *rsa.PrivateKey) (activi } if parsedResponse.Receipt.SharingOutcome != "SUCCESS" { - err = yotierror.SharingFailureError - } else { - var userAttributeList, applicationAttributeList *yotiprotoattr.AttributeList - if userAttributeList, err = parseUserProfile(&parsedResponse.Receipt, key); err != nil { - return - } - if applicationAttributeList, err = parseApplicationProfile(&parsedResponse.Receipt, key); err != nil { - return - } - id := parsedResponse.Receipt.RememberMeID + return activityDetails, handleUnsuccessfulShare(parsedResponse) + } - userProfile := newUserProfile(userAttributeList) - applicationProfile := newApplicationProfile(applicationAttributeList) + var userAttributeList, applicationAttributeList *yotiprotoattr.AttributeList + if userAttributeList, err = parseUserProfile(&parsedResponse.Receipt, key); err != nil { + return + } + if applicationAttributeList, err = parseApplicationProfile(&parsedResponse.Receipt, key); err != nil { + return + } + id := parsedResponse.Receipt.RememberMeID - var extraData *extra.Data - extraData, err = parseExtraData(&parsedResponse.Receipt, key, err) + userProfile := newUserProfile(userAttributeList) + applicationProfile := newApplicationProfile(applicationAttributeList) - timestamp, timestampErr := time.Parse(time.RFC3339Nano, parsedResponse.Receipt.Timestamp) - if timestampErr != nil { - err = yotierror.MultiError{This: errors.New("Unable to read timestamp. Error: " + timestampErr.Error()), Next: err} - } + var extraData *extra.Data + extraData, err = parseExtraData(&parsedResponse.Receipt, key, err) - activityDetails = ActivityDetails{ - UserProfile: userProfile, - rememberMeID: id, - parentRememberMeID: parsedResponse.Receipt.ParentRememberMeID, - timestamp: timestamp, - receiptID: parsedResponse.Receipt.ReceiptID, - ApplicationProfile: applicationProfile, - extraData: extraData, - } + timestamp, timestampErr := time.Parse(time.RFC3339Nano, parsedResponse.Receipt.Timestamp) + if timestampErr != nil { + err = yotierror.MultiError{This: errors.New("Unable to read timestamp. Error: " + timestampErr.Error()), Next: err} + } + + activityDetails = ActivityDetails{ + UserProfile: userProfile, + rememberMeID: id, + parentRememberMeID: parsedResponse.Receipt.ParentRememberMeID, + timestamp: timestamp, + receiptID: parsedResponse.Receipt.ReceiptID, + ApplicationProfile: applicationProfile, + extraData: extraData, } return activityDetails, err @@ -132,3 +132,14 @@ func parseIsAgeVerifiedValue(byteValue []byte) (result *bool, err error) { return } + +func handleUnsuccessfulShare(parsedResponse profileDO) error { + if parsedResponse.ErrorDetails != nil && parsedResponse.ErrorDetails.ErrorCode != nil { + return yotierror.DetailedSharingFailureError{ + Code: parsedResponse.ErrorDetails.ErrorCode, + Description: parsedResponse.ErrorDetails.Description, + } + } + + return yotierror.SharingFailureError +} diff --git a/profile/service_test.go b/profile/service_test.go index 69de5dedb..e9040bd3d 100644 --- a/profile/service_test.go +++ b/profile/service_test.go @@ -15,9 +15,10 @@ import ( "time" "github.com/getyoti/yoti-go-sdk/v3/cryptoutil" + "github.com/getyoti/yoti-go-sdk/v3/yotierror" "github.com/getyoti/yoti-go-sdk/v3/yotiprotocom" "github.com/getyoti/yoti-go-sdk/v3/yotiprotoshare" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/getyoti/yoti-go-sdk/v3/test" @@ -156,7 +157,69 @@ func TestProfileService_GetActivityDetails(t *testing.T) { assert.DeepEqual(t, actualDoB.Value(), &expectedDoB) } -func TestProfileService_SharingFailure_ReturnsFailure(t *testing.T) { +func TestProfileService_SharingFailure_ReturnsSpecificFailure(t *testing.T) { + key := getValidKey() + + client := &mockHTTPClient{ + do: func(*http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Body: ioutil.NopCloser(strings.NewReader(`{"session_data":"session_data","receipt":{"receipt_id": null,"other_party_profile_content": null,"policy_uri":null,"personal_key":null,"remember_me_id":null, "sharing_outcome":"FAILURE","timestamp":"2016-09-23T13:04:11Z"},"error_details":{"error_code":"SOME_ERROR","description":"SOME_DESCRIPTION"}}`)), + }, nil + }, + } + + errorCode := "SOME_ERROR" + + description := "SOME_DESCRIPTION" + + expectedError := yotierror.DetailedSharingFailureError{ + Code: &errorCode, + Description: &description, + } + + _, err := GetActivityDetails(client, test.EncryptedToken, "sdkId", "https://apiurl", key) + + assert.DeepEqual(t, err, expectedError) + + assert.ErrorContains(t, err, "sharing failure") + + tempError, temporary := err.(interface { + Temporary() bool + }) + assert.Check(t, !temporary || !tempError.Temporary()) +} + +func TestProfileService_SharingFailure_ReturnsGenericErrorWhenErrorCodeIsNull(t *testing.T) { + key := getValidKey() + + client := &mockHTTPClient{ + do: func(*http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Body: ioutil.NopCloser(strings.NewReader(`{"session_data":"session_data","receipt":{"receipt_id": null,"other_party_profile_content": null,"policy_uri":null,"personal_key":null,"remember_me_id":null, "sharing_outcome":"FAILURE","timestamp":"2016-09-23T13:04:11Z"},"error_details":{}}`)), + }, nil + }, + } + + expectedError := yotierror.DetailedSharingFailureError{ + Code: nil, + Description: nil, + } + + _, err := GetActivityDetails(client, test.EncryptedToken, "sdkId", "https://apiurl", key) + + assert.DeepEqual(t, err, expectedError) + + assert.ErrorContains(t, err, "sharing failure") + + tempError, temporary := err.(interface { + Temporary() bool + }) + assert.Check(t, !temporary || !tempError.Temporary()) +} + +func TestProfileService_SharingFailure_ReturnsGenericFailure(t *testing.T) { key := getValidKey() client := &mockHTTPClient{ @@ -168,6 +231,7 @@ func TestProfileService_SharingFailure_ReturnsFailure(t *testing.T) { }, } _, err := GetActivityDetails(client, test.EncryptedToken, "sdkId", "https://apiurl", key) + assert.ErrorContains(t, err, "sharing failure") tempError, temporary := err.(interface { diff --git a/profile/user_profile.go b/profile/user_profile.go index 9fb40e396..3ab7648da 100644 --- a/profile/user_profile.go +++ b/profile/user_profile.go @@ -37,6 +37,18 @@ func (p UserProfile) Selfie() *attribute.ImageAttribute { return p.GetImageAttribute(consts.AttrSelfie) } +// GetSelfieAttributeByID retrieve a Selfie attribute by ID on the Yoti profile. +// This attribute is a photograph of the user. +// Will return nil if attribute is not present. +func (p UserProfile) GetSelfieAttributeByID(attributeID string) (*attribute.ImageAttribute, error) { + for _, a := range p.attributeSlice { + if a.EphemeralId == attributeID { + return attribute.NewImage(a) + } + } + return nil, nil +} + // GivenNames corresponds to secondary names in passport, and first/middle names in English. Will be nil if not provided by Yoti. func (p UserProfile) GivenNames() *attribute.StringAttribute { return p.GetStringAttribute(consts.AttrGivenNames) @@ -120,6 +132,19 @@ func (p UserProfile) DocumentImages() (*attribute.ImageSliceAttribute, error) { return nil, nil } +// GetDocumentImagesAttributeByID retrieve a Document Images attribute by ID on the Yoti profile. +// This attribute consists of a slice of document images cropped from the image in the capture page. +// There can be multiple images as per the number of regions in the capture in this attribute. +// Will return nil if attribute is not present. +func (p UserProfile) GetDocumentImagesAttributeByID(attributeID string) (*attribute.ImageSliceAttribute, error) { + for _, a := range p.attributeSlice { + if a.EphemeralId == attributeID { + return attribute.NewImageSlice(a) + } + } + return nil, nil +} + // DocumentDetails represents information extracted from a document provided by the user. // Will be nil if not provided by Yoti. func (p UserProfile) DocumentDetails() (*attribute.DocumentDetailsAttribute, error) { @@ -131,6 +156,12 @@ func (p UserProfile) DocumentDetails() (*attribute.DocumentDetailsAttribute, err return nil, nil } +// IdentityProfileReport represents the JSON object containing identity assertion and the +// verification report. Will be nil if not provided by Yoti. +func (p UserProfile) IdentityProfileReport() (*attribute.JSONAttribute, error) { + return p.GetJSONAttribute(consts.AttrIdentityProfileReport) +} + // AgeVerifications returns a slice of age verifications for the user. // Will be an empty slice if not provided by Yoti. func (p UserProfile) AgeVerifications() (out []attribute.AgeVerification, err error) { diff --git a/profile/user_profile_test.go b/profile/user_profile_test.go index 5c2948ecd..0750fa6ad 100644 --- a/profile/user_profile_test.go +++ b/profile/user_profile_test.go @@ -2,20 +2,73 @@ package profile import ( "encoding/base64" + "fmt" "strconv" "strings" "testing" "time" "github.com/getyoti/yoti-go-sdk/v3/consts" + "github.com/getyoti/yoti-go-sdk/v3/file" "github.com/getyoti/yoti-go-sdk/v3/media" "github.com/getyoti/yoti-go-sdk/v3/yotiprotoattr" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) -const attributeName = "test_attribute_name" +const ( + attributeName = "test_attribute_name" + attributeValueString = "value" + + documentImagesAttributeID = "document-images-attribute-id-123" + selfieAttributeID = "selfie-attribute-id-123" + fullNameAttributeID = "full-name-id-123" +) + +var attributeValue = []byte(attributeValueString) + +func getUserProfile() UserProfile { + userProfile := createProfileWithMultipleAttributes( + createDocumentImagesAttribute(documentImagesAttributeID), + createSelfieAttribute(yotiprotoattr.ContentType_JPEG, selfieAttributeID), + createStringAttribute("full_name", []byte("John Smith"), []*yotiprotoattr.Anchor{}, fullNameAttributeID)) + + return userProfile +} + +func ExampleUserProfile_GetAttributeByID() { + userProfile := getUserProfile() + fullNameAttribute := userProfile.GetAttributeByID("full-name-id-123") + value := fullNameAttribute.Value().(string) + + fmt.Println(value) + // Output: John Smith +} + +func ExampleUserProfile_GetDocumentImagesAttributeByID() { + userProfile := getUserProfile() + documentImagesAttribute, err := userProfile.GetDocumentImagesAttributeByID("document-images-attribute-id-123") + if err != nil { + fmt.Printf("error: %s", err.Error()) + return + } + + fmt.Println(*documentImagesAttribute.ID()) + // Output: document-images-attribute-id-123 +} + +func ExampleUserProfile_GetSelfieAttributeByID() { + userProfile := getUserProfile() + selfieAttribute, err := userProfile.GetSelfieAttributeByID("selfie-attribute-id-123") + if err != nil { + fmt.Printf("error: %s", err.Error()) + return + } + + fmt.Println(*selfieAttribute.ID()) + // Output: selfie-attribute-id-123 +} func createProfileWithSingleAttribute(attr *yotiprotoattr.Attribute) UserProfile { var attributeSlice []*yotiprotoattr.Attribute @@ -210,12 +263,12 @@ func TestProfile_GetAttribute_InvalidInt_ReturnsNil(t *testing.T) { } func TestProfile_EmptyStringIsAllowed(t *testing.T) { - attributeValueString := "" - attributeValue := []byte(attributeValueString) + emptyString := "" + attrValue := []byte(emptyString) var attr = &yotiprotoattr.Attribute{ Name: consts.AttrGender, - Value: attributeValue, + Value: attrValue, ContentType: yotiprotoattr.ContentType_STRING, Anchors: []*yotiprotoattr.Anchor{}, } @@ -223,7 +276,7 @@ func TestProfile_EmptyStringIsAllowed(t *testing.T) { profile := createProfileWithSingleAttribute(attr) att := profile.Gender() - assert.Equal(t, att.Value(), attributeValueString) + assert.Equal(t, att.Value(), emptyString) } func TestProfile_GetAttribute_Time(t *testing.T) { @@ -246,8 +299,6 @@ func TestProfile_GetAttribute_Time(t *testing.T) { } func TestProfile_GetAttribute_Jpeg(t *testing.T) { - attributeValue := []byte("value") - var attr = &yotiprotoattr.Attribute{ Name: attributeName, Value: attributeValue, @@ -266,8 +317,6 @@ func TestProfile_GetAttribute_Jpeg(t *testing.T) { } func TestProfile_GetAttribute_Png(t *testing.T) { - attributeValue := []byte("value") - var attr = &yotiprotoattr.Attribute{ Name: attributeName, Value: attributeValue, @@ -287,11 +336,11 @@ func TestProfile_GetAttribute_Png(t *testing.T) { func TestProfile_GetAttribute_Bool(t *testing.T) { var initialBoolValue = true - attributeValue := []byte(strconv.FormatBool(initialBoolValue)) + attrValue := []byte(strconv.FormatBool(initialBoolValue)) var attr = &yotiprotoattr.Attribute{ Name: attributeName, - Value: attributeValue, + Value: attrValue, ContentType: yotiprotoattr.ContentType_STRING, Anchors: []*yotiprotoattr.Anchor{}, } @@ -331,9 +380,6 @@ func TestProfile_GetAttribute_JSON(t *testing.T) { } func TestProfile_GetAttribute_Undefined(t *testing.T) { - attributeValueString := "value" - attributeValue := []byte(attributeValueString) - var attr = &yotiprotoattr.Attribute{ Name: attributeName, Value: attributeValue, @@ -360,14 +406,72 @@ func TestProfile_GetAttribute_ReturnsNil(t *testing.T) { assert.Assert(t, is.Nil(result)) } +func TestProfile_GetAttributeByID(t *testing.T) { + attributeID := "att-id-123" + + var attr1 = &yotiprotoattr.Attribute{ + Name: attributeName, + Value: attributeValue, + ContentType: yotiprotoattr.ContentType_STRING, + Anchors: []*yotiprotoattr.Anchor{}, + EphemeralId: attributeID, + } + var attr2 = &yotiprotoattr.Attribute{ + Name: attributeName, + Value: attributeValue, + ContentType: yotiprotoattr.ContentType_STRING, + Anchors: []*yotiprotoattr.Anchor{}, + EphemeralId: "non-matching-attribute-ID", + } + + profile := createProfileWithMultipleAttributes(attr1, attr2) + + result := profile.GetAttributeByID(attributeID) + assert.DeepEqual(t, result.ID(), &attributeID) +} + +func TestProfile_GetAttributeByID_ReturnsNil(t *testing.T) { + userProfile := UserProfile{ + baseProfile{ + attributeSlice: []*yotiprotoattr.Attribute{}, + }, + } + + result := userProfile.GetAttributeByID("attributeName") + + assert.Assert(t, is.Nil(result)) +} + +func TestProfile_GetDocumentImagesAttributeByID_ReturnsNil(t *testing.T) { + userProfile := UserProfile{ + baseProfile{ + attributeSlice: []*yotiprotoattr.Attribute{}, + }, + } + + result, err := userProfile.GetDocumentImagesAttributeByID("attributeName") + assert.NilError(t, err) + assert.Assert(t, is.Nil(result)) +} + +func TestProfile_GetSelfieAttributeByID_ReturnsNil(t *testing.T) { + userProfile := UserProfile{ + baseProfile{ + attributeSlice: []*yotiprotoattr.Attribute{}, + }, + } + + result, err := userProfile.GetSelfieAttributeByID("attributeName") + assert.NilError(t, err) + assert.Assert(t, is.Nil(result)) +} + func TestProfile_StringAttribute(t *testing.T) { nationalityName := consts.AttrNationality - attributeValueString := "value" - attributeValueBytes := []byte(attributeValueString) var as = &yotiprotoattr.Attribute{ Name: nationalityName, - Value: attributeValueBytes, + Value: attributeValue, ContentType: yotiprotoattr.ContentType_STRING, Anchors: []*yotiprotoattr.Anchor{}, } @@ -380,20 +484,12 @@ func TestProfile_StringAttribute(t *testing.T) { } func TestProfile_AttributeProperty_RetrievesAttribute(t *testing.T) { - selfieName := consts.AttrSelfie - attributeValue := []byte("value") - - var attributeImage = &yotiprotoattr.Attribute{ - Name: selfieName, - Value: attributeValue, - ContentType: yotiprotoattr.ContentType_PNG, - Anchors: []*yotiprotoattr.Anchor{}, - } + attributeImage := createSelfieAttribute(yotiprotoattr.ContentType_PNG, "id") result := createProfileWithSingleAttribute(attributeImage) selfie := result.Selfie() - assert.Equal(t, selfie.Name(), selfieName) + assert.Equal(t, selfie.Name(), consts.AttrSelfie) assert.DeepEqual(t, attributeValue, selfie.Value().Data()) assert.Equal(t, selfie.ContentType(), yotiprotoattr.ContentType_PNG.String()) } @@ -417,16 +513,7 @@ func TestProfile_DocumentDetails_RetrievesAttribute(t *testing.T) { } func TestProfile_DocumentImages_RetrievesAttribute(t *testing.T) { - documentImagesName := consts.AttrDocumentImages - attributeValue, err := proto.Marshal(&yotiprotoattr.MultiValue{}) - assert.NilError(t, err) - - protoAttribute := &yotiprotoattr.Attribute{ - Name: documentImagesName, - Value: attributeValue, - ContentType: yotiprotoattr.ContentType_MULTI_VALUE, - Anchors: make([]*yotiprotoattr.Anchor, 0), - } + protoAttribute := createDocumentImagesAttribute("attr-id") result := createProfileWithSingleAttribute(protoAttribute) documentImages, err := result.DocumentImages() @@ -437,12 +524,12 @@ func TestProfile_DocumentImages_RetrievesAttribute(t *testing.T) { func TestProfile_AttributesReturnsNilWhenNotPresent(t *testing.T) { documentImagesName := consts.AttrDocumentImages - attributeValue, err := proto.Marshal(&yotiprotoattr.MultiValue{}) + multiValue, err := proto.Marshal(&yotiprotoattr.MultiValue{}) assert.NilError(t, err) protoAttribute := &yotiprotoattr.Attribute{ Name: documentImagesName, - Value: attributeValue, + Value: multiValue, ContentType: yotiprotoattr.ContentType_MULTI_VALUE, Anchors: make([]*yotiprotoattr.Anchor, 0), } @@ -488,94 +575,130 @@ func TestMissingPostalAddress_UsesFormattedAddress(t *testing.T) { } func TestAttributeImage_Image_Png(t *testing.T) { - selfieName := consts.AttrSelfie - byteValue := []byte("value") - - var attributeImage = &yotiprotoattr.Attribute{ - Name: selfieName, - Value: byteValue, - ContentType: yotiprotoattr.ContentType_PNG, - Anchors: []*yotiprotoattr.Anchor{}, - } + attributeImage := createSelfieAttribute(yotiprotoattr.ContentType_PNG, "id") result := createProfileWithSingleAttribute(attributeImage) selfie := result.Selfie() - assert.DeepEqual(t, selfie.Value().Data(), byteValue) + assert.DeepEqual(t, selfie.Value().Data(), attributeValue) } func TestAttributeImage_Image_Jpeg(t *testing.T) { - selfieName := consts.AttrSelfie - byteValue := []byte("value") - - var attributeImage = &yotiprotoattr.Attribute{ - Name: selfieName, - Value: byteValue, - ContentType: yotiprotoattr.ContentType_JPEG, - Anchors: []*yotiprotoattr.Anchor{}, - } + attributeImage := createSelfieAttribute(yotiprotoattr.ContentType_JPEG, "id") result := createProfileWithSingleAttribute(attributeImage) selfie := result.Selfie() - assert.DeepEqual(t, selfie.Value().Data(), byteValue) + assert.DeepEqual(t, selfie.Value().Data(), attributeValue) } func TestAttributeImage_Image_Default(t *testing.T) { - selfieName := consts.AttrSelfie - byteValue := []byte("value") + attributeImage := createSelfieAttribute(yotiprotoattr.ContentType_PNG, "id") - var attributeImage = &yotiprotoattr.Attribute{ - Name: selfieName, - Value: byteValue, - ContentType: yotiprotoattr.ContentType_PNG, - Anchors: []*yotiprotoattr.Anchor{}, - } result := createProfileWithSingleAttribute(attributeImage) selfie := result.Selfie() - assert.DeepEqual(t, selfie.Value().Data(), byteValue) + assert.DeepEqual(t, selfie.Value().Data(), attributeValue) } func TestAttributeImage_Base64Selfie_Png(t *testing.T) { - selfieName := consts.AttrSelfie - imageBytes := []byte("value") + attributeImage := createSelfieAttribute(yotiprotoattr.ContentType_PNG, "id") - var attributeImage = &yotiprotoattr.Attribute{ - Name: selfieName, - Value: imageBytes, - ContentType: yotiprotoattr.ContentType_PNG, - Anchors: []*yotiprotoattr.Anchor{}, - } + result := createProfileWithSingleAttribute(attributeImage) + base64ImageExpectedValue := base64.StdEncoding.EncodeToString(attributeValue) + expectedBase64Selfie := "data:image/png;base64," + base64ImageExpectedValue + base64Selfie := result.Selfie().Value().Base64URL() + + assert.Equal(t, base64Selfie, expectedBase64Selfie) +} + +func TestAttributeImage_Base64URL_Jpeg(t *testing.T) { + attributeImage := createSelfieAttribute(yotiprotoattr.ContentType_JPEG, "id") result := createProfileWithSingleAttribute(attributeImage) - base64ImageExpectedValue := base64.StdEncoding.EncodeToString(imageBytes) + base64ImageExpectedValue := base64.StdEncoding.EncodeToString(attributeValue) - expectedBase64Selfie := "data:image/png;base64," + base64ImageExpectedValue + expectedBase64Selfie := "data:image/jpeg;base64," + base64ImageExpectedValue base64Selfie := result.Selfie().Value().Base64URL() assert.Equal(t, base64Selfie, expectedBase64Selfie) } -func TestAttributeImage_Base64URL_Jpeg(t *testing.T) { - selfieName := consts.AttrSelfie - imageBytes := []byte("value") +func TestProfile_IdentityProfileReport_RetrievesAttribute(t *testing.T) { + identityProfileReportJSON, err := file.ReadFile("../test/fixtures/RTWIdentityProfileReport.json") + assert.NilError(t, err) - var attributeImage = &yotiprotoattr.Attribute{ - Name: selfieName, - Value: imageBytes, - ContentType: yotiprotoattr.ContentType_JPEG, + var attr = &yotiprotoattr.Attribute{ + Name: consts.AttrIdentityProfileReport, + Value: identityProfileReportJSON, + ContentType: yotiprotoattr.ContentType_JSON, Anchors: []*yotiprotoattr.Anchor{}, } - result := createProfileWithSingleAttribute(attributeImage) + result := createProfileWithSingleAttribute(attr) + att, err := result.IdentityProfileReport() + assert.NilError(t, err) - base64ImageExpectedValue := base64.StdEncoding.EncodeToString(imageBytes) + retrievedIdentityProfile := att.Value() + gotProof := retrievedIdentityProfile["proof"] - expectedBase64Selfie := "data:image/jpeg;base64," + base64ImageExpectedValue + assert.Equal(t, gotProof, "") +} - base64Selfie := result.Selfie().Value().Base64URL() +func TestProfileAllowsMultipleAttributesWithSameName(t *testing.T) { + firstAttribute := createStringAttribute("full_name", []byte("some_value"), []*yotiprotoattr.Anchor{}, "id") + secondAttribute := createStringAttribute("full_name", []byte("some_other_value"), []*yotiprotoattr.Anchor{}, "id") - assert.Equal(t, base64Selfie, expectedBase64Selfie) + var attributeSlice []*yotiprotoattr.Attribute + attributeSlice = append(attributeSlice, firstAttribute, secondAttribute) + + var profile = UserProfile{ + baseProfile{ + attributeSlice: attributeSlice, + }, + } + + var fullNames = profile.GetAttributes("full_name") + + assert.Assert(t, is.Equal(len(fullNames), 2)) + assert.Assert(t, is.Equal(fullNames[0].Value().(string), "some_value")) + assert.Assert(t, is.Equal(fullNames[1].Value().(string), "some_other_value")) +} + +func createStringAttribute(name string, value []byte, anchors []*yotiprotoattr.Anchor, attributeID string) *yotiprotoattr.Attribute { + return &yotiprotoattr.Attribute{ + Name: name, + Value: value, + ContentType: yotiprotoattr.ContentType_STRING, + Anchors: anchors, + EphemeralId: attributeID, + } +} + +func createSelfieAttribute(contentType yotiprotoattr.ContentType, attributeID string) *yotiprotoattr.Attribute { + var attributeImage = &yotiprotoattr.Attribute{ + Name: consts.AttrSelfie, + Value: attributeValue, + ContentType: contentType, + Anchors: []*yotiprotoattr.Anchor{}, + EphemeralId: attributeID, + } + return attributeImage +} + +func createDocumentImagesAttribute(attributeID string) *yotiprotoattr.Attribute { + multiValue, err := proto.Marshal(&yotiprotoattr.MultiValue{}) + if err != nil { + panic(err) + } + + protoAttribute := &yotiprotoattr.Attribute{ + Name: consts.AttrDocumentImages, + Value: multiValue, + ContentType: yotiprotoattr.ContentType_MULTI_VALUE, + Anchors: make([]*yotiprotoattr.Anchor, 0), + EphemeralId: attributeID, + } + return protoAttribute } diff --git a/requests/signed_message_test.go b/requests/signed_message_test.go index d4a49a116..3f49068af 100644 --- a/requests/signed_message_test.go +++ b/requests/signed_message_test.go @@ -78,7 +78,9 @@ func TestRequestShouldBuildForValid(t *testing.T) { urlCheck, err := regexp.Match(baseURL+endpoint, []byte(signed.URL.String())) assert.NilError(t, err) assert.Check(t, urlCheck) - assert.Check(t, signed.Header["X-Yoti-Auth-Digest"][0] != "") + assert.Check(t, signed.Header.Get("X-Yoti-Auth-Digest") != "") + assert.Equal(t, signed.Header.Get("X-Yoti-SDK"), "Go") + assert.Equal(t, signed.Header.Get("X-Yoti-SDK-Version"), "3.6.0") } func TestRequestShouldAddHeaders(t *testing.T) { diff --git a/sh/go-build-modtidy.sh b/sh/go-build-modtidy.sh index d5c07fd99..46b63f5ad 100755 --- a/sh/go-build-modtidy.sh +++ b/sh/go-build-modtidy.sh @@ -2,5 +2,5 @@ go build ./... for d in _examples/*/; do - (cd "$d" && go mod tidy) + (cd "$d" && go mod tidy -compat=1.17) done diff --git a/sonar-project.properties b/sonar-project.properties index 2f8448763..d3591684d 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,7 +1,7 @@ sonar.organization = getyoti sonar.projectKey = getyoti:go sonar.projectName = Go SDK -sonar.projectVersion = 3.5.0 +sonar.projectVersion = 3.6.0 sonar.exclusions = **/yotiprotoattr/*.go,**/yotiprotocom/*.go,**/yotiprotoshare/*.go,**/**_test.go,_examples/**/* sonar.links.scm = https://github.com/getyoti/yoti-go-sdk sonar.host.url = https://sonarcloud.io diff --git a/test/attribute.go b/test/attribute.go index 7764ee8d2..1e3787efa 100644 --- a/test/attribute.go +++ b/test/attribute.go @@ -5,7 +5,7 @@ import ( "time" "github.com/getyoti/yoti-go-sdk/v3/yotiprotoshare" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "gotest.tools/v3/assert" ) diff --git a/test/fixtures/RTWIdentityProfileReport.json b/test/fixtures/RTWIdentityProfileReport.json new file mode 100644 index 000000000..c389acc9b --- /dev/null +++ b/test/fixtures/RTWIdentityProfileReport.json @@ -0,0 +1,118 @@ +{ + "identity_assertion": { + "current_name": { + "given_names": "JOHN JIM FRED", + "first_name": "JOHN", + "middle_name": "JIM FRED", + "family_name": "FOO", + "full_name": "JOHN JIM FRED FOO" + }, + "date_of_birth": "1979-01-01" + }, + "verification_report": { + "report_id": "61b99534-116d-4a25-9750-2d708c0fb168", + "timestamp": "2022-01-02T15:04:05Z", + "subject_id": "f0726cb6-97c1-4802-9feb-eb7c6cd07949", + "trust_framework": "UK_TFIDA", + "schemes_compliance": [ + { + "scheme": { + "type": "RTW" + }, + "requirements_met": true + } + ], + "assurance_process": { + "level_of_assurance": "MEDIUM", + "policy": "GPG45", + "procedure": "M1C", + "assurance": [ + { + "type": "EVIDENCE_STRENGTH", + "classification": "4", + "evidence_links": [ + "41960172-ca91-487c-8bb3-2c547f80fe54" + ] + }, + { + "type": "EVIDENCE_VALIDITY", + "classification": "3", + "evidence_links": [ + "41960172-ca91-487c-8bb3-2c547f80fe54" + ] + }, + { + "type": "VERIFICATION", + "classification": "3", + "evidence_links": [ + "41960172-ca91-487c-8bb3-2c547f80fe54", + "fb0880ca-5dd5-4776-badb-17549123c50b" + ] + } + ] + }, + "evidence": { + "documents": [ + { + "evidence_id": "41960172-ca91-487c-8bb3-2c547f80fe54", + "timestamp": "2022-01-02T15:04:05Z", + "document_fields": { + "full_name": "JOHN JIM FRED FOO", + "date_of_birth": "1979-01-01", + "nationality": "GBR", + "given_names": "JOHN JIM FRED", + "family_name": "FOO", + "place_of_birth": "SAMPLETOWN", + "gender": "MALE", + "document_type": "PASSPORT", + "issuing_country": "GBR", + "document_number": "123456789", + "expiration_date": "2030-01-01", + "date_of_issue": "2020-01-01", + "issuing_authority": "HMPO", + "mrz": { + "type": 2, + "line1": "P" +} diff --git a/test/fixtures/watchlist_advanced_ca_profile_custom.json b/test/fixtures/watchlist_advanced_ca_profile_custom.json new file mode 100644 index 000000000..968e4cc69 --- /dev/null +++ b/test/fixtures/watchlist_advanced_ca_profile_custom.json @@ -0,0 +1,257 @@ +{ + "client_session_token_ttl": 155057, + "session_id": "a3819be3-df1f-4d8c-9161-abfe1b19d9e8", + "state": "COMPLETED", + "resources": { + "id_documents": [ + { + "id": "d99241db-243f-472d-84a2-d956b87db5f8", + "tasks": [ + { + "type": "ID_DOCUMENT_TEXT_DATA_EXTRACTION", + "id": "e1995b9a-9b6f-43b9-a179-32bbe2d25586", + "state": "DONE", + "created": "2022-01-14T14:54:14Z", + "last_updated": "2022-01-14T14:59:13Z", + "generated_checks": [ + { + "id": "851cec96-7459-49d3-b9b2-bcbc4c759987", + "type": "ID_DOCUMENT_TEXT_DATA_CHECK" + } + ], + "generated_media": [ + { + "id": "a8c9e973-4e58-43d8-952d-17f36f12bce2", + "type": "JSON" + } + ] + } + ], + "source": { + "type": "END_USER" + }, + "document_type": "DRIVING_LICENCE", + "issuing_country": "GBR", + "pages": [ + { + "capture_method": "UPLOAD", + "media": { + "id": "8c65cb1c-92cb-43df-bac1-65433ac3a1c1", + "type": "IMAGE", + "created": "2022-01-14T14:54:30Z", + "last_updated": "2022-01-14T14:54:30Z" + }, + "frames": [{}, {}] + }, + { + "capture_method": "UPLOAD", + "media": { + "id": "a7c8331c-6e29-4720-8818-27c02e6252b3", + "type": "IMAGE", + "created": "2022-01-14T14:54:31Z", + "last_updated": "2022-01-14T14:54:31Z" + }, + "frames": [{}, {}] + } + ], + "document_fields": { + "media": { + "id": "b5cae0f3-ae43-41d3-b8a7-1b0d363938ef", + "type": "JSON", + "created": "2022-01-14T14:59:13Z", + "last_updated": "2022-01-14T14:59:13Z" + } + }, + "document_id_photo": { + "media": { + "id": "ee3f9895-0552-4e16-ad9a-914e2f676c10", + "type": "IMAGE", + "created": "2022-01-14T14:54:34Z", + "last_updated": "2022-01-14T14:54:34Z" + } + } + } + ], + "supplementary_documents": [], + "liveness_capture": [], + "face_capture": [] + }, + "checks": [ + { + "type": "ID_DOCUMENT_AUTHENTICITY", + "id": "f11efbfb-712c-4f9d-8328-2add190f32e3", + "state": "DONE", + "resources_used": ["d99241db-243f-472d-84a2-d956b87db5f8"], + "generated_media": [], + "report": { + "recommendation": { + "value": "APPROVE" + }, + "breakdown": [ + { + "sub_check": "doc_number_validation", + "result": "PASS", + "details": [] + }, + { + "sub_check": "document_in_date", + "result": "PASS", + "details": [] + }, + { + "sub_check": "fraud_list_check", + "result": "PASS", + "details": [] + } + ] + }, + "created": "2022-01-14T14:54:36Z", + "last_updated": "2022-01-14T14:59:14Z" + }, + { + "type": "ID_DOCUMENT_TEXT_DATA_CHECK", + "id": "851cec96-7459-49d3-b9b2-bcbc4c759987", + "state": "DONE", + "resources_used": ["d99241db-243f-472d-84a2-d956b87db5f8"], + "generated_media": [ + { + "id": "b5cae0f3-ae43-41d3-b8a7-1b0d363938ef", + "type": "JSON" + } + ], + "report": { + "recommendation": { + "value": "APPROVE" + }, + "breakdown": [ + { + "sub_check": "text_data_readable", + "result": "PASS", + "details": [] + } + ] + }, + "created": "2022-01-14T14:54:36Z", + "last_updated": "2022-01-14T14:59:13Z" + }, + { + "type": "WATCHLIST_ADVANCED_CA", + "id": "06e661c5-0e24-44ed-8f6c-8b99807efc12", + "state": "DONE", + "resources_used": ["d99241db-243f-472d-84a2-d956b87db5f8"], + "generated_media": [ + { + "id": "7c405b5e-348d-4a2c-87ff-787d4fb139c0", + "type": "JSON" + } + ], + "report": { + "recommendation": { + "value": "CONSIDER", + "reason": "POTENTIAL_MATCH" + }, + "breakdown": [ + { + "sub_check": "adverse_media", + "result": "FAIL", + "details": [ + { + "name": "number_of_hits", + "value": "251" + }, + { + "name": "closest_match", + "value": "name_exact,year_of_birth" + } + ] + }, + { + "sub_check": "custom_search", + "result": "FAIL", + "details": [] + }, + { + "sub_check": "fitness_probity", + "result": "FAIL", + "details": [ + { + "name": "number_of_hits", + "value": "3" + }, + { + "name": "closest_match", + "value": "name_exact" + } + ] + }, + { + "sub_check": "pep", + "result": "FAIL", + "details": [ + { + "name": "number_of_hits", + "value": "13" + }, + { + "name": "closest_match", + "value": "name_exact,year_of_birth" + } + ] + }, + { + "sub_check": "warning", + "result": "FAIL", + "details": [ + { + "name": "number_of_hits", + "value": "9" + }, + { + "name": "closest_match", + "value": "name_exact,year_of_birth" + } + ] + } + ], + "watchlist_summary": { + "total_hits": 100, + "search_config": { + "type": "WITH_CUSTOM_ACCOUNT", + "remove_deceased": true, + "share_url": true, + "matching_strategy": { + "type": "FUZZY", + "fuzziness": 0.6 + }, + "sources": { + "type": "PROFILE", + "search_profile": "b41d82de-9a1d-4494-97a6-8b1b9895a908" + }, + "api_key": "gQ2vf0STnF5nGy9SSdyuGJuYMFfNASmV", + "client_ref": "111111", + "monitoring": true + }, + "raw_results": { + "media": { + "id": "0ebadb40-670a-4dd8-b0cc-5079d5d74c1c", + "type": "JSON", + "created": "2022-01-14T14:59:14Z", + "last_updated": "2022-01-14T14:59:14Z" + } + }, + "associated_country_codes": ["GBR"] + } + }, + "created": "2022-01-14T14:54:36Z", + "last_updated": "2022-01-14T14:59:14Z", + "generated_profile": { + "media": { + "id": "7c405b5e-348d-4a2c-87ff-787d4fb139c0", + "type": "JSON", + "created": "2022-01-14T14:59:14Z", + "last_updated": "2022-01-14T14:59:14Z" + } + } + } + ] +} \ No newline at end of file diff --git a/test/fixtures/watchlist_screening.json b/test/fixtures/watchlist_screening.json new file mode 100644 index 000000000..3aa3aec5e --- /dev/null +++ b/test/fixtures/watchlist_screening.json @@ -0,0 +1,135 @@ +{ + "client_session_token_ttl": 8785, + "session_id": "d7445779-5e70-4a27-8fec-dd7835106e88", + "state": "COMPLETED", + "resources": { + "id_documents": [ + { + "id": "20deead7-4cb6-4921-a56c-ea10fa0a5595", + "tasks": [ + { + "type": "ID_DOCUMENT_TEXT_DATA_EXTRACTION", + "id": "738e0007-68b8-466a-bd1d-30448b157cd8", + "state": "DONE", + "created": "2021-07-20T15:14:42Z", + "last_updated": "2021-07-20T15:15:53Z", + "generated_checks": [], + "generated_media": [ + { + "id": "cfd85b6d-e78f-4c14-994c-78ad0671312d", + "type": "JSON" + } + ] + } + ], + "source": { + "type": "END_USER" + }, + "document_type": "PASSPORT", + "issuing_country": "GBR", + "pages": [ + { + "capture_method": "UPLOAD", + "media": { + "id": "6b58c356-1e68-4ee2-af54-3264406de92a", + "type": "IMAGE", + "created": "2021-07-20T15:15:52Z", + "last_updated": "2021-07-20T15:15:52Z" + }, + "frames": [{}, {}, {}] + } + ], + "document_fields": { + "media": { + "id": "cfd85b6d-e78f-4c14-994c-78ad0671312d", + "type": "JSON", + "created": "2021-07-20T15:15:53Z", + "last_updated": "2021-07-20T15:15:53Z" + } + }, + "document_id_photo": { + "media": { + "id": "d8f8051e-c5d7-4334-b5af-6b9a07fdb38c", + "type": "IMAGE", + "created": "2021-07-20T15:15:53Z", + "last_updated": "2021-07-20T15:15:53Z" + } + } + } + ], + "supplementary_documents": [], + "liveness_capture": [], + "face_capture": [] + }, + "checks": [ + { + "type": "WATCHLIST_SCREENING", + "id": "8f4a89a1-4614-47ab-9506-2c82352b66d2", + "state": "DONE", + "resources_used": ["20deead7-4cb6-4921-a56c-ea10fa0a5595"], + "generated_media": [ + { + "id": "2f5bbedd-cc1b-4d9f-a424-90bb5ee0fc99", + "type": "JSON" + } + ], + "report": { + "recommendation": { + "value": "APPROVE" + }, + "breakdown": [ + { + "sub_check": "adverse_media", + "result": "PASS", + "details": [] + }, + { + "sub_check": "fitness_probity", + "result": "PASS", + "details": [] + }, + { + "sub_check": "pep", + "result": "PASS", + "details": [] + }, + { + "sub_check": "sanction", + "result": "PASS", + "details": [] + }, + { + "sub_check": "warning", + "result": "PASS", + "details": [] + } + ], + "watchlist_summary": { + "total_hits": 0, + "search_config": { + "categories": ["ADVERSE-MEDIA", "SANCTIONS"] + }, + "raw_results": { + "media": { + "id": "b0fb459c-f573-4205-9847-5ab72301325c", + "type": "JSON", + "created": "2021-07-20T15:15:55Z", + "last_updated": "2021-07-20T15:15:55Z" + } + }, + "associated_country_codes": ["GBR"] + } + }, + "created": "2021-07-20T15:15:54Z", + "last_updated": "2021-07-20T15:15:55Z", + "generated_profile": { + "media": { + "id": "2f5bbedd-cc1b-4d9f-a424-90bb5ee0fc99", + "type": "JSON", + "created": "2021-07-20T15:15:55Z", + "last_updated": "2021-07-20T15:15:55Z" + } + } + } + ] +} \ No newline at end of file diff --git a/yotierror/activitydetails.go b/yotierror/activitydetails.go index 96eb084c4..120816644 100644 --- a/yotierror/activitydetails.go +++ b/yotierror/activitydetails.go @@ -10,5 +10,5 @@ var ( TokenDecryptError = errors.New("unable to decrypt token") // SharingFailureError means that the share between a user and an application was not successful. - SharingFailureError = errors.New("sharing failure") + SharingFailureError = DetailedSharingFailureError{} ) diff --git a/yotierror/sharing_failure_error.go b/yotierror/sharing_failure_error.go new file mode 100644 index 000000000..07dfd11a0 --- /dev/null +++ b/yotierror/sharing_failure_error.go @@ -0,0 +1,10 @@ +package yotierror + +type DetailedSharingFailureError struct { + Code *string + Description *string +} + +func (d DetailedSharingFailureError) Error() string { + return "sharing failure" +} diff --git a/yotiprotoattr/Attribute.pb.go b/yotiprotoattr/Attribute.pb.go index ec015e9b7..b53c64758 100644 --- a/yotiprotoattr/Attribute.pb.go +++ b/yotiprotoattr/Attribute.pb.go @@ -1,291 +1,670 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.18.1 // source: Attribute.proto package yotiprotoattr import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type Attribute struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - ContentType ContentType `protobuf:"varint,3,opt,name=content_type,json=contentType,proto3,enum=attrpubapi_v1.ContentType" json:"content_type,omitempty"` - Anchors []*Anchor `protobuf:"bytes,4,rep,name=anchors,proto3" json:"anchors,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Attribute) Reset() { *m = Attribute{} } -func (m *Attribute) String() string { return proto.CompactTextString(m) } -func (*Attribute) ProtoMessage() {} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + ContentType ContentType `protobuf:"varint,3,opt,name=content_type,json=contentType,proto3,enum=attrpubapi_v1.ContentType" json:"content_type,omitempty"` + Anchors []*Anchor `protobuf:"bytes,4,rep,name=anchors,proto3" json:"anchors,omitempty"` + UserMetadata []*UserMetadata `protobuf:"bytes,5,rep,name=user_metadata,json=userMetadata,proto3" json:"user_metadata,omitempty"` + Metadata *Metadata `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"` + EphemeralId string `protobuf:"bytes,7,opt,name=ephemeral_id,json=ephemeralId,proto3" json:"ephemeral_id,omitempty"` +} + +func (x *Attribute) Reset() { + *x = Attribute{} + if protoimpl.UnsafeEnabled { + mi := &file_Attribute_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Attribute) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Attribute) ProtoMessage() {} + +func (x *Attribute) ProtoReflect() protoreflect.Message { + mi := &file_Attribute_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Attribute.ProtoReflect.Descriptor instead. func (*Attribute) Descriptor() ([]byte, []int) { - return fileDescriptor_44d6ebe2a990cc1d, []int{0} + return file_Attribute_proto_rawDescGZIP(), []int{0} } -func (m *Attribute) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Attribute.Unmarshal(m, b) +func (x *Attribute) GetName() string { + if x != nil { + return x.Name + } + return "" } -func (m *Attribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Attribute.Marshal(b, m, deterministic) + +func (x *Attribute) GetValue() []byte { + if x != nil { + return x.Value + } + return nil } -func (m *Attribute) XXX_Merge(src proto.Message) { - xxx_messageInfo_Attribute.Merge(m, src) + +func (x *Attribute) GetContentType() ContentType { + if x != nil { + return x.ContentType + } + return ContentType_UNDEFINED } -func (m *Attribute) XXX_Size() int { - return xxx_messageInfo_Attribute.Size(m) + +func (x *Attribute) GetAnchors() []*Anchor { + if x != nil { + return x.Anchors + } + return nil } -func (m *Attribute) XXX_DiscardUnknown() { - xxx_messageInfo_Attribute.DiscardUnknown(m) + +func (x *Attribute) GetUserMetadata() []*UserMetadata { + if x != nil { + return x.UserMetadata + } + return nil } -var xxx_messageInfo_Attribute proto.InternalMessageInfo +func (x *Attribute) GetMetadata() *Metadata { + if x != nil { + return x.Metadata + } + return nil +} -func (m *Attribute) GetName() string { - if m != nil { - return m.Name +func (x *Attribute) GetEphemeralId() string { + if x != nil { + return x.EphemeralId } return "" } -func (m *Attribute) GetValue() []byte { - if m != nil { - return m.Value +type Metadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SupersededTimeStamp string `protobuf:"bytes,1,opt,name=superseded_time_stamp,json=supersededTimeStamp,proto3" json:"superseded_time_stamp,omitempty"` + Deletable bool `protobuf:"varint,2,opt,name=deletable,proto3" json:"deletable,omitempty"` + ReceiptId []byte `protobuf:"bytes,3,opt,name=receipt_id,json=receiptId,proto3" json:"receipt_id,omitempty"` + Revoked bool `protobuf:"varint,4,opt,name=revoked,proto3" json:"revoked,omitempty"` + Locked bool `protobuf:"varint,5,opt,name=locked,proto3" json:"locked,omitempty"` +} + +func (x *Metadata) Reset() { + *x = Metadata{} + if protoimpl.UnsafeEnabled { + mi := &file_Attribute_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil } -func (m *Attribute) GetContentType() ContentType { - if m != nil { - return m.ContentType +func (x *Metadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Metadata) ProtoMessage() {} + +func (x *Metadata) ProtoReflect() protoreflect.Message { + mi := &file_Attribute_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return ContentType_UNDEFINED + return mi.MessageOf(x) +} + +// Deprecated: Use Metadata.ProtoReflect.Descriptor instead. +func (*Metadata) Descriptor() ([]byte, []int) { + return file_Attribute_proto_rawDescGZIP(), []int{1} } -func (m *Attribute) GetAnchors() []*Anchor { - if m != nil { - return m.Anchors +func (x *Metadata) GetSupersededTimeStamp() string { + if x != nil { + return x.SupersededTimeStamp } - return nil + return "" } -type Anchor struct { - ArtifactLink []byte `protobuf:"bytes,1,opt,name=artifact_link,json=artifactLink,proto3" json:"artifact_link,omitempty"` - OriginServerCerts [][]byte `protobuf:"bytes,2,rep,name=origin_server_certs,json=originServerCerts,proto3" json:"origin_server_certs,omitempty"` - ArtifactSignature []byte `protobuf:"bytes,3,opt,name=artifact_signature,json=artifactSignature,proto3" json:"artifact_signature,omitempty"` - SubType string `protobuf:"bytes,4,opt,name=sub_type,json=subType,proto3" json:"sub_type,omitempty"` - Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"` - SignedTimeStamp []byte `protobuf:"bytes,6,opt,name=signed_time_stamp,json=signedTimeStamp,proto3" json:"signed_time_stamp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Anchor) Reset() { *m = Anchor{} } -func (m *Anchor) String() string { return proto.CompactTextString(m) } -func (*Anchor) ProtoMessage() {} -func (*Anchor) Descriptor() ([]byte, []int) { - return fileDescriptor_44d6ebe2a990cc1d, []int{1} +func (x *Metadata) GetDeletable() bool { + if x != nil { + return x.Deletable + } + return false } -func (m *Anchor) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Anchor.Unmarshal(m, b) +func (x *Metadata) GetReceiptId() []byte { + if x != nil { + return x.ReceiptId + } + return nil } -func (m *Anchor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Anchor.Marshal(b, m, deterministic) + +func (x *Metadata) GetRevoked() bool { + if x != nil { + return x.Revoked + } + return false } -func (m *Anchor) XXX_Merge(src proto.Message) { - xxx_messageInfo_Anchor.Merge(m, src) + +func (x *Metadata) GetLocked() bool { + if x != nil { + return x.Locked + } + return false } -func (m *Anchor) XXX_Size() int { - return xxx_messageInfo_Anchor.Size(m) + +type Anchor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ArtifactLink []byte `protobuf:"bytes,1,opt,name=artifact_link,json=artifactLink,proto3" json:"artifact_link,omitempty"` + OriginServerCerts [][]byte `protobuf:"bytes,2,rep,name=origin_server_certs,json=originServerCerts,proto3" json:"origin_server_certs,omitempty"` + ArtifactSignature []byte `protobuf:"bytes,3,opt,name=artifact_signature,json=artifactSignature,proto3" json:"artifact_signature,omitempty"` + SubType string `protobuf:"bytes,4,opt,name=sub_type,json=subType,proto3" json:"sub_type,omitempty"` + Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"` + SignedTimeStamp []byte `protobuf:"bytes,6,opt,name=signed_time_stamp,json=signedTimeStamp,proto3" json:"signed_time_stamp,omitempty"` + AssociatedSource string `protobuf:"bytes,7,opt,name=associated_source,json=associatedSource,proto3" json:"associated_source,omitempty"` +} + +func (x *Anchor) Reset() { + *x = Anchor{} + if protoimpl.UnsafeEnabled { + mi := &file_Attribute_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Anchor) XXX_DiscardUnknown() { - xxx_messageInfo_Anchor.DiscardUnknown(m) + +func (x *Anchor) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_Anchor proto.InternalMessageInfo +func (*Anchor) ProtoMessage() {} -func (m *Anchor) GetArtifactLink() []byte { - if m != nil { - return m.ArtifactLink +func (x *Anchor) ProtoReflect() protoreflect.Message { + mi := &file_Attribute_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Anchor.ProtoReflect.Descriptor instead. +func (*Anchor) Descriptor() ([]byte, []int) { + return file_Attribute_proto_rawDescGZIP(), []int{2} +} + +func (x *Anchor) GetArtifactLink() []byte { + if x != nil { + return x.ArtifactLink } return nil } -func (m *Anchor) GetOriginServerCerts() [][]byte { - if m != nil { - return m.OriginServerCerts +func (x *Anchor) GetOriginServerCerts() [][]byte { + if x != nil { + return x.OriginServerCerts } return nil } -func (m *Anchor) GetArtifactSignature() []byte { - if m != nil { - return m.ArtifactSignature +func (x *Anchor) GetArtifactSignature() []byte { + if x != nil { + return x.ArtifactSignature } return nil } -func (m *Anchor) GetSubType() string { - if m != nil { - return m.SubType +func (x *Anchor) GetSubType() string { + if x != nil { + return x.SubType } return "" } -func (m *Anchor) GetSignature() []byte { - if m != nil { - return m.Signature +func (x *Anchor) GetSignature() []byte { + if x != nil { + return x.Signature } return nil } -func (m *Anchor) GetSignedTimeStamp() []byte { - if m != nil { - return m.SignedTimeStamp +func (x *Anchor) GetSignedTimeStamp() []byte { + if x != nil { + return x.SignedTimeStamp } return nil } -type MultiValue struct { - Values []*MultiValue_Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *Anchor) GetAssociatedSource() string { + if x != nil { + return x.AssociatedSource + } + return "" } -func (m *MultiValue) Reset() { *m = MultiValue{} } -func (m *MultiValue) String() string { return proto.CompactTextString(m) } -func (*MultiValue) ProtoMessage() {} -func (*MultiValue) Descriptor() ([]byte, []int) { - return fileDescriptor_44d6ebe2a990cc1d, []int{2} +type UserMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *UserMetadata) Reset() { + *x = UserMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_Attribute_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *MultiValue) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MultiValue.Unmarshal(m, b) +func (x *UserMetadata) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *MultiValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MultiValue.Marshal(b, m, deterministic) + +func (*UserMetadata) ProtoMessage() {} + +func (x *UserMetadata) ProtoReflect() protoreflect.Message { + mi := &file_Attribute_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *MultiValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_MultiValue.Merge(m, src) + +// Deprecated: Use UserMetadata.ProtoReflect.Descriptor instead. +func (*UserMetadata) Descriptor() ([]byte, []int) { + return file_Attribute_proto_rawDescGZIP(), []int{3} } -func (m *MultiValue) XXX_Size() int { - return xxx_messageInfo_MultiValue.Size(m) + +func (x *UserMetadata) GetKey() string { + if x != nil { + return x.Key + } + return "" } -func (m *MultiValue) XXX_DiscardUnknown() { - xxx_messageInfo_MultiValue.DiscardUnknown(m) + +func (x *UserMetadata) GetValue() string { + if x != nil { + return x.Value + } + return "" } -var xxx_messageInfo_MultiValue proto.InternalMessageInfo +type MultiValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Values []*MultiValue_Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` +} -func (m *MultiValue) GetValues() []*MultiValue_Value { - if m != nil { - return m.Values +func (x *MultiValue) Reset() { + *x = MultiValue{} + if protoimpl.UnsafeEnabled { + mi := &file_Attribute_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil } -type MultiValue_Value struct { - ContentType ContentType `protobuf:"varint,1,opt,name=content_type,json=contentType,proto3,enum=attrpubapi_v1.ContentType" json:"content_type,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *MultiValue) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *MultiValue_Value) Reset() { *m = MultiValue_Value{} } -func (m *MultiValue_Value) String() string { return proto.CompactTextString(m) } -func (*MultiValue_Value) ProtoMessage() {} -func (*MultiValue_Value) Descriptor() ([]byte, []int) { - return fileDescriptor_44d6ebe2a990cc1d, []int{2, 0} +func (*MultiValue) ProtoMessage() {} + +func (x *MultiValue) ProtoReflect() protoreflect.Message { + mi := &file_Attribute_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *MultiValue_Value) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MultiValue_Value.Unmarshal(m, b) +// Deprecated: Use MultiValue.ProtoReflect.Descriptor instead. +func (*MultiValue) Descriptor() ([]byte, []int) { + return file_Attribute_proto_rawDescGZIP(), []int{4} } -func (m *MultiValue_Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MultiValue_Value.Marshal(b, m, deterministic) + +func (x *MultiValue) GetValues() []*MultiValue_Value { + if x != nil { + return x.Values + } + return nil +} + +type MultiValue_Value struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ContentType ContentType `protobuf:"varint,1,opt,name=content_type,json=contentType,proto3,enum=attrpubapi_v1.ContentType" json:"content_type,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` } -func (m *MultiValue_Value) XXX_Merge(src proto.Message) { - xxx_messageInfo_MultiValue_Value.Merge(m, src) + +func (x *MultiValue_Value) Reset() { + *x = MultiValue_Value{} + if protoimpl.UnsafeEnabled { + mi := &file_Attribute_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *MultiValue_Value) XXX_Size() int { - return xxx_messageInfo_MultiValue_Value.Size(m) + +func (x *MultiValue_Value) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *MultiValue_Value) XXX_DiscardUnknown() { - xxx_messageInfo_MultiValue_Value.DiscardUnknown(m) + +func (*MultiValue_Value) ProtoMessage() {} + +func (x *MultiValue_Value) ProtoReflect() protoreflect.Message { + mi := &file_Attribute_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_MultiValue_Value proto.InternalMessageInfo +// Deprecated: Use MultiValue_Value.ProtoReflect.Descriptor instead. +func (*MultiValue_Value) Descriptor() ([]byte, []int) { + return file_Attribute_proto_rawDescGZIP(), []int{4, 0} +} -func (m *MultiValue_Value) GetContentType() ContentType { - if m != nil { - return m.ContentType +func (x *MultiValue_Value) GetContentType() ContentType { + if x != nil { + return x.ContentType } return ContentType_UNDEFINED } -func (m *MultiValue_Value) GetData() []byte { - if m != nil { - return m.Data +func (x *MultiValue_Value) GetData() []byte { + if x != nil { + return x.Data } return nil } -func init() { - proto.RegisterType((*Attribute)(nil), "attrpubapi_v1.Attribute") - proto.RegisterType((*Anchor)(nil), "attrpubapi_v1.Anchor") - proto.RegisterType((*MultiValue)(nil), "attrpubapi_v1.MultiValue") - proto.RegisterType((*MultiValue_Value)(nil), "attrpubapi_v1.MultiValue.Value") -} - -func init() { proto.RegisterFile("Attribute.proto", fileDescriptor_44d6ebe2a990cc1d) } - -var fileDescriptor_44d6ebe2a990cc1d = []byte{ - // 437 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0xd6, 0xe6, 0xaf, 0x64, 0xea, 0x50, 0x65, 0x01, 0xc9, 0x44, 0x95, 0xb0, 0x02, 0x07, 0x0b, - 0x89, 0x45, 0x94, 0x03, 0x27, 0x0e, 0x49, 0xaf, 0x20, 0x21, 0xa7, 0xaa, 0x44, 0x2f, 0xd6, 0xda, - 0xdd, 0xb6, 0xab, 0xda, 0x6b, 0x6b, 0x77, 0x36, 0x52, 0x1e, 0x87, 0x03, 0x17, 0x1e, 0x85, 0xb7, - 0xe1, 0x0d, 0x90, 0xc7, 0x71, 0x0c, 0x15, 0x17, 0x2e, 0xd6, 0xcc, 0xf7, 0x7d, 0x33, 0xe3, 0xf9, - 0x76, 0xe0, 0x64, 0x85, 0x68, 0x75, 0xe6, 0x51, 0x89, 0xda, 0x56, 0x58, 0xf1, 0x99, 0x44, 0xb4, - 0xb5, 0xcf, 0x64, 0xad, 0xd3, 0xed, 0xbb, 0xc5, 0xfc, 0xbc, 0x32, 0xa8, 0x0c, 0x5e, 0xec, 0xea, - 0xbd, 0x62, 0xf9, 0x9d, 0xc1, 0xf4, 0x50, 0xc5, 0x39, 0x8c, 0x8c, 0x2c, 0x55, 0xc8, 0x22, 0x16, - 0x4f, 0x13, 0x8a, 0xf9, 0x53, 0x18, 0x6f, 0x65, 0xe1, 0x55, 0x38, 0x88, 0x58, 0x1c, 0x24, 0x6d, - 0xc2, 0x3f, 0x42, 0x90, 0xb7, 0xcd, 0x52, 0xdc, 0xd5, 0x2a, 0x1c, 0x46, 0x2c, 0x7e, 0x7c, 0xb6, - 0x10, 0x7f, 0x0d, 0x14, 0x7f, 0xcc, 0x4b, 0x8e, 0xf3, 0x3e, 0xe1, 0x6f, 0xe1, 0x48, 0x9a, 0xfc, - 0xae, 0xb2, 0x2e, 0x1c, 0x45, 0xc3, 0xf8, 0xf8, 0xec, 0xd9, 0x83, 0xca, 0x15, 0xb1, 0x49, 0xa7, - 0x5a, 0xfe, 0x62, 0x30, 0x69, 0x31, 0xfe, 0x12, 0x66, 0xd2, 0xa2, 0xbe, 0x91, 0x39, 0xa6, 0x85, - 0x36, 0xf7, 0xf4, 0xb7, 0x41, 0x12, 0x74, 0xe0, 0x27, 0x6d, 0xee, 0xb9, 0x80, 0x27, 0x95, 0xd5, - 0xb7, 0xda, 0xa4, 0x4e, 0xd9, 0xad, 0xb2, 0x69, 0xae, 0x2c, 0xba, 0x70, 0x10, 0x0d, 0xe3, 0x20, - 0x99, 0xb7, 0xd4, 0x86, 0x98, 0xf3, 0x86, 0xe0, 0x6f, 0x80, 0x1f, 0x9a, 0x3a, 0x7d, 0x6b, 0x24, - 0x7a, 0xdb, 0x6e, 0x15, 0x24, 0xf3, 0x8e, 0xd9, 0x74, 0x04, 0x7f, 0x0e, 0x8f, 0x9c, 0xcf, 0xda, - 0xd5, 0x47, 0x64, 0xd6, 0x91, 0xf3, 0x19, 0xad, 0x76, 0x0a, 0xd3, 0xbe, 0xc1, 0x98, 0x1a, 0xf4, - 0x00, 0x7f, 0x0d, 0xf3, 0x26, 0x51, 0xd7, 0x29, 0xea, 0x52, 0xa5, 0x0e, 0x65, 0x59, 0x87, 0x13, - 0x52, 0x9d, 0xb4, 0xc4, 0x85, 0x2e, 0xd5, 0xa6, 0x81, 0x97, 0xdf, 0x18, 0xc0, 0x67, 0x5f, 0xa0, - 0xbe, 0x24, 0xcb, 0x3f, 0xc0, 0x84, 0xbc, 0x77, 0x21, 0x23, 0xcb, 0x5e, 0x3c, 0xb0, 0xac, 0x97, - 0x0a, 0xfa, 0x26, 0x7b, 0xf9, 0xe2, 0x0a, 0xc6, 0x97, 0xff, 0x7c, 0x34, 0xf6, 0x7f, 0x8f, 0xc6, - 0x61, 0x74, 0x2d, 0x51, 0xee, 0x0f, 0x81, 0xe2, 0x75, 0x01, 0xaf, 0xf2, 0xaa, 0x14, 0xbb, 0x0a, - 0xb5, 0x90, 0xb5, 0x16, 0x79, 0xa1, 0x95, 0x41, 0xe1, 0x6a, 0x2d, 0xac, 0x2a, 0xab, 0xee, 0x12, - 0xd7, 0x74, 0x64, 0x5f, 0x9a, 0xf0, 0x6a, 0xd6, 0x88, 0x09, 0x6d, 0xe6, 0xfe, 0x18, 0x9c, 0x7e, - 0x6d, 0x8a, 0x57, 0x1e, 0xef, 0x04, 0x09, 0xd6, 0xfe, 0x46, 0x1c, 0x4e, 0xf2, 0xe7, 0x00, 0x56, - 0x87, 0xbf, 0xcb, 0x26, 0x54, 0xf6, 0xfe, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x86, 0x08, 0x8c, - 0x4b, 0xe9, 0x02, 0x00, 0x00, +var File_Attribute_proto protoreflect.FileDescriptor + +var file_Attribute_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0d, 0x61, 0x74, 0x74, 0x72, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, + 0x1a, 0x11, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xbf, 0x02, 0x0a, 0x09, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x1a, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5f, 0x76, + 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x61, 0x6e, + 0x63, 0x68, 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x74, + 0x74, 0x72, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, 0x2e, 0x41, 0x6e, 0x63, 0x68, + 0x6f, 0x72, 0x52, 0x07, 0x61, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x73, 0x12, 0x40, 0x0a, 0x0d, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5f, + 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, + 0x0c, 0x75, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x33, 0x0a, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, 0x2e, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x70, 0x68, 0x65, 0x6d, 0x65, 0x72, 0x61, 0x6c, 0x5f, + 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x70, 0x68, 0x65, 0x6d, 0x65, + 0x72, 0x61, 0x6c, 0x49, 0x64, 0x22, 0xad, 0x01, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x32, 0x0a, 0x15, 0x73, 0x75, 0x70, 0x65, 0x72, 0x73, 0x65, 0x64, 0x65, 0x64, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x13, 0x73, 0x75, 0x70, 0x65, 0x72, 0x73, 0x65, 0x64, 0x65, 0x64, 0x54, 0x69, 0x6d, + 0x65, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, + 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x12, 0x16, 0x0a, + 0x06, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6c, + 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x22, 0x9e, 0x02, 0x0a, 0x06, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, + 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x5f, 0x6c, 0x69, 0x6e, + 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, + 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x2e, 0x0a, 0x13, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0c, 0x52, 0x11, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x43, 0x65, 0x72, 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, + 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x11, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x75, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x2a, 0x0a, + 0x11, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x54, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x73, 0x73, + 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, + 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x36, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xa1, + 0x01, 0x0a, 0x0a, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x37, 0x0a, + 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x61, 0x74, 0x74, 0x72, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, 0x2e, 0x4d, 0x75, + 0x6c, 0x74, 0x69, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x1a, 0x5a, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x3d, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x70, 0x75, 0x62, 0x61, + 0x70, 0x69, 0x5f, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x42, 0xe0, 0x01, 0x0a, 0x24, 0x63, 0x6f, 0x6d, 0x2e, 0x79, 0x6f, 0x74, 0x69, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x69, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x09, 0x41, 0x74, 0x74, + 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x67, 0x65, 0x74, 0x79, 0x6f, 0x74, 0x69, 0x2f, 0x79, 0x6f, 0x74, 0x69, 0x2d, + 0x67, 0x6f, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x33, 0x2f, 0x79, 0x6f, 0x74, 0x69, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x61, 0x74, 0x74, 0x72, 0xaa, 0x02, 0x1c, 0x59, 0x6f, 0x74, 0x69, 0x2e, 0x41, + 0x75, 0x74, 0x68, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0xca, 0x02, 0x18, 0x59, 0x6f, 0x74, 0x69, 0x5c, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5c, 0x41, 0x74, 0x74, 0x72, 0x70, 0x75, 0x62, 0x61, 0x70, + 0x69, 0xe2, 0x02, 0x24, 0x59, 0x6f, 0x74, 0x69, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x5c, 0x41, 0x74, 0x74, 0x72, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x59, 0x6f, 0x74, 0x69, 0x3a, + 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x74, 0x74, 0x72, 0x70, + 0x75, 0x62, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_Attribute_proto_rawDescOnce sync.Once + file_Attribute_proto_rawDescData = file_Attribute_proto_rawDesc +) + +func file_Attribute_proto_rawDescGZIP() []byte { + file_Attribute_proto_rawDescOnce.Do(func() { + file_Attribute_proto_rawDescData = protoimpl.X.CompressGZIP(file_Attribute_proto_rawDescData) + }) + return file_Attribute_proto_rawDescData +} + +var file_Attribute_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_Attribute_proto_goTypes = []interface{}{ + (*Attribute)(nil), // 0: attrpubapi_v1.Attribute + (*Metadata)(nil), // 1: attrpubapi_v1.Metadata + (*Anchor)(nil), // 2: attrpubapi_v1.Anchor + (*UserMetadata)(nil), // 3: attrpubapi_v1.UserMetadata + (*MultiValue)(nil), // 4: attrpubapi_v1.MultiValue + (*MultiValue_Value)(nil), // 5: attrpubapi_v1.MultiValue.Value + (ContentType)(0), // 6: attrpubapi_v1.ContentType +} +var file_Attribute_proto_depIdxs = []int32{ + 6, // 0: attrpubapi_v1.Attribute.content_type:type_name -> attrpubapi_v1.ContentType + 2, // 1: attrpubapi_v1.Attribute.anchors:type_name -> attrpubapi_v1.Anchor + 3, // 2: attrpubapi_v1.Attribute.user_metadata:type_name -> attrpubapi_v1.UserMetadata + 1, // 3: attrpubapi_v1.Attribute.metadata:type_name -> attrpubapi_v1.Metadata + 5, // 4: attrpubapi_v1.MultiValue.values:type_name -> attrpubapi_v1.MultiValue.Value + 6, // 5: attrpubapi_v1.MultiValue.Value.content_type:type_name -> attrpubapi_v1.ContentType + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_Attribute_proto_init() } +func file_Attribute_proto_init() { + if File_Attribute_proto != nil { + return + } + file_ContentType_proto_init() + if !protoimpl.UnsafeEnabled { + file_Attribute_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Attribute); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Attribute_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Metadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Attribute_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Anchor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Attribute_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Attribute_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MultiValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Attribute_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MultiValue_Value); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_Attribute_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_Attribute_proto_goTypes, + DependencyIndexes: file_Attribute_proto_depIdxs, + MessageInfos: file_Attribute_proto_msgTypes, + }.Build() + File_Attribute_proto = out.File + file_Attribute_proto_rawDesc = nil + file_Attribute_proto_goTypes = nil + file_Attribute_proto_depIdxs = nil } diff --git a/yotiprotoattr/ContentType.pb.go b/yotiprotoattr/ContentType.pb.go index 2ea80899a..2fbf1e94b 100644 --- a/yotiprotoattr/ContentType.pb.go +++ b/yotiprotoattr/ContentType.pb.go @@ -1,25 +1,25 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.18.1 // source: ContentType.proto package yotiprotoattr import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type ContentType int32 @@ -34,57 +34,131 @@ const ( ContentType_INT ContentType = 7 ) -var ContentType_name = map[int32]string{ - 0: "UNDEFINED", - 1: "STRING", - 2: "JPEG", - 3: "DATE", - 4: "PNG", - 5: "JSON", - 6: "MULTI_VALUE", - 7: "INT", -} +// Enum value maps for ContentType. +var ( + ContentType_name = map[int32]string{ + 0: "UNDEFINED", + 1: "STRING", + 2: "JPEG", + 3: "DATE", + 4: "PNG", + 5: "JSON", + 6: "MULTI_VALUE", + 7: "INT", + } + ContentType_value = map[string]int32{ + "UNDEFINED": 0, + "STRING": 1, + "JPEG": 2, + "DATE": 3, + "PNG": 4, + "JSON": 5, + "MULTI_VALUE": 6, + "INT": 7, + } +) -var ContentType_value = map[string]int32{ - "UNDEFINED": 0, - "STRING": 1, - "JPEG": 2, - "DATE": 3, - "PNG": 4, - "JSON": 5, - "MULTI_VALUE": 6, - "INT": 7, +func (x ContentType) Enum() *ContentType { + p := new(ContentType) + *p = x + return p } func (x ContentType) String() string { - return proto.EnumName(ContentType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } +func (ContentType) Descriptor() protoreflect.EnumDescriptor { + return file_ContentType_proto_enumTypes[0].Descriptor() +} + +func (ContentType) Type() protoreflect.EnumType { + return &file_ContentType_proto_enumTypes[0] +} + +func (x ContentType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ContentType.Descriptor instead. func (ContentType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_a1a2245e60e73166, []int{0} + return file_ContentType_proto_rawDescGZIP(), []int{0} } -func init() { - proto.RegisterEnum("attrpubapi_v1.ContentType", ContentType_name, ContentType_value) +var File_ContentType_proto protoreflect.FileDescriptor + +var file_ContentType_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x61, 0x74, 0x74, 0x72, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5f, + 0x76, 0x31, 0x2a, 0x69, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, + 0x4a, 0x50, 0x45, 0x47, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x41, 0x54, 0x45, 0x10, 0x03, + 0x12, 0x07, 0x0a, 0x03, 0x50, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x08, 0x0a, 0x04, 0x4a, 0x53, 0x4f, + 0x4e, 0x10, 0x05, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x55, 0x4c, 0x54, 0x49, 0x5f, 0x56, 0x41, 0x4c, + 0x55, 0x45, 0x10, 0x06, 0x12, 0x07, 0x0a, 0x03, 0x49, 0x4e, 0x54, 0x10, 0x07, 0x42, 0xe7, 0x01, + 0x0a, 0x24, 0x63, 0x6f, 0x6d, 0x2e, 0x79, 0x6f, 0x74, 0x69, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x10, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x65, 0x74, 0x79, 0x6f, 0x74, 0x69, 0x2f, 0x79, 0x6f, 0x74, + 0x69, 0x2d, 0x67, 0x6f, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x33, 0x2f, 0x79, 0x6f, 0x74, 0x69, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x61, 0x74, 0x74, 0x72, 0xaa, 0x02, 0x1c, 0x59, 0x6f, 0x74, 0x69, + 0x2e, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x75, 0x66, 0x2e, 0x41, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0xca, 0x02, 0x18, 0x59, 0x6f, 0x74, 0x69, 0x5c, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5c, 0x41, 0x74, 0x74, 0x72, 0x70, 0x75, 0x62, + 0x61, 0x70, 0x69, 0xe2, 0x02, 0x24, 0x59, 0x6f, 0x74, 0x69, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x5c, 0x41, 0x74, 0x74, 0x72, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x59, 0x6f, 0x74, + 0x69, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x74, 0x74, + 0x72, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_ContentType_proto_rawDescOnce sync.Once + file_ContentType_proto_rawDescData = file_ContentType_proto_rawDesc +) + +func file_ContentType_proto_rawDescGZIP() []byte { + file_ContentType_proto_rawDescOnce.Do(func() { + file_ContentType_proto_rawDescData = protoimpl.X.CompressGZIP(file_ContentType_proto_rawDescData) + }) + return file_ContentType_proto_rawDescData +} + +var file_ContentType_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_ContentType_proto_goTypes = []interface{}{ + (ContentType)(0), // 0: attrpubapi_v1.ContentType +} +var file_ContentType_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } -func init() { proto.RegisterFile("ContentType.proto", fileDescriptor_a1a2245e60e73166) } - -var fileDescriptor_a1a2245e60e73166 = []byte{ - // 234 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x8f, 0xc1, 0x4a, 0xc4, 0x30, - 0x10, 0x86, 0xb5, 0xbb, 0x76, 0x75, 0x96, 0xe2, 0x98, 0xb3, 0x47, 0x4f, 0x1e, 0x02, 0xe2, 0x13, - 0xa4, 0x36, 0x96, 0xca, 0x1a, 0x8b, 0x9b, 0x0a, 0x7a, 0x59, 0xda, 0x25, 0x62, 0xc0, 0x6d, 0x42, - 0x77, 0x2a, 0xec, 0x2b, 0xf9, 0x28, 0x3e, 0x95, 0x24, 0x88, 0xf4, 0x36, 0xcc, 0xff, 0xfd, 0xc3, - 0x37, 0x70, 0x71, 0xe7, 0x7a, 0x32, 0x3d, 0xe9, 0x83, 0x37, 0xdc, 0x0f, 0x8e, 0x1c, 0xcb, 0x5a, - 0xa2, 0xc1, 0x8f, 0x5d, 0xeb, 0xed, 0xe6, 0xeb, 0xe6, 0xda, 0xc2, 0x72, 0xc2, 0xb0, 0x0c, 0xce, - 0x1a, 0x55, 0xc8, 0xfb, 0x4a, 0xc9, 0x02, 0x8f, 0x18, 0x40, 0xba, 0xd6, 0xcf, 0x95, 0x2a, 0xf1, - 0x98, 0x9d, 0xc2, 0xfc, 0xa1, 0x96, 0x25, 0x26, 0x61, 0x2a, 0x84, 0x96, 0x38, 0x63, 0x0b, 0x98, - 0xd5, 0xaa, 0xc4, 0x79, 0x0c, 0xd7, 0x4f, 0x0a, 0x4f, 0xd8, 0x39, 0x2c, 0x1f, 0x9b, 0x95, 0xae, - 0x36, 0x2f, 0x62, 0xd5, 0x48, 0x4c, 0x03, 0x53, 0x29, 0x8d, 0x8b, 0x7c, 0x0f, 0x57, 0x5b, 0xb7, - 0xe3, 0x07, 0x47, 0x96, 0xb7, 0xde, 0xf2, 0xed, 0xa7, 0x35, 0x3d, 0xf1, 0xbd, 0xb7, 0x7c, 0x30, - 0x3b, 0x47, 0x7f, 0x86, 0x39, 0x4e, 0x84, 0xea, 0xb0, 0x79, 0xcb, 0x42, 0x27, 0x86, 0x41, 0xfe, - 0x3b, 0xb9, 0x7c, 0x0d, 0x37, 0xc4, 0x48, 0x1f, 0x3c, 0x02, 0xf9, 0xf8, 0xce, 0x05, 0xd1, 0x60, - 0xbb, 0x91, 0xcc, 0x4f, 0x02, 0xe2, 0xff, 0xc5, 0x2e, 0x8d, 0xb5, 0xdb, 0xdf, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x8c, 0x71, 0x1c, 0x8f, 0x0a, 0x01, 0x00, 0x00, +func init() { file_ContentType_proto_init() } +func file_ContentType_proto_init() { + if File_ContentType_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ContentType_proto_rawDesc, + NumEnums: 1, + NumMessages: 0, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ContentType_proto_goTypes, + DependencyIndexes: file_ContentType_proto_depIdxs, + EnumInfos: file_ContentType_proto_enumTypes, + }.Build() + File_ContentType_proto = out.File + file_ContentType_proto_rawDesc = nil + file_ContentType_proto_goTypes = nil + file_ContentType_proto_depIdxs = nil } diff --git a/yotiprotoattr/List.pb.go b/yotiprotoattr/List.pb.go index e62b304d6..ec77e02a6 100644 --- a/yotiprotoattr/List.pb.go +++ b/yotiprotoattr/List.pb.go @@ -1,176 +1,306 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.18.1 // source: List.proto package yotiprotoattr import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type AttributeAndId struct { - Attribute *Attribute `protobuf:"bytes,1,opt,name=attribute,proto3" json:"attribute,omitempty"` - AttributeId []byte `protobuf:"bytes,2,opt,name=attribute_id,json=attributeId,proto3" json:"attribute_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *AttributeAndId) Reset() { *m = AttributeAndId{} } -func (m *AttributeAndId) String() string { return proto.CompactTextString(m) } -func (*AttributeAndId) ProtoMessage() {} -func (*AttributeAndId) Descriptor() ([]byte, []int) { - return fileDescriptor_e23ec92774814a82, []int{0} + Attribute *Attribute `protobuf:"bytes,1,opt,name=attribute,proto3" json:"attribute,omitempty"` + AttributeId []byte `protobuf:"bytes,2,opt,name=attribute_id,json=attributeId,proto3" json:"attribute_id,omitempty"` } -func (m *AttributeAndId) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AttributeAndId.Unmarshal(m, b) -} -func (m *AttributeAndId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AttributeAndId.Marshal(b, m, deterministic) -} -func (m *AttributeAndId) XXX_Merge(src proto.Message) { - xxx_messageInfo_AttributeAndId.Merge(m, src) +func (x *AttributeAndId) Reset() { + *x = AttributeAndId{} + if protoimpl.UnsafeEnabled { + mi := &file_List_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *AttributeAndId) XXX_Size() int { - return xxx_messageInfo_AttributeAndId.Size(m) + +func (x *AttributeAndId) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *AttributeAndId) XXX_DiscardUnknown() { - xxx_messageInfo_AttributeAndId.DiscardUnknown(m) + +func (*AttributeAndId) ProtoMessage() {} + +func (x *AttributeAndId) ProtoReflect() protoreflect.Message { + mi := &file_List_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_AttributeAndId proto.InternalMessageInfo +// Deprecated: Use AttributeAndId.ProtoReflect.Descriptor instead. +func (*AttributeAndId) Descriptor() ([]byte, []int) { + return file_List_proto_rawDescGZIP(), []int{0} +} -func (m *AttributeAndId) GetAttribute() *Attribute { - if m != nil { - return m.Attribute +func (x *AttributeAndId) GetAttribute() *Attribute { + if x != nil { + return x.Attribute } return nil } -func (m *AttributeAndId) GetAttributeId() []byte { - if m != nil { - return m.AttributeId +func (x *AttributeAndId) GetAttributeId() []byte { + if x != nil { + return x.AttributeId } return nil } type AttributeAndIdList struct { - AttributeAndIdList []*AttributeAndId `protobuf:"bytes,1,rep,name=attribute_and_id_list,json=attributeAndIdList,proto3" json:"attribute_and_id_list,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *AttributeAndIdList) Reset() { *m = AttributeAndIdList{} } -func (m *AttributeAndIdList) String() string { return proto.CompactTextString(m) } -func (*AttributeAndIdList) ProtoMessage() {} -func (*AttributeAndIdList) Descriptor() ([]byte, []int) { - return fileDescriptor_e23ec92774814a82, []int{1} + AttributeAndIdList []*AttributeAndId `protobuf:"bytes,1,rep,name=attribute_and_id_list,json=attributeAndIdList,proto3" json:"attribute_and_id_list,omitempty"` } -func (m *AttributeAndIdList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AttributeAndIdList.Unmarshal(m, b) -} -func (m *AttributeAndIdList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AttributeAndIdList.Marshal(b, m, deterministic) -} -func (m *AttributeAndIdList) XXX_Merge(src proto.Message) { - xxx_messageInfo_AttributeAndIdList.Merge(m, src) +func (x *AttributeAndIdList) Reset() { + *x = AttributeAndIdList{} + if protoimpl.UnsafeEnabled { + mi := &file_List_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *AttributeAndIdList) XXX_Size() int { - return xxx_messageInfo_AttributeAndIdList.Size(m) + +func (x *AttributeAndIdList) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *AttributeAndIdList) XXX_DiscardUnknown() { - xxx_messageInfo_AttributeAndIdList.DiscardUnknown(m) + +func (*AttributeAndIdList) ProtoMessage() {} + +func (x *AttributeAndIdList) ProtoReflect() protoreflect.Message { + mi := &file_List_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_AttributeAndIdList proto.InternalMessageInfo +// Deprecated: Use AttributeAndIdList.ProtoReflect.Descriptor instead. +func (*AttributeAndIdList) Descriptor() ([]byte, []int) { + return file_List_proto_rawDescGZIP(), []int{1} +} -func (m *AttributeAndIdList) GetAttributeAndIdList() []*AttributeAndId { - if m != nil { - return m.AttributeAndIdList +func (x *AttributeAndIdList) GetAttributeAndIdList() []*AttributeAndId { + if x != nil { + return x.AttributeAndIdList } return nil } type AttributeList struct { - Attributes []*Attribute `protobuf:"bytes,1,rep,name=attributes,proto3" json:"attributes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Attributes []*Attribute `protobuf:"bytes,1,rep,name=attributes,proto3" json:"attributes,omitempty"` } -func (m *AttributeList) Reset() { *m = AttributeList{} } -func (m *AttributeList) String() string { return proto.CompactTextString(m) } -func (*AttributeList) ProtoMessage() {} -func (*AttributeList) Descriptor() ([]byte, []int) { - return fileDescriptor_e23ec92774814a82, []int{2} +func (x *AttributeList) Reset() { + *x = AttributeList{} + if protoimpl.UnsafeEnabled { + mi := &file_List_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *AttributeList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AttributeList.Unmarshal(m, b) +func (x *AttributeList) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *AttributeList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AttributeList.Marshal(b, m, deterministic) + +func (*AttributeList) ProtoMessage() {} + +func (x *AttributeList) ProtoReflect() protoreflect.Message { + mi := &file_List_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *AttributeList) XXX_Merge(src proto.Message) { - xxx_messageInfo_AttributeList.Merge(m, src) + +// Deprecated: Use AttributeList.ProtoReflect.Descriptor instead. +func (*AttributeList) Descriptor() ([]byte, []int) { + return file_List_proto_rawDescGZIP(), []int{2} } -func (m *AttributeList) XXX_Size() int { - return xxx_messageInfo_AttributeList.Size(m) + +func (x *AttributeList) GetAttributes() []*Attribute { + if x != nil { + return x.Attributes + } + return nil } -func (m *AttributeList) XXX_DiscardUnknown() { - xxx_messageInfo_AttributeList.DiscardUnknown(m) + +var File_List_proto protoreflect.FileDescriptor + +var file_List_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x61, 0x74, + 0x74, 0x72, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, 0x1a, 0x0f, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6b, 0x0a, 0x0e, + 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x41, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x36, + 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5f, 0x76, + 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x09, 0x61, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x49, 0x64, 0x22, 0x66, 0x0a, 0x12, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x41, 0x6e, 0x64, 0x49, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x50, 0x0a, 0x15, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x5f, 0x61, 0x6e, 0x64, + 0x5f, 0x69, 0x64, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x61, 0x74, 0x74, 0x72, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, 0x2e, 0x41, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x41, 0x6e, 0x64, 0x49, 0x64, 0x52, 0x12, 0x61, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x41, 0x6e, 0x64, 0x49, 0x64, 0x4c, 0x69, 0x73, + 0x74, 0x22, 0x49, 0x0a, 0x0d, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x70, 0x75, 0x62, + 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x42, 0xe9, 0x01, 0x0a, + 0x24, 0x63, 0x6f, 0x6d, 0x2e, 0x79, 0x6f, 0x74, 0x69, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x12, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x65, 0x74, 0x79, 0x6f, 0x74, 0x69, 0x2f, 0x79, 0x6f, + 0x74, 0x69, 0x2d, 0x67, 0x6f, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x33, 0x2f, 0x79, 0x6f, 0x74, + 0x69, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x61, 0x74, 0x74, 0x72, 0xaa, 0x02, 0x1c, 0x59, 0x6f, 0x74, + 0x69, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x75, 0x66, 0x2e, + 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0xca, 0x02, 0x18, 0x59, 0x6f, 0x74, 0x69, + 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5c, 0x41, 0x74, 0x74, 0x72, 0x70, 0x75, + 0x62, 0x61, 0x70, 0x69, 0xe2, 0x02, 0x24, 0x59, 0x6f, 0x74, 0x69, 0x5c, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x5c, 0x41, 0x74, 0x74, 0x72, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x59, 0x6f, + 0x74, 0x69, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x74, + 0x74, 0x72, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var xxx_messageInfo_AttributeList proto.InternalMessageInfo +var ( + file_List_proto_rawDescOnce sync.Once + file_List_proto_rawDescData = file_List_proto_rawDesc +) -func (m *AttributeList) GetAttributes() []*Attribute { - if m != nil { - return m.Attributes - } - return nil +func file_List_proto_rawDescGZIP() []byte { + file_List_proto_rawDescOnce.Do(func() { + file_List_proto_rawDescData = protoimpl.X.CompressGZIP(file_List_proto_rawDescData) + }) + return file_List_proto_rawDescData } -func init() { - proto.RegisterType((*AttributeAndId)(nil), "attrpubapi_v1.AttributeAndId") - proto.RegisterType((*AttributeAndIdList)(nil), "attrpubapi_v1.AttributeAndIdList") - proto.RegisterType((*AttributeList)(nil), "attrpubapi_v1.AttributeList") -} - -func init() { proto.RegisterFile("List.proto", fileDescriptor_e23ec92774814a82) } - -var fileDescriptor_e23ec92774814a82 = []byte{ - // 260 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0x41, 0x4b, 0xc4, 0x30, - 0x10, 0x85, 0x69, 0x05, 0xc1, 0xe9, 0x56, 0x21, 0x20, 0x14, 0x51, 0xa8, 0xc5, 0x43, 0x4f, 0x01, - 0x57, 0x10, 0xaf, 0xed, 0xad, 0xe0, 0x61, 0xe9, 0x4d, 0x2f, 0x25, 0xdd, 0x74, 0x71, 0x70, 0xb7, - 0x09, 0xed, 0x44, 0xf0, 0x2f, 0xf9, 0x53, 0xfc, 0x55, 0x92, 0xe8, 0xa6, 0x96, 0x65, 0x8f, 0x79, - 0xf3, 0xde, 0xf7, 0x26, 0x03, 0xf0, 0x8c, 0x23, 0x71, 0x3d, 0x28, 0x52, 0x2c, 0x16, 0x44, 0x83, - 0x36, 0xad, 0xd0, 0xd8, 0x7c, 0xdc, 0x5f, 0x5d, 0x14, 0x44, 0x03, 0xb6, 0x86, 0xba, 0xdf, 0x79, - 0xf6, 0x0e, 0xe7, 0x5e, 0x2a, 0x7a, 0x59, 0x49, 0xf6, 0x08, 0x67, 0x62, 0xaf, 0x24, 0x41, 0x1a, - 0xe4, 0xd1, 0x32, 0xe1, 0x33, 0x0a, 0xf7, 0x89, 0x7a, 0xb2, 0xb2, 0x5b, 0x58, 0xf8, 0x47, 0x83, - 0x32, 0x09, 0xd3, 0x20, 0x5f, 0xd4, 0x91, 0xd7, 0x2a, 0x99, 0x6d, 0x80, 0xcd, 0xcb, 0xec, 0xa2, - 0x6c, 0x05, 0x97, 0x53, 0x50, 0xf4, 0xb2, 0x41, 0xd9, 0x6c, 0x71, 0xa4, 0x24, 0x48, 0x4f, 0xf2, - 0x68, 0x79, 0x73, 0xac, 0xdc, 0x11, 0x6a, 0x26, 0x0e, 0x88, 0x59, 0x05, 0xb1, 0x77, 0xb9, 0x8a, - 0x27, 0x00, 0x6f, 0x1b, 0xff, 0xb8, 0xc7, 0x3f, 0xf5, 0xcf, 0x5b, 0x1a, 0xb8, 0x5b, 0xab, 0x1d, - 0xff, 0x54, 0x84, 0x5c, 0x68, 0xe4, 0xeb, 0x2d, 0x76, 0x3d, 0xf1, 0x51, 0x23, 0x1f, 0xba, 0x9d, - 0xda, 0xdf, 0xb1, 0x64, 0xb3, 0xc2, 0x95, 0xd5, 0x5e, 0x63, 0x9b, 0x72, 0x63, 0x0b, 0xfc, 0x0a, - 0xaf, 0x5f, 0x2c, 0xa5, 0x30, 0xf4, 0xc6, 0x9d, 0xa1, 0x34, 0x9b, 0xa9, 0xf5, 0x3b, 0x84, 0xc2, - 0xef, 0xd3, 0x9e, 0xba, 0xd8, 0xc3, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x06, 0xde, 0xc6, 0x46, - 0xcb, 0x01, 0x00, 0x00, +var file_List_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_List_proto_goTypes = []interface{}{ + (*AttributeAndId)(nil), // 0: attrpubapi_v1.AttributeAndId + (*AttributeAndIdList)(nil), // 1: attrpubapi_v1.AttributeAndIdList + (*AttributeList)(nil), // 2: attrpubapi_v1.AttributeList + (*Attribute)(nil), // 3: attrpubapi_v1.Attribute +} +var file_List_proto_depIdxs = []int32{ + 3, // 0: attrpubapi_v1.AttributeAndId.attribute:type_name -> attrpubapi_v1.Attribute + 0, // 1: attrpubapi_v1.AttributeAndIdList.attribute_and_id_list:type_name -> attrpubapi_v1.AttributeAndId + 3, // 2: attrpubapi_v1.AttributeList.attributes:type_name -> attrpubapi_v1.Attribute + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_List_proto_init() } +func file_List_proto_init() { + if File_List_proto != nil { + return + } + file_Attribute_proto_init() + if !protoimpl.UnsafeEnabled { + file_List_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AttributeAndId); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_List_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AttributeAndIdList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_List_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AttributeList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_List_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_List_proto_goTypes, + DependencyIndexes: file_List_proto_depIdxs, + MessageInfos: file_List_proto_msgTypes, + }.Build() + File_List_proto = out.File + file_List_proto_rawDesc = nil + file_List_proto_goTypes = nil + file_List_proto_depIdxs = nil } diff --git a/yotiprotoattr/Signing.pb.go b/yotiprotoattr/Signing.pb.go index 6128c22a4..91e86091c 100644 --- a/yotiprotoattr/Signing.pb.go +++ b/yotiprotoattr/Signing.pb.go @@ -1,130 +1,224 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.18.1 // source: Signing.proto package yotiprotoattr import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type AttributeSigning struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - ContentType ContentType `protobuf:"varint,3,opt,name=content_type,json=contentType,proto3,enum=attrpubapi_v1.ContentType" json:"content_type,omitempty"` - ArtifactSignature []byte `protobuf:"bytes,4,opt,name=artifact_signature,json=artifactSignature,proto3" json:"artifact_signature,omitempty"` - SubType string `protobuf:"bytes,5,opt,name=sub_type,json=subType,proto3" json:"sub_type,omitempty"` - SignedTimeStamp []byte `protobuf:"bytes,6,opt,name=signed_time_stamp,json=signedTimeStamp,proto3" json:"signed_time_stamp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AttributeSigning) Reset() { *m = AttributeSigning{} } -func (m *AttributeSigning) String() string { return proto.CompactTextString(m) } -func (*AttributeSigning) ProtoMessage() {} -func (*AttributeSigning) Descriptor() ([]byte, []int) { - return fileDescriptor_c19542824c3e34e0, []int{0} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + ContentType ContentType `protobuf:"varint,3,opt,name=content_type,json=contentType,proto3,enum=attrpubapi_v1.ContentType" json:"content_type,omitempty"` + ArtifactSignature []byte `protobuf:"bytes,4,opt,name=artifact_signature,json=artifactSignature,proto3" json:"artifact_signature,omitempty"` + SubType string `protobuf:"bytes,5,opt,name=sub_type,json=subType,proto3" json:"sub_type,omitempty"` + SignedTimeStamp []byte `protobuf:"bytes,6,opt,name=signed_time_stamp,json=signedTimeStamp,proto3" json:"signed_time_stamp,omitempty"` + AssociatedSource string `protobuf:"bytes,7,opt,name=associated_source,json=associatedSource,proto3" json:"associated_source,omitempty"` } -func (m *AttributeSigning) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AttributeSigning.Unmarshal(m, b) -} -func (m *AttributeSigning) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AttributeSigning.Marshal(b, m, deterministic) -} -func (m *AttributeSigning) XXX_Merge(src proto.Message) { - xxx_messageInfo_AttributeSigning.Merge(m, src) +func (x *AttributeSigning) Reset() { + *x = AttributeSigning{} + if protoimpl.UnsafeEnabled { + mi := &file_Signing_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *AttributeSigning) XXX_Size() int { - return xxx_messageInfo_AttributeSigning.Size(m) + +func (x *AttributeSigning) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *AttributeSigning) XXX_DiscardUnknown() { - xxx_messageInfo_AttributeSigning.DiscardUnknown(m) + +func (*AttributeSigning) ProtoMessage() {} + +func (x *AttributeSigning) ProtoReflect() protoreflect.Message { + mi := &file_Signing_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_AttributeSigning proto.InternalMessageInfo +// Deprecated: Use AttributeSigning.ProtoReflect.Descriptor instead. +func (*AttributeSigning) Descriptor() ([]byte, []int) { + return file_Signing_proto_rawDescGZIP(), []int{0} +} -func (m *AttributeSigning) GetName() string { - if m != nil { - return m.Name +func (x *AttributeSigning) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *AttributeSigning) GetValue() []byte { - if m != nil { - return m.Value +func (x *AttributeSigning) GetValue() []byte { + if x != nil { + return x.Value } return nil } -func (m *AttributeSigning) GetContentType() ContentType { - if m != nil { - return m.ContentType +func (x *AttributeSigning) GetContentType() ContentType { + if x != nil { + return x.ContentType } return ContentType_UNDEFINED } -func (m *AttributeSigning) GetArtifactSignature() []byte { - if m != nil { - return m.ArtifactSignature +func (x *AttributeSigning) GetArtifactSignature() []byte { + if x != nil { + return x.ArtifactSignature } return nil } -func (m *AttributeSigning) GetSubType() string { - if m != nil { - return m.SubType +func (x *AttributeSigning) GetSubType() string { + if x != nil { + return x.SubType } return "" } -func (m *AttributeSigning) GetSignedTimeStamp() []byte { - if m != nil { - return m.SignedTimeStamp +func (x *AttributeSigning) GetSignedTimeStamp() []byte { + if x != nil { + return x.SignedTimeStamp } return nil } -func init() { - proto.RegisterType((*AttributeSigning)(nil), "attrpubapi_v1.AttributeSigning") -} - -func init() { proto.RegisterFile("Signing.proto", fileDescriptor_c19542824c3e34e0) } - -var fileDescriptor_c19542824c3e34e0 = []byte{ - // 296 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x50, 0x4d, 0x4e, 0x02, 0x31, - 0x14, 0xce, 0x20, 0xa0, 0x56, 0x50, 0x69, 0x5c, 0x8c, 0xc4, 0x05, 0x31, 0x2e, 0x88, 0x89, 0x4d, - 0xd4, 0xb5, 0x0b, 0xf0, 0x02, 0x06, 0xd8, 0xe8, 0x66, 0xd2, 0x19, 0x1f, 0xe3, 0x4b, 0xe8, 0x4f, - 0x3a, 0xaf, 0x24, 0x73, 0x25, 0x8f, 0xe2, 0x6d, 0xbc, 0x81, 0x69, 0x67, 0x40, 0xdd, 0xf5, 0xeb, - 0xf7, 0xd7, 0x7e, 0x6c, 0xb8, 0xc4, 0x52, 0xa3, 0x2e, 0x85, 0x75, 0x86, 0x0c, 0x1f, 0x4a, 0x22, - 0x67, 0x7d, 0x2e, 0x2d, 0x66, 0xdb, 0xfb, 0xf1, 0xe8, 0xd9, 0x68, 0x02, 0x4d, 0xab, 0xda, 0x42, - 0xa3, 0xb8, 0xfe, 0x4e, 0xd8, 0xf9, 0x8c, 0xc8, 0x61, 0xee, 0x09, 0x5a, 0x33, 0xe7, 0xac, 0xab, - 0xa5, 0x82, 0x34, 0x99, 0x24, 0xd3, 0xe3, 0x45, 0x3c, 0xf3, 0x0b, 0xd6, 0xdb, 0xca, 0x8d, 0x87, - 0xb4, 0x33, 0x49, 0xa6, 0x83, 0x45, 0x03, 0xf8, 0x13, 0x1b, 0x14, 0x4d, 0x66, 0x46, 0xb5, 0x85, - 0xf4, 0x60, 0x92, 0x4c, 0x4f, 0x1f, 0xc6, 0xe2, 0x5f, 0xaf, 0xf8, 0x53, 0xbb, 0x38, 0x29, 0x7e, - 0x01, 0xbf, 0x63, 0x5c, 0x3a, 0xc2, 0xb5, 0x2c, 0x28, 0xab, 0xb0, 0xd4, 0x92, 0xbc, 0x83, 0xb4, - 0x1b, 0x1b, 0x46, 0x3b, 0x66, 0xb9, 0x23, 0xf8, 0x25, 0x3b, 0xaa, 0x7c, 0xde, 0x34, 0xf5, 0xe2, - 0xdb, 0x0e, 0x2b, 0x9f, 0xc7, 0xa4, 0x5b, 0x36, 0x0a, 0x01, 0xf0, 0x9e, 0x11, 0x2a, 0xc8, 0x2a, - 0x92, 0xca, 0xa6, 0xfd, 0x18, 0x74, 0xd6, 0x10, 0x2b, 0x54, 0xb0, 0x0c, 0xd7, 0x73, 0xc3, 0x6e, - 0x0a, 0xa3, 0x44, 0x6d, 0x08, 0x85, 0xb4, 0x28, 0x8a, 0x0d, 0x82, 0x26, 0x51, 0x59, 0x14, 0x0e, - 0x94, 0xa1, 0x76, 0x9b, 0xf9, 0xa0, 0xdd, 0xe3, 0x25, 0xa0, 0xb7, 0x61, 0xd0, 0x47, 0x22, 0x7c, - 0xee, 0xb3, 0x73, 0xf5, 0x1a, 0xfc, 0x33, 0x4f, 0x1f, 0x22, 0x0a, 0xe6, 0x7e, 0x2d, 0xf6, 0x4b, - 0x7e, 0x75, 0xd8, 0x6c, 0x3f, 0x41, 0xde, 0x8f, 0xb6, 0xc7, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x6f, 0x4c, 0xd8, 0xe5, 0x9e, 0x01, 0x00, 0x00, +func (x *AttributeSigning) GetAssociatedSource() string { + if x != nil { + return x.AssociatedSource + } + return "" +} + +var File_Signing_proto protoreflect.FileDescriptor + +var file_Signing_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x0d, 0x61, 0x74, 0x74, 0x72, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, 0x1a, 0x11, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x9e, 0x02, 0x0a, 0x10, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x53, + 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x3d, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x70, 0x75, 0x62, + 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x2d, 0x0a, 0x12, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x61, 0x72, 0x74, + 0x69, 0x66, 0x61, 0x63, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x73, 0x75, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x73, 0x75, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, + 0x53, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x10, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, 0x53, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x42, 0xe3, 0x01, 0x0a, 0x24, 0x63, 0x6f, 0x6d, 0x2e, 0x79, 0x6f, 0x74, 0x69, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x69, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x0c, 0x53, 0x69, 0x67, + 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x65, 0x74, 0x79, 0x6f, 0x74, 0x69, 0x2f, 0x79, 0x6f, + 0x74, 0x69, 0x2d, 0x67, 0x6f, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x33, 0x2f, 0x79, 0x6f, 0x74, + 0x69, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x61, 0x74, 0x74, 0x72, 0xaa, 0x02, 0x1c, 0x59, 0x6f, 0x74, + 0x69, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x75, 0x66, 0x2e, + 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0xca, 0x02, 0x18, 0x59, 0x6f, 0x74, 0x69, + 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5c, 0x41, 0x74, 0x74, 0x72, 0x70, 0x75, + 0x62, 0x61, 0x70, 0x69, 0xe2, 0x02, 0x24, 0x59, 0x6f, 0x74, 0x69, 0x5c, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x5c, 0x41, 0x74, 0x74, 0x72, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x59, 0x6f, + 0x74, 0x69, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x74, + 0x74, 0x72, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_Signing_proto_rawDescOnce sync.Once + file_Signing_proto_rawDescData = file_Signing_proto_rawDesc +) + +func file_Signing_proto_rawDescGZIP() []byte { + file_Signing_proto_rawDescOnce.Do(func() { + file_Signing_proto_rawDescData = protoimpl.X.CompressGZIP(file_Signing_proto_rawDescData) + }) + return file_Signing_proto_rawDescData +} + +var file_Signing_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_Signing_proto_goTypes = []interface{}{ + (*AttributeSigning)(nil), // 0: attrpubapi_v1.AttributeSigning + (ContentType)(0), // 1: attrpubapi_v1.ContentType +} +var file_Signing_proto_depIdxs = []int32{ + 1, // 0: attrpubapi_v1.AttributeSigning.content_type:type_name -> attrpubapi_v1.ContentType + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_Signing_proto_init() } +func file_Signing_proto_init() { + if File_Signing_proto != nil { + return + } + file_ContentType_proto_init() + if !protoimpl.UnsafeEnabled { + file_Signing_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AttributeSigning); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_Signing_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_Signing_proto_goTypes, + DependencyIndexes: file_Signing_proto_depIdxs, + MessageInfos: file_Signing_proto_msgTypes, + }.Build() + File_Signing_proto = out.File + file_Signing_proto_rawDesc = nil + file_Signing_proto_goTypes = nil + file_Signing_proto_depIdxs = nil } diff --git a/yotiprotocom/EncryptedData.pb.go b/yotiprotocom/EncryptedData.pb.go index 31740c944..9bb7f5474 100644 --- a/yotiprotocom/EncryptedData.pb.go +++ b/yotiprotocom/EncryptedData.pb.go @@ -1,92 +1,167 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.18.1 // source: EncryptedData.proto package yotiprotocom import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type EncryptedData struct { - Iv []byte `protobuf:"bytes,1,opt,name=iv,proto3" json:"iv,omitempty"` - CipherText []byte `protobuf:"bytes,2,opt,name=cipher_text,json=cipherText,proto3" json:"cipher_text,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *EncryptedData) Reset() { *m = EncryptedData{} } -func (m *EncryptedData) String() string { return proto.CompactTextString(m) } -func (*EncryptedData) ProtoMessage() {} -func (*EncryptedData) Descriptor() ([]byte, []int) { - return fileDescriptor_ed1db0e32f8afa88, []int{0} + Iv []byte `protobuf:"bytes,1,opt,name=iv,proto3" json:"iv,omitempty"` + CipherText []byte `protobuf:"bytes,2,opt,name=cipher_text,json=cipherText,proto3" json:"cipher_text,omitempty"` } -func (m *EncryptedData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EncryptedData.Unmarshal(m, b) -} -func (m *EncryptedData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EncryptedData.Marshal(b, m, deterministic) -} -func (m *EncryptedData) XXX_Merge(src proto.Message) { - xxx_messageInfo_EncryptedData.Merge(m, src) +func (x *EncryptedData) Reset() { + *x = EncryptedData{} + if protoimpl.UnsafeEnabled { + mi := &file_EncryptedData_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *EncryptedData) XXX_Size() int { - return xxx_messageInfo_EncryptedData.Size(m) + +func (x *EncryptedData) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *EncryptedData) XXX_DiscardUnknown() { - xxx_messageInfo_EncryptedData.DiscardUnknown(m) + +func (*EncryptedData) ProtoMessage() {} + +func (x *EncryptedData) ProtoReflect() protoreflect.Message { + mi := &file_EncryptedData_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_EncryptedData proto.InternalMessageInfo +// Deprecated: Use EncryptedData.ProtoReflect.Descriptor instead. +func (*EncryptedData) Descriptor() ([]byte, []int) { + return file_EncryptedData_proto_rawDescGZIP(), []int{0} +} -func (m *EncryptedData) GetIv() []byte { - if m != nil { - return m.Iv +func (x *EncryptedData) GetIv() []byte { + if x != nil { + return x.Iv } return nil } -func (m *EncryptedData) GetCipherText() []byte { - if m != nil { - return m.CipherText +func (x *EncryptedData) GetCipherText() []byte { + if x != nil { + return x.CipherText } return nil } -func init() { - proto.RegisterType((*EncryptedData)(nil), "compubapi_v1.EncryptedData") +var File_EncryptedData_proto protoreflect.FileDescriptor + +var file_EncryptedData_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, + 0x5f, 0x76, 0x31, 0x22, 0x40, 0x0a, 0x0d, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x76, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x02, 0x69, 0x76, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x5f, 0x74, + 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x69, 0x70, 0x68, 0x65, + 0x72, 0x54, 0x65, 0x78, 0x74, 0x42, 0xe2, 0x01, 0x0a, 0x24, 0x63, 0x6f, 0x6d, 0x2e, 0x79, 0x6f, + 0x74, 0x69, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, + 0x69, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x12, + 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, + 0x65, 0x74, 0x79, 0x6f, 0x74, 0x69, 0x2f, 0x79, 0x6f, 0x74, 0x69, 0x2d, 0x67, 0x6f, 0x2d, 0x73, + 0x64, 0x6b, 0x2f, 0x76, 0x33, 0x2f, 0x79, 0x6f, 0x74, 0x69, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6d, 0xaa, 0x02, 0x19, 0x59, 0x6f, 0x74, 0x69, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x75, 0x66, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xca, 0x02, + 0x17, 0x59, 0x6f, 0x74, 0x69, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5c, 0x43, + 0x6f, 0x6d, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0xe2, 0x02, 0x23, 0x59, 0x6f, 0x74, 0x69, 0x5c, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5c, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x62, 0x61, + 0x70, 0x69, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x19, 0x59, 0x6f, 0x74, 0x69, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x3a, + 0x3a, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_EncryptedData_proto_rawDescOnce sync.Once + file_EncryptedData_proto_rawDescData = file_EncryptedData_proto_rawDesc +) + +func file_EncryptedData_proto_rawDescGZIP() []byte { + file_EncryptedData_proto_rawDescOnce.Do(func() { + file_EncryptedData_proto_rawDescData = protoimpl.X.CompressGZIP(file_EncryptedData_proto_rawDescData) + }) + return file_EncryptedData_proto_rawDescData } -func init() { proto.RegisterFile("EncryptedData.proto", fileDescriptor_ed1db0e32f8afa88) } - -var fileDescriptor_ed1db0e32f8afa88 = []byte{ - // 194 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x76, 0xcd, 0x4b, 0x2e, - 0xaa, 0x2c, 0x28, 0x49, 0x4d, 0x71, 0x49, 0x2c, 0x49, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, - 0xe2, 0x49, 0xce, 0xcf, 0x2d, 0x28, 0x4d, 0x4a, 0x2c, 0xc8, 0x8c, 0x2f, 0x33, 0x54, 0x72, 0xe0, - 0xe2, 0x45, 0x51, 0x24, 0xc4, 0xc7, 0xc5, 0x94, 0x59, 0x26, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x13, - 0xc4, 0x94, 0x59, 0x26, 0x24, 0xcf, 0xc5, 0x9d, 0x9c, 0x59, 0x90, 0x91, 0x5a, 0x14, 0x5f, 0x92, - 0x5a, 0x51, 0x22, 0xc1, 0x04, 0x96, 0xe0, 0x82, 0x08, 0x85, 0xa4, 0x56, 0x94, 0x38, 0x15, 0x70, - 0xa9, 0x24, 0xe7, 0xe7, 0xea, 0x55, 0xe6, 0x97, 0x64, 0xea, 0x25, 0x16, 0x64, 0xea, 0x25, 0xe7, - 0x64, 0xa6, 0xe6, 0x95, 0xe8, 0x15, 0x17, 0x64, 0xea, 0x15, 0xa5, 0xe6, 0xe6, 0x97, 0xa4, 0x42, - 0xec, 0x75, 0x12, 0x42, 0xb1, 0x27, 0x00, 0x24, 0x16, 0xc5, 0x03, 0xd2, 0x05, 0x96, 0x4e, 0xce, - 0xcf, 0x5d, 0xc5, 0x24, 0x19, 0x09, 0x32, 0xc4, 0xb1, 0xb4, 0x24, 0x43, 0x0f, 0x2c, 0xef, 0x54, - 0x9a, 0xa6, 0xe7, 0x9c, 0x9f, 0x9b, 0x9b, 0x9f, 0x77, 0x8a, 0x89, 0xd3, 0x19, 0xe6, 0xec, 0x24, - 0x36, 0xb0, 0x0e, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x91, 0x06, 0x73, 0xdf, 0x00, - 0x00, 0x00, +var file_EncryptedData_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_EncryptedData_proto_goTypes = []interface{}{ + (*EncryptedData)(nil), // 0: compubapi_v1.EncryptedData +} +var file_EncryptedData_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_EncryptedData_proto_init() } +func file_EncryptedData_proto_init() { + if File_EncryptedData_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_EncryptedData_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EncryptedData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_EncryptedData_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_EncryptedData_proto_goTypes, + DependencyIndexes: file_EncryptedData_proto_depIdxs, + MessageInfos: file_EncryptedData_proto_msgTypes, + }.Build() + File_EncryptedData_proto = out.File + file_EncryptedData_proto_rawDesc = nil + file_EncryptedData_proto_goTypes = nil + file_EncryptedData_proto_depIdxs = nil } diff --git a/yotiprotocom/SignedTimestamp.pb.go b/yotiprotocom/SignedTimestamp.pb.go index af265993a..3f0b13d5b 100644 --- a/yotiprotocom/SignedTimestamp.pb.go +++ b/yotiprotocom/SignedTimestamp.pb.go @@ -1,128 +1,210 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.18.1 // source: SignedTimestamp.proto package yotiprotocom import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type SignedTimestamp struct { - Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - MessageDigest []byte `protobuf:"bytes,3,opt,name=message_digest,json=messageDigest,proto3" json:"message_digest,omitempty"` - ChainDigest []byte `protobuf:"bytes,4,opt,name=chain_digest,json=chainDigest,proto3" json:"chain_digest,omitempty"` - ChainDigestSkip1 []byte `protobuf:"bytes,5,opt,name=chain_digest_skip1,json=chainDigestSkip1,proto3" json:"chain_digest_skip1,omitempty"` - ChainDigestSkip2 []byte `protobuf:"bytes,6,opt,name=chain_digest_skip2,json=chainDigestSkip2,proto3" json:"chain_digest_skip2,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SignedTimestamp) Reset() { *m = SignedTimestamp{} } -func (m *SignedTimestamp) String() string { return proto.CompactTextString(m) } -func (*SignedTimestamp) ProtoMessage() {} -func (*SignedTimestamp) Descriptor() ([]byte, []int) { - return fileDescriptor_5602a15d48f50e63, []int{0} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + MessageDigest []byte `protobuf:"bytes,3,opt,name=message_digest,json=messageDigest,proto3" json:"message_digest,omitempty"` + ChainDigest []byte `protobuf:"bytes,4,opt,name=chain_digest,json=chainDigest,proto3" json:"chain_digest,omitempty"` + ChainDigestSkip1 []byte `protobuf:"bytes,5,opt,name=chain_digest_skip1,json=chainDigestSkip1,proto3" json:"chain_digest_skip1,omitempty"` + ChainDigestSkip2 []byte `protobuf:"bytes,6,opt,name=chain_digest_skip2,json=chainDigestSkip2,proto3" json:"chain_digest_skip2,omitempty"` } -func (m *SignedTimestamp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SignedTimestamp.Unmarshal(m, b) -} -func (m *SignedTimestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SignedTimestamp.Marshal(b, m, deterministic) -} -func (m *SignedTimestamp) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedTimestamp.Merge(m, src) +func (x *SignedTimestamp) Reset() { + *x = SignedTimestamp{} + if protoimpl.UnsafeEnabled { + mi := &file_SignedTimestamp_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *SignedTimestamp) XXX_Size() int { - return xxx_messageInfo_SignedTimestamp.Size(m) + +func (x *SignedTimestamp) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SignedTimestamp) XXX_DiscardUnknown() { - xxx_messageInfo_SignedTimestamp.DiscardUnknown(m) + +func (*SignedTimestamp) ProtoMessage() {} + +func (x *SignedTimestamp) ProtoReflect() protoreflect.Message { + mi := &file_SignedTimestamp_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_SignedTimestamp proto.InternalMessageInfo +// Deprecated: Use SignedTimestamp.ProtoReflect.Descriptor instead. +func (*SignedTimestamp) Descriptor() ([]byte, []int) { + return file_SignedTimestamp_proto_rawDescGZIP(), []int{0} +} -func (m *SignedTimestamp) GetVersion() int32 { - if m != nil { - return m.Version +func (x *SignedTimestamp) GetVersion() int32 { + if x != nil { + return x.Version } return 0 } -func (m *SignedTimestamp) GetTimestamp() uint64 { - if m != nil { - return m.Timestamp +func (x *SignedTimestamp) GetTimestamp() uint64 { + if x != nil { + return x.Timestamp } return 0 } -func (m *SignedTimestamp) GetMessageDigest() []byte { - if m != nil { - return m.MessageDigest +func (x *SignedTimestamp) GetMessageDigest() []byte { + if x != nil { + return x.MessageDigest } return nil } -func (m *SignedTimestamp) GetChainDigest() []byte { - if m != nil { - return m.ChainDigest +func (x *SignedTimestamp) GetChainDigest() []byte { + if x != nil { + return x.ChainDigest } return nil } -func (m *SignedTimestamp) GetChainDigestSkip1() []byte { - if m != nil { - return m.ChainDigestSkip1 +func (x *SignedTimestamp) GetChainDigestSkip1() []byte { + if x != nil { + return x.ChainDigestSkip1 } return nil } -func (m *SignedTimestamp) GetChainDigestSkip2() []byte { - if m != nil { - return m.ChainDigestSkip2 +func (x *SignedTimestamp) GetChainDigestSkip2() []byte { + if x != nil { + return x.ChainDigestSkip2 } return nil } -func init() { - proto.RegisterType((*SignedTimestamp)(nil), "compubapi_v1.SignedTimestamp") -} - -func init() { proto.RegisterFile("SignedTimestamp.proto", fileDescriptor_5602a15d48f50e63) } - -var fileDescriptor_5602a15d48f50e63 = []byte{ - // 266 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0xd0, 0xdf, 0x4a, 0xf3, 0x30, - 0x18, 0xc7, 0x71, 0xd2, 0x77, 0xdb, 0xcb, 0x62, 0xfd, 0x43, 0x50, 0x88, 0xe0, 0x41, 0x15, 0x85, - 0x1e, 0x48, 0x60, 0xf3, 0x0a, 0xec, 0xbc, 0x00, 0xe9, 0x3c, 0xd1, 0x93, 0x92, 0x65, 0xb1, 0x7b, - 0xd0, 0xe4, 0x09, 0x4d, 0x3a, 0xf0, 0x96, 0xbc, 0x14, 0x6f, 0xc6, 0x5b, 0x90, 0xc6, 0x15, 0xc7, - 0xd8, 0x61, 0xbf, 0xfd, 0x3c, 0x39, 0xf8, 0xd1, 0xb3, 0x39, 0xd4, 0x56, 0x2f, 0x9f, 0xc0, 0x68, - 0x1f, 0xa4, 0x71, 0xc2, 0x35, 0x18, 0x90, 0xa5, 0x0a, 0x8d, 0x6b, 0x17, 0xd2, 0x41, 0xb5, 0x9e, - 0x5c, 0x7d, 0x13, 0x7a, 0xbc, 0xe3, 0x18, 0xa7, 0xff, 0xd7, 0xba, 0xf1, 0x80, 0x96, 0x93, 0x8c, - 0xe4, 0xc3, 0xb2, 0xff, 0x64, 0x17, 0x74, 0x1c, 0x7a, 0xc6, 0x93, 0x8c, 0xe4, 0x83, 0xf2, 0x2f, - 0xb0, 0x1b, 0x7a, 0x64, 0xb4, 0xf7, 0xb2, 0xd6, 0xd5, 0x12, 0x6a, 0xed, 0x03, 0xff, 0x97, 0x91, - 0x3c, 0x2d, 0x0f, 0x37, 0xf5, 0x21, 0x46, 0x76, 0x49, 0x53, 0xb5, 0x92, 0x60, 0x7b, 0x34, 0x88, - 0xe8, 0x20, 0xb6, 0x0d, 0xb9, 0xa5, 0x6c, 0x9b, 0x54, 0xfe, 0x0d, 0xdc, 0x84, 0x0f, 0x23, 0x3c, - 0xd9, 0x82, 0xf3, 0xae, 0xef, 0xd5, 0x53, 0x3e, 0xda, 0xab, 0xa7, 0x45, 0x43, 0xaf, 0x15, 0x1a, - 0xf1, 0x81, 0x01, 0x84, 0x74, 0x20, 0xd4, 0x3b, 0x68, 0x1b, 0x84, 0x77, 0x20, 0x1a, 0x6d, 0x30, - 0xe8, 0xdf, 0x9d, 0x8a, 0xd3, 0x9d, 0x59, 0x1e, 0xbb, 0xfa, 0x92, 0x76, 0x77, 0x11, 0x28, 0x34, - 0x9f, 0xc9, 0xf9, 0x73, 0xf7, 0xcc, 0x7d, 0x1b, 0x56, 0x22, 0xfe, 0x2f, 0xda, 0x57, 0x31, 0x43, - 0x63, 0xd0, 0x7e, 0x25, 0xe3, 0x59, 0x3f, 0xf4, 0x62, 0x14, 0x2f, 0xee, 0x7e, 0x02, 0x00, 0x00, - 0xff, 0xff, 0x59, 0x7a, 0xcc, 0x8b, 0x93, 0x01, 0x00, 0x00, +var File_SignedTimestamp_proto protoreflect.FileDescriptor + +var file_SignedTimestamp_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x62, 0x61, + 0x70, 0x69, 0x5f, 0x76, 0x31, 0x22, 0xef, 0x01, 0x0a, 0x0f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x69, 0x67, + 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x6b, 0x69, 0x70, + 0x31, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x44, 0x69, + 0x67, 0x65, 0x73, 0x74, 0x53, 0x6b, 0x69, 0x70, 0x31, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x32, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x44, 0x69, 0x67, 0x65, + 0x73, 0x74, 0x53, 0x6b, 0x69, 0x70, 0x32, 0x42, 0xe4, 0x01, 0x0a, 0x24, 0x63, 0x6f, 0x6d, 0x2e, + 0x79, 0x6f, 0x74, 0x69, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, + 0x73, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x42, 0x14, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x67, 0x65, 0x74, 0x79, 0x6f, 0x74, 0x69, 0x2f, 0x79, 0x6f, 0x74, 0x69, 0x2d, + 0x67, 0x6f, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x33, 0x2f, 0x79, 0x6f, 0x74, 0x69, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6d, 0xaa, 0x02, 0x19, 0x59, 0x6f, 0x74, 0x69, 0x2e, 0x41, 0x75, + 0x74, 0x68, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x75, 0x66, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0xca, 0x02, 0x17, 0x59, 0x6f, 0x74, 0x69, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x5c, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0xe2, 0x02, 0x23, 0x59, + 0x6f, 0x74, 0x69, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5c, 0x43, 0x6f, 0x6d, + 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x19, 0x59, 0x6f, 0x74, 0x69, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x3a, 0x3a, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_SignedTimestamp_proto_rawDescOnce sync.Once + file_SignedTimestamp_proto_rawDescData = file_SignedTimestamp_proto_rawDesc +) + +func file_SignedTimestamp_proto_rawDescGZIP() []byte { + file_SignedTimestamp_proto_rawDescOnce.Do(func() { + file_SignedTimestamp_proto_rawDescData = protoimpl.X.CompressGZIP(file_SignedTimestamp_proto_rawDescData) + }) + return file_SignedTimestamp_proto_rawDescData +} + +var file_SignedTimestamp_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_SignedTimestamp_proto_goTypes = []interface{}{ + (*SignedTimestamp)(nil), // 0: compubapi_v1.SignedTimestamp +} +var file_SignedTimestamp_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_SignedTimestamp_proto_init() } +func file_SignedTimestamp_proto_init() { + if File_SignedTimestamp_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_SignedTimestamp_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedTimestamp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_SignedTimestamp_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_SignedTimestamp_proto_goTypes, + DependencyIndexes: file_SignedTimestamp_proto_depIdxs, + MessageInfos: file_SignedTimestamp_proto_msgTypes, + }.Build() + File_SignedTimestamp_proto = out.File + file_SignedTimestamp_proto_rawDesc = nil + file_SignedTimestamp_proto_goTypes = nil + file_SignedTimestamp_proto_depIdxs = nil } diff --git a/yotiprotoshare/DataEntry.pb.go b/yotiprotoshare/DataEntry.pb.go index f89f7f381..add01e4ae 100644 --- a/yotiprotoshare/DataEntry.pb.go +++ b/yotiprotoshare/DataEntry.pb.go @@ -1,25 +1,25 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.18.1 // source: DataEntry.proto package yotiprotoshare import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type DataEntry_Type int32 @@ -33,110 +33,210 @@ const ( DataEntry_THIRD_PARTY_ATTRIBUTE DataEntry_Type = 6 ) -var DataEntry_Type_name = map[int32]string{ - 0: "UNDEFINED", - 1: "INVOICE", - 2: "PAYMENT_TRANSACTION", - 3: "LOCATION", - 4: "TRANSACTION", - 5: "AGE_VERIFICATION_SECRET", - 6: "THIRD_PARTY_ATTRIBUTE", -} +// Enum value maps for DataEntry_Type. +var ( + DataEntry_Type_name = map[int32]string{ + 0: "UNDEFINED", + 1: "INVOICE", + 2: "PAYMENT_TRANSACTION", + 3: "LOCATION", + 4: "TRANSACTION", + 5: "AGE_VERIFICATION_SECRET", + 6: "THIRD_PARTY_ATTRIBUTE", + } + DataEntry_Type_value = map[string]int32{ + "UNDEFINED": 0, + "INVOICE": 1, + "PAYMENT_TRANSACTION": 2, + "LOCATION": 3, + "TRANSACTION": 4, + "AGE_VERIFICATION_SECRET": 5, + "THIRD_PARTY_ATTRIBUTE": 6, + } +) -var DataEntry_Type_value = map[string]int32{ - "UNDEFINED": 0, - "INVOICE": 1, - "PAYMENT_TRANSACTION": 2, - "LOCATION": 3, - "TRANSACTION": 4, - "AGE_VERIFICATION_SECRET": 5, - "THIRD_PARTY_ATTRIBUTE": 6, +func (x DataEntry_Type) Enum() *DataEntry_Type { + p := new(DataEntry_Type) + *p = x + return p } func (x DataEntry_Type) String() string { - return proto.EnumName(DataEntry_Type_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (DataEntry_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_4e43afba0c52a9a7, []int{0, 0} +func (DataEntry_Type) Descriptor() protoreflect.EnumDescriptor { + return file_DataEntry_proto_enumTypes[0].Descriptor() } -type DataEntry struct { - Type DataEntry_Type `protobuf:"varint,1,opt,name=type,proto3,enum=sharepubapi_v1.DataEntry_Type" json:"type,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (DataEntry_Type) Type() protoreflect.EnumType { + return &file_DataEntry_proto_enumTypes[0] } -func (m *DataEntry) Reset() { *m = DataEntry{} } -func (m *DataEntry) String() string { return proto.CompactTextString(m) } -func (*DataEntry) ProtoMessage() {} -func (*DataEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_4e43afba0c52a9a7, []int{0} +func (x DataEntry_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (m *DataEntry) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DataEntry.Unmarshal(m, b) +// Deprecated: Use DataEntry_Type.Descriptor instead. +func (DataEntry_Type) EnumDescriptor() ([]byte, []int) { + return file_DataEntry_proto_rawDescGZIP(), []int{0, 0} } -func (m *DataEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DataEntry.Marshal(b, m, deterministic) + +type DataEntry struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type DataEntry_Type `protobuf:"varint,1,opt,name=type,proto3,enum=sharepubapi_v1.DataEntry_Type" json:"type,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } -func (m *DataEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_DataEntry.Merge(m, src) + +func (x *DataEntry) Reset() { + *x = DataEntry{} + if protoimpl.UnsafeEnabled { + mi := &file_DataEntry_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *DataEntry) XXX_Size() int { - return xxx_messageInfo_DataEntry.Size(m) + +func (x *DataEntry) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DataEntry) XXX_DiscardUnknown() { - xxx_messageInfo_DataEntry.DiscardUnknown(m) + +func (*DataEntry) ProtoMessage() {} + +func (x *DataEntry) ProtoReflect() protoreflect.Message { + mi := &file_DataEntry_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_DataEntry proto.InternalMessageInfo +// Deprecated: Use DataEntry.ProtoReflect.Descriptor instead. +func (*DataEntry) Descriptor() ([]byte, []int) { + return file_DataEntry_proto_rawDescGZIP(), []int{0} +} -func (m *DataEntry) GetType() DataEntry_Type { - if m != nil { - return m.Type +func (x *DataEntry) GetType() DataEntry_Type { + if x != nil { + return x.Type } return DataEntry_UNDEFINED } -func (m *DataEntry) GetValue() []byte { - if m != nil { - return m.Value +func (x *DataEntry) GetValue() []byte { + if x != nil { + return x.Value } return nil } -func init() { - proto.RegisterEnum("sharepubapi_v1.DataEntry_Type", DataEntry_Type_name, DataEntry_Type_value) - proto.RegisterType((*DataEntry)(nil), "sharepubapi_v1.DataEntry") -} - -func init() { proto.RegisterFile("DataEntry.proto", fileDescriptor_4e43afba0c52a9a7) } - -var fileDescriptor_4e43afba0c52a9a7 = []byte{ - // 348 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0xd1, 0xaa, 0xda, 0x30, - 0x00, 0x86, 0xd7, 0x4e, 0xdd, 0x8c, 0xae, 0x96, 0x6c, 0x43, 0x65, 0x63, 0x88, 0xec, 0xc2, 0xab, - 0xc0, 0xdc, 0x13, 0xa4, 0x6d, 0x74, 0x81, 0x59, 0x4b, 0x1a, 0x05, 0x87, 0x50, 0xa2, 0xcb, 0xb0, - 0xa0, 0xb6, 0xd4, 0x54, 0xe8, 0x6b, 0xec, 0x31, 0x76, 0xb3, 0xf7, 0x38, 0x8f, 0x71, 0x2e, 0x7d, - 0x8a, 0x43, 0x53, 0x8e, 0x9e, 0x73, 0x2e, 0xff, 0xfc, 0x5f, 0xbe, 0x90, 0x1f, 0x74, 0x3c, 0xa1, - 0x04, 0x39, 0xaa, 0xac, 0x40, 0x69, 0x96, 0xa8, 0x04, 0x5a, 0xa7, 0x9d, 0xc8, 0x64, 0x9a, 0x6f, - 0x44, 0x1a, 0x47, 0xe7, 0x6f, 0xc3, 0x8b, 0x01, 0x9a, 0x57, 0x06, 0x8e, 0x41, 0x4d, 0x15, 0xa9, - 0xec, 0x19, 0x03, 0x63, 0x64, 0x8d, 0xbf, 0xa0, 0xe7, 0x30, 0xba, 0xc9, 0x78, 0x91, 0x4a, 0xa6, - 0x59, 0xf8, 0x01, 0xd4, 0xcf, 0x62, 0x9f, 0xcb, 0x9e, 0x39, 0x30, 0x46, 0x6d, 0x56, 0x85, 0xe1, - 0x5f, 0x03, 0xd4, 0x4a, 0x08, 0xbe, 0x03, 0xcd, 0x85, 0xef, 0x91, 0x09, 0xf5, 0x89, 0x67, 0xbf, - 0x82, 0x2d, 0xf0, 0x86, 0xfa, 0xcb, 0x39, 0x75, 0x89, 0x6d, 0xc0, 0x2e, 0x78, 0x1f, 0xe0, 0xd5, - 0x8c, 0xf8, 0x3c, 0xe2, 0x0c, 0xfb, 0x21, 0x76, 0x39, 0x9d, 0xfb, 0xb6, 0x09, 0xdb, 0xe0, 0xed, - 0xcf, 0xb9, 0x8b, 0x75, 0x7a, 0x0d, 0x3b, 0xa0, 0xf5, 0xb4, 0xae, 0xc1, 0x4f, 0xa0, 0x8b, 0xa7, - 0x24, 0x5a, 0x12, 0x46, 0x27, 0xb4, 0xc2, 0xa2, 0x90, 0xb8, 0x8c, 0x70, 0xbb, 0x0e, 0xfb, 0xe0, - 0x23, 0xff, 0x41, 0x99, 0x17, 0x05, 0x98, 0xf1, 0x55, 0x84, 0x39, 0x67, 0xd4, 0x59, 0x70, 0x62, - 0x37, 0x9c, 0xff, 0x06, 0xf8, 0xba, 0x4d, 0x0e, 0xa8, 0x48, 0x54, 0x8c, 0x44, 0x1a, 0xa3, 0xed, - 0x3e, 0x96, 0x47, 0x85, 0x4e, 0x69, 0x8c, 0x32, 0x79, 0x48, 0x94, 0xac, 0x56, 0x72, 0xac, 0xeb, - 0x4f, 0x83, 0x32, 0xff, 0xb2, 0xca, 0x1b, 0xba, 0xd2, 0x8b, 0xfc, 0x33, 0x7b, 0xab, 0x52, 0x81, - 0x73, 0xb5, 0x43, 0x9a, 0x70, 0xf2, 0x3f, 0x28, 0x2c, 0xab, 0x3b, 0xd3, 0x2e, 0xab, 0x75, 0x78, - 0x5b, 0xee, 0xde, 0xfc, 0xfc, 0xf2, 0x68, 0x3d, 0x0d, 0x9c, 0x99, 0x54, 0xe2, 0xb7, 0x50, 0xe2, - 0x62, 0xf6, 0xb5, 0x4c, 0x7b, 0x36, 0x8f, 0x9e, 0x8a, 0xdb, 0x34, 0xf4, 0xa3, 0xdf, 0x1f, 0x02, - 0x00, 0x00, 0xff, 0xff, 0x59, 0xb4, 0xee, 0x95, 0xc8, 0x01, 0x00, 0x00, +var File_DataEntry_proto protoreflect.FileDescriptor + +var file_DataEntry_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5f, 0x76, + 0x31, 0x22, 0xea, 0x01, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x32, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, 0x2e, 0x44, + 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x92, 0x01, 0x0a, 0x04, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x4f, 0x49, 0x43, 0x45, 0x10, 0x01, 0x12, 0x17, + 0x0a, 0x13, 0x50, 0x41, 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, + 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x4c, 0x4f, 0x43, 0x41, 0x54, + 0x49, 0x4f, 0x4e, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, + 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x12, 0x1b, 0x0a, 0x17, 0x41, 0x47, 0x45, 0x5f, 0x56, 0x45, + 0x52, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x45, 0x43, 0x52, 0x45, + 0x54, 0x10, 0x05, 0x12, 0x19, 0x0a, 0x15, 0x54, 0x48, 0x49, 0x52, 0x44, 0x5f, 0x50, 0x41, 0x52, + 0x54, 0x59, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x45, 0x10, 0x06, 0x42, 0xe5, + 0x01, 0x0a, 0x24, 0x63, 0x6f, 0x6d, 0x2e, 0x79, 0x6f, 0x74, 0x69, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x0e, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x65, 0x74, 0x79, 0x6f, 0x74, 0x69, 0x2f, 0x79, 0x6f, 0x74, 0x69, + 0x2d, 0x67, 0x6f, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x33, 0x2f, 0x79, 0x6f, 0x74, 0x69, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x61, 0x72, 0x65, 0xaa, 0x02, 0x18, 0x59, 0x6f, 0x74, 0x69, + 0x2e, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x75, 0x66, 0x2e, 0x53, + 0x68, 0x61, 0x72, 0x65, 0xca, 0x02, 0x19, 0x59, 0x6f, 0x74, 0x69, 0x5c, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, + 0xe2, 0x02, 0x25, 0x59, 0x6f, 0x74, 0x69, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x59, 0x6f, 0x74, 0x69, 0x3a, + 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x3a, 0x3a, 0x53, 0x68, 0x61, 0x72, 0x65, + 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_DataEntry_proto_rawDescOnce sync.Once + file_DataEntry_proto_rawDescData = file_DataEntry_proto_rawDesc +) + +func file_DataEntry_proto_rawDescGZIP() []byte { + file_DataEntry_proto_rawDescOnce.Do(func() { + file_DataEntry_proto_rawDescData = protoimpl.X.CompressGZIP(file_DataEntry_proto_rawDescData) + }) + return file_DataEntry_proto_rawDescData +} + +var file_DataEntry_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_DataEntry_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_DataEntry_proto_goTypes = []interface{}{ + (DataEntry_Type)(0), // 0: sharepubapi_v1.DataEntry.Type + (*DataEntry)(nil), // 1: sharepubapi_v1.DataEntry +} +var file_DataEntry_proto_depIdxs = []int32{ + 0, // 0: sharepubapi_v1.DataEntry.type:type_name -> sharepubapi_v1.DataEntry.Type + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_DataEntry_proto_init() } +func file_DataEntry_proto_init() { + if File_DataEntry_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_DataEntry_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataEntry); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_DataEntry_proto_rawDesc, + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_DataEntry_proto_goTypes, + DependencyIndexes: file_DataEntry_proto_depIdxs, + EnumInfos: file_DataEntry_proto_enumTypes, + MessageInfos: file_DataEntry_proto_msgTypes, + }.Build() + File_DataEntry_proto = out.File + file_DataEntry_proto_rawDesc = nil + file_DataEntry_proto_goTypes = nil + file_DataEntry_proto_depIdxs = nil } diff --git a/yotiprotoshare/ExtraData.pb.go b/yotiprotoshare/ExtraData.pb.go index b7e9698ed..88e555f45 100644 --- a/yotiprotoshare/ExtraData.pb.go +++ b/yotiprotoshare/ExtraData.pb.go @@ -1,85 +1,162 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.18.1 // source: ExtraData.proto package yotiprotoshare import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type ExtraData struct { - List []*DataEntry `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*DataEntry `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` } -func (m *ExtraData) Reset() { *m = ExtraData{} } -func (m *ExtraData) String() string { return proto.CompactTextString(m) } -func (*ExtraData) ProtoMessage() {} -func (*ExtraData) Descriptor() ([]byte, []int) { - return fileDescriptor_c9927818cb565e8f, []int{0} +func (x *ExtraData) Reset() { + *x = ExtraData{} + if protoimpl.UnsafeEnabled { + mi := &file_ExtraData_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ExtraData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ExtraData.Unmarshal(m, b) +func (x *ExtraData) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ExtraData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ExtraData.Marshal(b, m, deterministic) + +func (*ExtraData) ProtoMessage() {} + +func (x *ExtraData) ProtoReflect() protoreflect.Message { + mi := &file_ExtraData_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *ExtraData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExtraData.Merge(m, src) + +// Deprecated: Use ExtraData.ProtoReflect.Descriptor instead. +func (*ExtraData) Descriptor() ([]byte, []int) { + return file_ExtraData_proto_rawDescGZIP(), []int{0} } -func (m *ExtraData) XXX_Size() int { - return xxx_messageInfo_ExtraData.Size(m) + +func (x *ExtraData) GetList() []*DataEntry { + if x != nil { + return x.List + } + return nil } -func (m *ExtraData) XXX_DiscardUnknown() { - xxx_messageInfo_ExtraData.DiscardUnknown(m) + +var File_ExtraData_proto protoreflect.FileDescriptor + +var file_ExtraData_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x45, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5f, 0x76, + 0x31, 0x1a, 0x0f, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x3a, 0x0a, 0x09, 0x45, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x2d, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, 0x2e, 0x44, + 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x42, 0xe5, + 0x01, 0x0a, 0x24, 0x63, 0x6f, 0x6d, 0x2e, 0x79, 0x6f, 0x74, 0x69, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x0e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, + 0x74, 0x61, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x65, 0x74, 0x79, 0x6f, 0x74, 0x69, 0x2f, 0x79, 0x6f, 0x74, 0x69, + 0x2d, 0x67, 0x6f, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x33, 0x2f, 0x79, 0x6f, 0x74, 0x69, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x61, 0x72, 0x65, 0xaa, 0x02, 0x18, 0x59, 0x6f, 0x74, 0x69, + 0x2e, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x75, 0x66, 0x2e, 0x53, + 0x68, 0x61, 0x72, 0x65, 0xca, 0x02, 0x19, 0x59, 0x6f, 0x74, 0x69, 0x5c, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, + 0xe2, 0x02, 0x25, 0x59, 0x6f, 0x74, 0x69, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x59, 0x6f, 0x74, 0x69, 0x3a, + 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x3a, 0x3a, 0x53, 0x68, 0x61, 0x72, 0x65, + 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var xxx_messageInfo_ExtraData proto.InternalMessageInfo +var ( + file_ExtraData_proto_rawDescOnce sync.Once + file_ExtraData_proto_rawDescData = file_ExtraData_proto_rawDesc +) -func (m *ExtraData) GetList() []*DataEntry { - if m != nil { - return m.List - } - return nil +func file_ExtraData_proto_rawDescGZIP() []byte { + file_ExtraData_proto_rawDescOnce.Do(func() { + file_ExtraData_proto_rawDescData = protoimpl.X.CompressGZIP(file_ExtraData_proto_rawDescData) + }) + return file_ExtraData_proto_rawDescData } -func init() { - proto.RegisterType((*ExtraData)(nil), "sharepubapi_v1.ExtraData") +var file_ExtraData_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_ExtraData_proto_goTypes = []interface{}{ + (*ExtraData)(nil), // 0: sharepubapi_v1.ExtraData + (*DataEntry)(nil), // 1: sharepubapi_v1.DataEntry +} +var file_ExtraData_proto_depIdxs = []int32{ + 1, // 0: sharepubapi_v1.ExtraData.list:type_name -> sharepubapi_v1.DataEntry + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } -func init() { proto.RegisterFile("ExtraData.proto", fileDescriptor_c9927818cb565e8f) } - -var fileDescriptor_c9927818cb565e8f = []byte{ - // 215 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x77, 0xad, 0x28, 0x29, - 0x4a, 0x74, 0x49, 0x2c, 0x49, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x2b, 0xce, 0x48, - 0x2c, 0x4a, 0x2d, 0x28, 0x4d, 0x4a, 0x2c, 0xc8, 0x8c, 0x2f, 0x33, 0x94, 0xe2, 0x07, 0xc9, 0xb9, - 0xe6, 0x95, 0x14, 0x55, 0x42, 0x14, 0x28, 0x59, 0x71, 0x71, 0xc2, 0xf5, 0x08, 0xe9, 0x72, 0xb1, - 0xe4, 0x64, 0x16, 0x97, 0x48, 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x1b, 0x49, 0xea, 0xa1, 0x6a, 0xd6, - 0x83, 0xeb, 0x0d, 0x02, 0x2b, 0x73, 0x5a, 0xcf, 0xc8, 0xa5, 0x92, 0x9c, 0x9f, 0xab, 0x57, 0x99, - 0x5f, 0x92, 0xa9, 0x97, 0x58, 0x90, 0xa9, 0x97, 0x9c, 0x93, 0x99, 0x9a, 0x57, 0xa2, 0x57, 0x5c, - 0x90, 0xa9, 0x57, 0x94, 0x9a, 0x9b, 0x5f, 0x92, 0x0a, 0xb1, 0xc4, 0x89, 0x0f, 0x6e, 0x45, 0x00, - 0x88, 0x1f, 0xc5, 0x07, 0xd2, 0x01, 0x96, 0x02, 0xdb, 0xb0, 0x8a, 0x49, 0x22, 0x12, 0x64, 0x84, - 0x63, 0x69, 0x49, 0x86, 0x1e, 0x58, 0x85, 0x53, 0x69, 0x9a, 0x5e, 0x30, 0x48, 0xea, 0x14, 0x93, - 0x00, 0x48, 0x2a, 0x26, 0x18, 0xe1, 0x92, 0x47, 0x4c, 0x32, 0xe8, 0x42, 0x31, 0xee, 0x01, 0x4e, - 0xbe, 0xa9, 0x25, 0x89, 0x29, 0x89, 0x25, 0x89, 0xaf, 0x98, 0x24, 0xc1, 0x86, 0x81, 0xcd, 0x49, - 0x82, 0x99, 0x03, 0x51, 0x97, 0xc4, 0x06, 0xb6, 0xd4, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xde, - 0x9b, 0x7f, 0xb7, 0x28, 0x01, 0x00, 0x00, +func init() { file_ExtraData_proto_init() } +func file_ExtraData_proto_init() { + if File_ExtraData_proto != nil { + return + } + file_DataEntry_proto_init() + if !protoimpl.UnsafeEnabled { + file_ExtraData_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExtraData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ExtraData_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ExtraData_proto_goTypes, + DependencyIndexes: file_ExtraData_proto_depIdxs, + MessageInfos: file_ExtraData_proto_msgTypes, + }.Build() + File_ExtraData_proto = out.File + file_ExtraData_proto_rawDesc = nil + file_ExtraData_proto_goTypes = nil + file_ExtraData_proto_depIdxs = nil } diff --git a/yotiprotoshare/IssuingAttributes.pb.go b/yotiprotoshare/IssuingAttributes.pb.go index df967cad1..758fb289e 100644 --- a/yotiprotoshare/IssuingAttributes.pb.go +++ b/yotiprotoshare/IssuingAttributes.pb.go @@ -1,136 +1,234 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.18.1 // source: IssuingAttributes.proto package yotiprotoshare import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type IssuingAttributes struct { - ExpiryDate string `protobuf:"bytes,1,opt,name=expiry_date,json=expiryDate,proto3" json:"expiry_date,omitempty"` - Definitions []*Definition `protobuf:"bytes,2,rep,name=definitions,proto3" json:"definitions,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *IssuingAttributes) Reset() { *m = IssuingAttributes{} } -func (m *IssuingAttributes) String() string { return proto.CompactTextString(m) } -func (*IssuingAttributes) ProtoMessage() {} -func (*IssuingAttributes) Descriptor() ([]byte, []int) { - return fileDescriptor_8d2dd0b18c44f072, []int{0} + ExpiryDate string `protobuf:"bytes,1,opt,name=expiry_date,json=expiryDate,proto3" json:"expiry_date,omitempty"` + Definitions []*Definition `protobuf:"bytes,2,rep,name=definitions,proto3" json:"definitions,omitempty"` } -func (m *IssuingAttributes) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IssuingAttributes.Unmarshal(m, b) -} -func (m *IssuingAttributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IssuingAttributes.Marshal(b, m, deterministic) -} -func (m *IssuingAttributes) XXX_Merge(src proto.Message) { - xxx_messageInfo_IssuingAttributes.Merge(m, src) +func (x *IssuingAttributes) Reset() { + *x = IssuingAttributes{} + if protoimpl.UnsafeEnabled { + mi := &file_IssuingAttributes_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *IssuingAttributes) XXX_Size() int { - return xxx_messageInfo_IssuingAttributes.Size(m) + +func (x *IssuingAttributes) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *IssuingAttributes) XXX_DiscardUnknown() { - xxx_messageInfo_IssuingAttributes.DiscardUnknown(m) + +func (*IssuingAttributes) ProtoMessage() {} + +func (x *IssuingAttributes) ProtoReflect() protoreflect.Message { + mi := &file_IssuingAttributes_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_IssuingAttributes proto.InternalMessageInfo +// Deprecated: Use IssuingAttributes.ProtoReflect.Descriptor instead. +func (*IssuingAttributes) Descriptor() ([]byte, []int) { + return file_IssuingAttributes_proto_rawDescGZIP(), []int{0} +} -func (m *IssuingAttributes) GetExpiryDate() string { - if m != nil { - return m.ExpiryDate +func (x *IssuingAttributes) GetExpiryDate() string { + if x != nil { + return x.ExpiryDate } return "" } -func (m *IssuingAttributes) GetDefinitions() []*Definition { - if m != nil { - return m.Definitions +func (x *IssuingAttributes) GetDefinitions() []*Definition { + if x != nil { + return x.Definitions } return nil } type Definition struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Definition) Reset() { *m = Definition{} } -func (m *Definition) String() string { return proto.CompactTextString(m) } -func (*Definition) ProtoMessage() {} -func (*Definition) Descriptor() ([]byte, []int) { - return fileDescriptor_8d2dd0b18c44f072, []int{1} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } -func (m *Definition) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Definition.Unmarshal(m, b) -} -func (m *Definition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Definition.Marshal(b, m, deterministic) -} -func (m *Definition) XXX_Merge(src proto.Message) { - xxx_messageInfo_Definition.Merge(m, src) +func (x *Definition) Reset() { + *x = Definition{} + if protoimpl.UnsafeEnabled { + mi := &file_IssuingAttributes_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Definition) XXX_Size() int { - return xxx_messageInfo_Definition.Size(m) + +func (x *Definition) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Definition) XXX_DiscardUnknown() { - xxx_messageInfo_Definition.DiscardUnknown(m) + +func (*Definition) ProtoMessage() {} + +func (x *Definition) ProtoReflect() protoreflect.Message { + mi := &file_IssuingAttributes_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Definition proto.InternalMessageInfo +// Deprecated: Use Definition.ProtoReflect.Descriptor instead. +func (*Definition) Descriptor() ([]byte, []int) { + return file_IssuingAttributes_proto_rawDescGZIP(), []int{1} +} -func (m *Definition) GetName() string { - if m != nil { - return m.Name +func (x *Definition) GetName() string { + if x != nil { + return x.Name } return "" } -func init() { - proto.RegisterType((*IssuingAttributes)(nil), "sharepubapi_v1.IssuingAttributes") - proto.RegisterType((*Definition)(nil), "sharepubapi_v1.Definition") -} - -func init() { proto.RegisterFile("IssuingAttributes.proto", fileDescriptor_8d2dd0b18c44f072) } - -var fileDescriptor_8d2dd0b18c44f072 = []byte{ - // 267 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x8f, 0x41, 0x4a, 0xc3, 0x40, - 0x14, 0x86, 0x69, 0x14, 0xc1, 0x09, 0x14, 0xcd, 0x42, 0xa3, 0x08, 0x86, 0xe2, 0xa2, 0xab, 0x07, - 0xea, 0xd6, 0x4d, 0x43, 0x41, 0x5c, 0x08, 0xa5, 0x5d, 0x29, 0x85, 0x32, 0x69, 0x5e, 0xed, 0x03, - 0x33, 0x33, 0xcc, 0xbc, 0x11, 0x7b, 0x25, 0x2f, 0xe0, 0x1d, 0x3c, 0x86, 0x4b, 0x4f, 0x21, 0x33, - 0xa1, 0x56, 0xed, 0x2e, 0xfc, 0xff, 0x97, 0xef, 0xfd, 0x23, 0x8e, 0xef, 0x9c, 0xf3, 0xa4, 0x9e, - 0x06, 0xcc, 0x96, 0x2a, 0xcf, 0xe8, 0xc0, 0x58, 0xcd, 0x3a, 0xeb, 0xba, 0xa5, 0xb4, 0x68, 0x7c, - 0x25, 0x0d, 0xcd, 0x5e, 0x2e, 0x7b, 0x56, 0x1c, 0x6e, 0xa1, 0xd9, 0xb9, 0x48, 0xf1, 0xd5, 0x90, - 0x5d, 0xcd, 0x6a, 0xc9, 0x98, 0x77, 0x8a, 0x4e, 0x7f, 0x7f, 0x2c, 0xda, 0x68, 0x28, 0x19, 0xb3, - 0x1b, 0x91, 0xd6, 0xb8, 0x20, 0x45, 0x4c, 0x5a, 0xb9, 0x3c, 0x29, 0x76, 0xfa, 0xe9, 0xd5, 0x29, - 0xfc, 0x75, 0xc3, 0xf0, 0x07, 0x19, 0xff, 0xc6, 0x7b, 0x85, 0x10, 0x9b, 0x2a, 0xcb, 0xc4, 0xae, - 0x92, 0xcd, 0xfa, 0x4a, 0xfc, 0x2e, 0xdf, 0x3b, 0xe2, 0x62, 0xae, 0x1b, 0x58, 0x69, 0x26, 0x90, - 0x86, 0x60, 0xfe, 0x4c, 0xa8, 0x18, 0x9c, 0x21, 0xb0, 0xd8, 0x68, 0xc6, 0xf6, 0x39, 0xe5, 0xd1, - 0xd6, 0xf8, 0x51, 0xc8, 0x1f, 0xbb, 0xe1, 0xcf, 0x88, 0xc4, 0x4d, 0x6f, 0x49, 0xfe, 0x10, 0x54, - 0x03, 0xcf, 0x4b, 0x88, 0x44, 0xe9, 0x17, 0x30, 0x09, 0xd5, 0x47, 0x72, 0x10, 0xaa, 0xe9, 0x64, - 0xb3, 0xfd, 0x33, 0x39, 0xfb, 0x1f, 0x4d, 0x6f, 0x47, 0xe5, 0x3d, 0xb2, 0xac, 0x25, 0xcb, 0xaf, - 0xe4, 0x24, 0xca, 0xa2, 0xa7, 0x5a, 0x7b, 0x5a, 0xae, 0xda, 0x8b, 0x47, 0xaf, 0xbf, 0x03, 0x00, - 0x00, 0xff, 0xff, 0xb4, 0x29, 0xb9, 0xd6, 0x81, 0x01, 0x00, 0x00, +var File_IssuingAttributes_proto protoreflect.FileDescriptor + +var file_IssuingAttributes_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x49, 0x73, 0x73, 0x75, 0x69, 0x6e, 0x67, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x73, 0x68, 0x61, 0x72, 0x65, + 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, 0x22, 0x72, 0x0a, 0x11, 0x49, 0x73, 0x73, + 0x75, 0x69, 0x6e, 0x67, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x1f, + 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x44, 0x61, 0x74, 0x65, 0x12, + 0x3c, 0x0a, 0x0b, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x70, 0x75, 0x62, 0x61, + 0x70, 0x69, 0x5f, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x0b, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x0a, + 0x0a, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, + 0xed, 0x01, 0x0a, 0x24, 0x63, 0x6f, 0x6d, 0x2e, 0x79, 0x6f, 0x74, 0x69, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x16, 0x49, 0x73, 0x73, 0x75, 0x69, 0x6e, + 0x67, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x65, 0x74, + 0x79, 0x6f, 0x74, 0x69, 0x2f, 0x79, 0x6f, 0x74, 0x69, 0x2d, 0x67, 0x6f, 0x2d, 0x73, 0x64, 0x6b, + 0x2f, 0x76, 0x33, 0x2f, 0x79, 0x6f, 0x74, 0x69, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x61, + 0x72, 0x65, 0xaa, 0x02, 0x18, 0x59, 0x6f, 0x74, 0x69, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x75, 0x66, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0xca, 0x02, 0x19, + 0x59, 0x6f, 0x74, 0x69, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5c, 0x53, 0x68, + 0x61, 0x72, 0x65, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0xe2, 0x02, 0x25, 0x59, 0x6f, 0x74, 0x69, + 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x70, + 0x75, 0x62, 0x61, 0x70, 0x69, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x1b, 0x59, 0x6f, 0x74, 0x69, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x3a, 0x3a, 0x53, 0x68, 0x61, 0x72, 0x65, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_IssuingAttributes_proto_rawDescOnce sync.Once + file_IssuingAttributes_proto_rawDescData = file_IssuingAttributes_proto_rawDesc +) + +func file_IssuingAttributes_proto_rawDescGZIP() []byte { + file_IssuingAttributes_proto_rawDescOnce.Do(func() { + file_IssuingAttributes_proto_rawDescData = protoimpl.X.CompressGZIP(file_IssuingAttributes_proto_rawDescData) + }) + return file_IssuingAttributes_proto_rawDescData +} + +var file_IssuingAttributes_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_IssuingAttributes_proto_goTypes = []interface{}{ + (*IssuingAttributes)(nil), // 0: sharepubapi_v1.IssuingAttributes + (*Definition)(nil), // 1: sharepubapi_v1.Definition +} +var file_IssuingAttributes_proto_depIdxs = []int32{ + 1, // 0: sharepubapi_v1.IssuingAttributes.definitions:type_name -> sharepubapi_v1.Definition + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_IssuingAttributes_proto_init() } +func file_IssuingAttributes_proto_init() { + if File_IssuingAttributes_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_IssuingAttributes_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IssuingAttributes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_IssuingAttributes_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Definition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_IssuingAttributes_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_IssuingAttributes_proto_goTypes, + DependencyIndexes: file_IssuingAttributes_proto_depIdxs, + MessageInfos: file_IssuingAttributes_proto_msgTypes, + }.Build() + File_IssuingAttributes_proto = out.File + file_IssuingAttributes_proto_rawDesc = nil + file_IssuingAttributes_proto_goTypes = nil + file_IssuingAttributes_proto_depIdxs = nil } diff --git a/yotiprotoshare/ThirdPartyAttribute.pb.go b/yotiprotoshare/ThirdPartyAttribute.pb.go index e52959ab0..11623d27f 100644 --- a/yotiprotoshare/ThirdPartyAttribute.pb.go +++ b/yotiprotoshare/ThirdPartyAttribute.pb.go @@ -1,96 +1,177 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.18.1 // source: ThirdPartyAttribute.proto package yotiprotoshare import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type ThirdPartyAttribute struct { - IssuanceToken []byte `protobuf:"bytes,1,opt,name=issuance_token,json=issuanceToken,proto3" json:"issuance_token,omitempty"` - IssuingAttributes *IssuingAttributes `protobuf:"bytes,2,opt,name=issuing_attributes,json=issuingAttributes,proto3" json:"issuing_attributes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ThirdPartyAttribute) Reset() { *m = ThirdPartyAttribute{} } -func (m *ThirdPartyAttribute) String() string { return proto.CompactTextString(m) } -func (*ThirdPartyAttribute) ProtoMessage() {} -func (*ThirdPartyAttribute) Descriptor() ([]byte, []int) { - return fileDescriptor_8b8b4f642fd623e5, []int{0} + IssuanceToken []byte `protobuf:"bytes,1,opt,name=issuance_token,json=issuanceToken,proto3" json:"issuance_token,omitempty"` + IssuingAttributes *IssuingAttributes `protobuf:"bytes,2,opt,name=issuing_attributes,json=issuingAttributes,proto3" json:"issuing_attributes,omitempty"` } -func (m *ThirdPartyAttribute) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ThirdPartyAttribute.Unmarshal(m, b) -} -func (m *ThirdPartyAttribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ThirdPartyAttribute.Marshal(b, m, deterministic) -} -func (m *ThirdPartyAttribute) XXX_Merge(src proto.Message) { - xxx_messageInfo_ThirdPartyAttribute.Merge(m, src) +func (x *ThirdPartyAttribute) Reset() { + *x = ThirdPartyAttribute{} + if protoimpl.UnsafeEnabled { + mi := &file_ThirdPartyAttribute_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ThirdPartyAttribute) XXX_Size() int { - return xxx_messageInfo_ThirdPartyAttribute.Size(m) + +func (x *ThirdPartyAttribute) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ThirdPartyAttribute) XXX_DiscardUnknown() { - xxx_messageInfo_ThirdPartyAttribute.DiscardUnknown(m) + +func (*ThirdPartyAttribute) ProtoMessage() {} + +func (x *ThirdPartyAttribute) ProtoReflect() protoreflect.Message { + mi := &file_ThirdPartyAttribute_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ThirdPartyAttribute proto.InternalMessageInfo +// Deprecated: Use ThirdPartyAttribute.ProtoReflect.Descriptor instead. +func (*ThirdPartyAttribute) Descriptor() ([]byte, []int) { + return file_ThirdPartyAttribute_proto_rawDescGZIP(), []int{0} +} -func (m *ThirdPartyAttribute) GetIssuanceToken() []byte { - if m != nil { - return m.IssuanceToken +func (x *ThirdPartyAttribute) GetIssuanceToken() []byte { + if x != nil { + return x.IssuanceToken } return nil } -func (m *ThirdPartyAttribute) GetIssuingAttributes() *IssuingAttributes { - if m != nil { - return m.IssuingAttributes +func (x *ThirdPartyAttribute) GetIssuingAttributes() *IssuingAttributes { + if x != nil { + return x.IssuingAttributes } return nil } -func init() { - proto.RegisterType((*ThirdPartyAttribute)(nil), "sharepubapi_v1.ThirdPartyAttribute") +var File_ThirdPartyAttribute_proto protoreflect.FileDescriptor + +var file_ThirdPartyAttribute_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x54, 0x68, 0x69, 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x79, 0x41, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x73, 0x68, 0x61, + 0x72, 0x65, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, 0x1a, 0x17, 0x49, 0x73, 0x73, + 0x75, 0x69, 0x6e, 0x67, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8e, 0x01, 0x0a, 0x13, 0x54, 0x68, 0x69, 0x72, 0x64, 0x50, 0x61, + 0x72, 0x74, 0x79, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x25, 0x0a, 0x0e, + 0x69, 0x73, 0x73, 0x75, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x69, 0x73, 0x73, 0x75, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x12, 0x50, 0x0a, 0x12, 0x69, 0x73, 0x73, 0x75, 0x69, 0x6e, 0x67, 0x5f, 0x61, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, + 0x2e, 0x49, 0x73, 0x73, 0x75, 0x69, 0x6e, 0x67, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x73, 0x52, 0x11, 0x69, 0x73, 0x73, 0x75, 0x69, 0x6e, 0x67, 0x41, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x42, 0xef, 0x01, 0x0a, 0x24, 0x63, 0x6f, 0x6d, 0x2e, 0x79, 0x6f, + 0x74, 0x69, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, + 0x69, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x18, + 0x54, 0x68, 0x69, 0x72, 0x64, 0x50, 0x61, 0x72, 0x74, 0x79, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x65, 0x74, 0x79, 0x6f, 0x74, 0x69, 0x2f, 0x79, 0x6f, 0x74, + 0x69, 0x2d, 0x67, 0x6f, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x33, 0x2f, 0x79, 0x6f, 0x74, 0x69, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x61, 0x72, 0x65, 0xaa, 0x02, 0x18, 0x59, 0x6f, 0x74, + 0x69, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x75, 0x66, 0x2e, + 0x53, 0x68, 0x61, 0x72, 0x65, 0xca, 0x02, 0x19, 0x59, 0x6f, 0x74, 0x69, 0x5c, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x70, 0x75, 0x62, 0x61, 0x70, + 0x69, 0xe2, 0x02, 0x25, 0x59, 0x6f, 0x74, 0x69, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x59, 0x6f, 0x74, 0x69, + 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x3a, 0x3a, 0x53, 0x68, 0x61, 0x72, + 0x65, 0x70, 0x75, 0x62, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_ThirdPartyAttribute_proto_rawDescOnce sync.Once + file_ThirdPartyAttribute_proto_rawDescData = file_ThirdPartyAttribute_proto_rawDesc +) + +func file_ThirdPartyAttribute_proto_rawDescGZIP() []byte { + file_ThirdPartyAttribute_proto_rawDescOnce.Do(func() { + file_ThirdPartyAttribute_proto_rawDescData = protoimpl.X.CompressGZIP(file_ThirdPartyAttribute_proto_rawDescData) + }) + return file_ThirdPartyAttribute_proto_rawDescData } -func init() { proto.RegisterFile("ThirdPartyAttribute.proto", fileDescriptor_8b8b4f642fd623e5) } - -var fileDescriptor_8b8b4f642fd623e5 = []byte{ - // 265 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x0c, 0xc9, 0xc8, 0x2c, - 0x4a, 0x09, 0x48, 0x2c, 0x2a, 0xa9, 0x74, 0x2c, 0x29, 0x29, 0xca, 0x4c, 0x2a, 0x2d, 0x49, 0xd5, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x2b, 0xce, 0x48, 0x2c, 0x4a, 0x2d, 0x28, 0x4d, 0x4a, - 0x2c, 0xc8, 0x8c, 0x2f, 0x33, 0x94, 0x12, 0xf7, 0x2c, 0x2e, 0x2e, 0xcd, 0xcc, 0x4b, 0x87, 0xab, - 0x2b, 0x86, 0x28, 0x54, 0xea, 0x63, 0xe4, 0x12, 0xc6, 0x62, 0x8c, 0x90, 0x2a, 0x17, 0x5f, 0x66, - 0x71, 0x71, 0x69, 0x62, 0x5e, 0x72, 0x6a, 0x7c, 0x49, 0x7e, 0x76, 0x6a, 0x9e, 0x04, 0xa3, 0x02, - 0xa3, 0x06, 0x4f, 0x10, 0x2f, 0x4c, 0x34, 0x04, 0x24, 0x28, 0x14, 0xc0, 0x25, 0x94, 0x09, 0x31, - 0x39, 0x3e, 0x11, 0x6e, 0xb4, 0x04, 0x93, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0xa2, 0x1e, 0xaa, 0x23, - 0xf4, 0x30, 0xdc, 0x10, 0x24, 0x98, 0x89, 0x2e, 0xe4, 0xb4, 0x93, 0x91, 0x4b, 0x25, 0x39, 0x3f, - 0x57, 0xaf, 0x32, 0xbf, 0x24, 0x53, 0x2f, 0xb1, 0x20, 0x53, 0x2f, 0x39, 0x27, 0x33, 0x35, 0xaf, - 0x44, 0xaf, 0xb8, 0x20, 0x53, 0xaf, 0x28, 0x35, 0x37, 0x1f, 0xe6, 0x45, 0x27, 0x09, 0x2c, 0xce, - 0x0e, 0x00, 0xc9, 0x44, 0xf1, 0x81, 0xf4, 0x82, 0x15, 0x81, 0x1d, 0xb0, 0x8a, 0x49, 0x22, 0x12, - 0x64, 0x98, 0x63, 0x69, 0x49, 0x86, 0x1e, 0x58, 0x85, 0x53, 0x69, 0x9a, 0x5e, 0x30, 0x48, 0xea, - 0x14, 0x93, 0x00, 0x48, 0x2a, 0x26, 0x18, 0xe1, 0xd0, 0x47, 0x4c, 0x32, 0xe8, 0x42, 0x31, 0xee, - 0x01, 0x4e, 0xbe, 0xa9, 0x25, 0x89, 0x29, 0x89, 0x25, 0x89, 0xaf, 0x98, 0x24, 0xc1, 0x86, 0x81, - 0xcd, 0x49, 0x82, 0x99, 0x03, 0x51, 0x97, 0xc4, 0x06, 0xb6, 0xd4, 0x18, 0x10, 0x00, 0x00, 0xff, - 0xff, 0x56, 0x44, 0x27, 0x89, 0x99, 0x01, 0x00, 0x00, +var file_ThirdPartyAttribute_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_ThirdPartyAttribute_proto_goTypes = []interface{}{ + (*ThirdPartyAttribute)(nil), // 0: sharepubapi_v1.ThirdPartyAttribute + (*IssuingAttributes)(nil), // 1: sharepubapi_v1.IssuingAttributes +} +var file_ThirdPartyAttribute_proto_depIdxs = []int32{ + 1, // 0: sharepubapi_v1.ThirdPartyAttribute.issuing_attributes:type_name -> sharepubapi_v1.IssuingAttributes + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_ThirdPartyAttribute_proto_init() } +func file_ThirdPartyAttribute_proto_init() { + if File_ThirdPartyAttribute_proto != nil { + return + } + file_IssuingAttributes_proto_init() + if !protoimpl.UnsafeEnabled { + file_ThirdPartyAttribute_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ThirdPartyAttribute); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ThirdPartyAttribute_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ThirdPartyAttribute_proto_goTypes, + DependencyIndexes: file_ThirdPartyAttribute_proto_depIdxs, + MessageInfos: file_ThirdPartyAttribute_proto_msgTypes, + }.Build() + File_ThirdPartyAttribute_proto = out.File + file_ThirdPartyAttribute_proto_rawDesc = nil + file_ThirdPartyAttribute_proto_goTypes = nil + file_ThirdPartyAttribute_proto_depIdxs = nil }