mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-04 02:11:40 +00:00
feature/migrate models (#16)
* feat: add new supported attestation formats to genesis * feat: refactor keyType to keytype enum * refactor: remove unused imports and code * refactor: update main.go to use src package * refactor: move web-related structs from to * refactor: move client middleware package to root * refactor: remove unused IndexedDB dependency * feat: update worker implementation to use * feat: add Caddyfile and Caddy configuration for vault service * refactor(config): move keyshare and address to Motr config * fix: validate service origin in AllocateVault * chore: remove IndexedDB configuration * feat: add support for IPNS-based vault access
This commit is contained in:
@@ -0,0 +1 @@
|
||||
package types
|
||||
+1
-162
@@ -2,24 +2,17 @@ package types
|
||||
|
||||
import (
|
||||
"crypto/ecdsa"
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"strings"
|
||||
|
||||
fmt "fmt"
|
||||
|
||||
ethcrypto "github.com/ethereum/go-ethereum/crypto"
|
||||
"golang.org/x/crypto/sha3"
|
||||
|
||||
"github.com/cosmos/btcutil/bech32"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
"github.com/cosmos/cosmos-sdk/codec/types"
|
||||
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
|
||||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/msgservice"
|
||||
"github.com/mr-tron/base58/base58"
|
||||
"github.com/onsonr/crypto"
|
||||
// this line is used by starport scaffolding # 1
|
||||
)
|
||||
|
||||
@@ -42,7 +35,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
||||
func RegisterInterfaces(registry types.InterfaceRegistry) {
|
||||
registry.RegisterImplementations(
|
||||
(*cryptotypes.PubKey)(nil),
|
||||
&PubKey{},
|
||||
// &PubKey{},
|
||||
)
|
||||
|
||||
registry.RegisterImplementations(
|
||||
@@ -55,160 +48,6 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
|
||||
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
|
||||
}
|
||||
|
||||
type ChainCode uint32
|
||||
|
||||
const (
|
||||
ChainCodeBTC ChainCode = 0
|
||||
ChainCodeETH ChainCode = 60
|
||||
ChainCodeIBC ChainCode = 118
|
||||
ChainCodeSNR ChainCode = 703
|
||||
)
|
||||
|
||||
var InitialChainCodes = map[DIDNamespace]ChainCode{
|
||||
DIDNamespace_DID_NAMESPACE_BITCOIN: ChainCodeBTC,
|
||||
DIDNamespace_DID_NAMESPACE_IBC: ChainCodeIBC,
|
||||
DIDNamespace_DID_NAMESPACE_ETHEREUM: ChainCodeETH,
|
||||
DIDNamespace_DID_NAMESPACE_SONR: ChainCodeSNR,
|
||||
}
|
||||
|
||||
func (c ChainCode) FormatAddress(pubKey *PubKey) (string, error) {
|
||||
switch c {
|
||||
case ChainCodeBTC:
|
||||
return bech32.Encode("bc", pubKey.Bytes())
|
||||
|
||||
case ChainCodeETH:
|
||||
epk, err := pubKey.ECDSA()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return ComputeEthAddress(*epk), nil
|
||||
|
||||
case ChainCodeSNR:
|
||||
return bech32.Encode("idx", pubKey.Bytes())
|
||||
|
||||
case ChainCodeIBC:
|
||||
return bech32.Encode("cosmos", pubKey.Bytes())
|
||||
|
||||
}
|
||||
return "", ErrUnsopportedChainCode
|
||||
}
|
||||
|
||||
func (n DIDNamespace) ChainCode() (uint32, error) {
|
||||
switch n {
|
||||
case DIDNamespace_DID_NAMESPACE_BITCOIN:
|
||||
return 0, nil
|
||||
case DIDNamespace_DID_NAMESPACE_ETHEREUM:
|
||||
return 64, nil
|
||||
case DIDNamespace_DID_NAMESPACE_IBC:
|
||||
return 118, nil
|
||||
case DIDNamespace_DID_NAMESPACE_SONR:
|
||||
return 703, nil
|
||||
default:
|
||||
return 0, fmt.Errorf("unsupported chain")
|
||||
}
|
||||
}
|
||||
|
||||
func (n DIDNamespace) DIDMethod() string {
|
||||
switch n {
|
||||
case DIDNamespace_DID_NAMESPACE_IPFS:
|
||||
return "ipfs"
|
||||
case DIDNamespace_DID_NAMESPACE_SONR:
|
||||
return "sonr"
|
||||
case DIDNamespace_DID_NAMESPACE_BITCOIN:
|
||||
return "btcr"
|
||||
case DIDNamespace_DID_NAMESPACE_ETHEREUM:
|
||||
return "ethr"
|
||||
case DIDNamespace_DID_NAMESPACE_IBC:
|
||||
return "ibcr"
|
||||
case DIDNamespace_DID_NAMESPACE_WEBAUTHN:
|
||||
return "webauthn"
|
||||
case DIDNamespace_DID_NAMESPACE_DWN:
|
||||
return "motr"
|
||||
case DIDNamespace_DID_NAMESPACE_SERVICE:
|
||||
return "web"
|
||||
default:
|
||||
return "n/a"
|
||||
}
|
||||
}
|
||||
|
||||
func (n DIDNamespace) FormatDID(subject string) string {
|
||||
return fmt.Sprintf("%s:%s", n.DIDMethod(), subject)
|
||||
}
|
||||
|
||||
type EncodedKey []byte
|
||||
|
||||
func (e KeyEncoding) EncodeRaw(data []byte) (EncodedKey, error) {
|
||||
switch e {
|
||||
case KeyEncoding_KEY_ENCODING_RAW:
|
||||
return data, nil
|
||||
case KeyEncoding_KEY_ENCODING_HEX:
|
||||
return []byte(hex.EncodeToString(data)), nil
|
||||
case KeyEncoding_KEY_ENCODING_MULTIBASE:
|
||||
return []byte(base58.Encode(data)), nil
|
||||
default:
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
|
||||
func (e KeyEncoding) DecodeRaw(data EncodedKey) ([]byte, error) {
|
||||
switch e {
|
||||
case KeyEncoding_KEY_ENCODING_RAW:
|
||||
return data, nil
|
||||
case KeyEncoding_KEY_ENCODING_HEX:
|
||||
return hex.DecodeString(string(data))
|
||||
case KeyEncoding_KEY_ENCODING_MULTIBASE:
|
||||
return base58.Decode(string(data))
|
||||
default:
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
|
||||
type COSEAlgorithmIdentifier int
|
||||
|
||||
func (k KeyAlgorithm) CoseIdentifier() COSEAlgorithmIdentifier {
|
||||
switch k {
|
||||
case KeyAlgorithm_KEY_ALGORITHM_ES256:
|
||||
return COSEAlgorithmIdentifier(-7)
|
||||
case KeyAlgorithm_KEY_ALGORITHM_ES384:
|
||||
return COSEAlgorithmIdentifier(-35)
|
||||
case KeyAlgorithm_KEY_ALGORITHM_ES512:
|
||||
return COSEAlgorithmIdentifier(-36)
|
||||
case KeyAlgorithm_KEY_ALGORITHM_EDDSA:
|
||||
return COSEAlgorithmIdentifier(-8)
|
||||
case KeyAlgorithm_KEY_ALGORITHM_ES256K:
|
||||
return COSEAlgorithmIdentifier(-10)
|
||||
default:
|
||||
return COSEAlgorithmIdentifier(0)
|
||||
}
|
||||
}
|
||||
|
||||
func (k KeyCurve) ComputePublicKey(data []byte) (*PubKey, error) {
|
||||
return nil, ErrUnsupportedKeyCurve
|
||||
}
|
||||
|
||||
func (k *Keyshare) Equals(o crypto.MPCShare) bool {
|
||||
opk := o.GetPublicKey()
|
||||
if opk != nil && k.PublicKey == nil {
|
||||
return false
|
||||
}
|
||||
return k.GetRole() == o.GetRole()
|
||||
}
|
||||
|
||||
func (k *Keyshare) IsUser() bool {
|
||||
return k.Role == 2
|
||||
}
|
||||
|
||||
func (k *Keyshare) IsValidator() bool {
|
||||
return k.Role == 1
|
||||
}
|
||||
|
||||
// ComputeOriginTXTRecord generates a fingerprint for a given origin
|
||||
func ComputeOriginTXTRecord(origin string) string {
|
||||
h := sha256.New()
|
||||
h.Write([]byte(origin))
|
||||
return fmt.Sprintf("v=sonr,o=%s,p=%x", origin, h.Sum(nil))
|
||||
}
|
||||
|
||||
func ComputeEthAddress(pk ecdsa.PublicKey) string {
|
||||
// Generate Ethereum address
|
||||
address := ethcrypto.PubkeyToAddress(pk)
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
package types
|
||||
|
||||
// Coin represents a cryptocurrency
|
||||
type Coin interface {
|
||||
// FormatAddress formats a public key into an address
|
||||
FormatAddress(pubKey []byte) (string, error)
|
||||
|
||||
// GetIndex returns the coin type index
|
||||
GetIndex() int64
|
||||
|
||||
// GetPath returns the coin component path
|
||||
GetPath() uint32
|
||||
|
||||
// GetSymbol returns the coin symbol
|
||||
GetSymbol() string
|
||||
|
||||
// GetMethod returns the coin DID method
|
||||
GetMethod() string
|
||||
|
||||
// GetName returns the coin name
|
||||
GetName() string
|
||||
}
|
||||
|
||||
// CoinBTCType is the coin type for BTC
|
||||
const CoinBTCType = int64(0)
|
||||
|
||||
// CoinETHType is the coin type for ETH
|
||||
const CoinETHType = int64(60)
|
||||
|
||||
// CoinSNRType is the coin type for SNR
|
||||
const CoinSNRType = int64(703)
|
||||
+55
-63
@@ -6,7 +6,12 @@ import (
|
||||
|
||||
ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1"
|
||||
"cosmossdk.io/collections"
|
||||
"cosmossdk.io/x/nft"
|
||||
"github.com/onsonr/sonr/internal/orm/assettype"
|
||||
"github.com/onsonr/sonr/internal/orm/keyalgorithm"
|
||||
"github.com/onsonr/sonr/internal/orm/keycurve"
|
||||
"github.com/onsonr/sonr/internal/orm/keyencoding"
|
||||
"github.com/onsonr/sonr/internal/orm/keyrole"
|
||||
"github.com/onsonr/sonr/internal/orm/keytype"
|
||||
)
|
||||
|
||||
// ParamsKey saves the current module params.
|
||||
@@ -36,8 +41,7 @@ const DefaultIndex uint64 = 1
|
||||
func DefaultGenesis() *GenesisState {
|
||||
return &GenesisState{
|
||||
// this line is used by starport scaffolding # genesis/types/default
|
||||
GlobalIntegrity: DefaultGlobalIntegrity(),
|
||||
Params: DefaultParams(),
|
||||
Params: DefaultParams(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,20 +49,19 @@ func DefaultGenesis() *GenesisState {
|
||||
// failure.
|
||||
func (gs GenesisState) Validate() error {
|
||||
// this line is used by starport scaffolding # genesis/types/validate
|
||||
if gs.GlobalIntegrity == nil {
|
||||
return fmt.Errorf("global integrity proof is nil")
|
||||
}
|
||||
|
||||
return gs.Params.Validate()
|
||||
}
|
||||
|
||||
// DefaultNFTClasses configures the Initial DIDNamespace NFT classes
|
||||
func DefaultNFTClasses(nftGenesis *nft.GenesisState) error {
|
||||
for _, n := range DIDNamespace_value {
|
||||
nftGenesis.Classes = append(nftGenesis.Classes, DIDNamespace(n).GetNFTClass())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// // DefaultNFTClasses configures the Initial DIDNamespace NFT classes
|
||||
//
|
||||
// func DefaultNFTClasses(nftGenesis *nft.GenesisState) error {
|
||||
// for _, n := range DIDNamespace_value {
|
||||
// nftGenesis.Classes = append(nftGenesis.Classes, DIDNamespace(n).GetNFTClass())
|
||||
// }
|
||||
// return nil
|
||||
// }
|
||||
//
|
||||
// DefaultParams returns default module parameters.
|
||||
func DefaultParams() Params {
|
||||
return Params{
|
||||
@@ -70,16 +73,6 @@ func DefaultParams() Params {
|
||||
}
|
||||
}
|
||||
|
||||
// DefaultGlobalIntegrity returns the default global integrity proof
|
||||
func DefaultGlobalIntegrity() *GlobalIntegrity {
|
||||
return &GlobalIntegrity{
|
||||
Controller: "did:sonr:0x0",
|
||||
Seed: DefaultSeedMessage(),
|
||||
Accumulator: []byte{},
|
||||
Count: 0,
|
||||
}
|
||||
}
|
||||
|
||||
// DefaultSeedMessage returns the default seed message
|
||||
func DefaultSeedMessage() string {
|
||||
l1 := "The Sonr Network shall make no protocol that respects the establishment of centralized authority,"
|
||||
@@ -97,7 +90,7 @@ func DefaultAssets() []*AssetInfo {
|
||||
Symbol: "BTC",
|
||||
Hrp: "bc",
|
||||
Index: 0,
|
||||
AssetType: AssetType_ASSET_TYPE_NATIVE,
|
||||
AssetType: assettype.Native.String(),
|
||||
IconUrl: "https://cdn.sonr.land/BTC.svg",
|
||||
},
|
||||
{
|
||||
@@ -105,7 +98,7 @@ func DefaultAssets() []*AssetInfo {
|
||||
Symbol: "ETH",
|
||||
Hrp: "eth",
|
||||
Index: 64,
|
||||
AssetType: AssetType_ASSET_TYPE_NATIVE,
|
||||
AssetType: assettype.Native.String(),
|
||||
IconUrl: "https://cdn.sonr.land/ETH.svg",
|
||||
},
|
||||
{
|
||||
@@ -113,76 +106,75 @@ func DefaultAssets() []*AssetInfo {
|
||||
Symbol: "SNR",
|
||||
Hrp: "idx",
|
||||
Index: 703,
|
||||
AssetType: AssetType_ASSET_TYPE_NATIVE,
|
||||
AssetType: assettype.Native.String(),
|
||||
IconUrl: "https://cdn.sonr.land/SNR.svg",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// DefaultKeyInfos returns the default key infos: secp256k1, ed25519, keccak256, and bls12381.
|
||||
func DefaultKeyInfos() map[string]*KeyInfo {
|
||||
return map[string]*KeyInfo{
|
||||
// Identity Key Info
|
||||
// Sonr Controller Key Info - From MPC
|
||||
"auth.dwn": {
|
||||
Role: KeyRole_KEY_ROLE_INVOCATION,
|
||||
Curve: KeyCurve_KEY_CURVE_P256,
|
||||
Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA,
|
||||
Encoding: KeyEncoding_KEY_ENCODING_HEX,
|
||||
Type: KeyType_KEY_TYPE_MPC,
|
||||
Role: keyrole.Invocation.String(),
|
||||
Curve: keycurve.P256.String(),
|
||||
Algorithm: keyalgorithm.Ecdsa.String(),
|
||||
Encoding: keyencoding.Hex.String(),
|
||||
Type: keytype.Mpc.String(),
|
||||
},
|
||||
|
||||
// Sonr Vault Shared Key Info - From Registration
|
||||
"auth.zk": {
|
||||
Role: KeyRole_KEY_ROLE_ASSERTION,
|
||||
Curve: KeyCurve_KEY_CURVE_BLS12381,
|
||||
Algorithm: KeyAlgorithm_KEY_ALGORITHM_UNSPECIFIED,
|
||||
Encoding: KeyEncoding_KEY_ENCODING_MULTIBASE,
|
||||
Type: KeyType_KEY_TYPE_ZK,
|
||||
Role: keyrole.Assertion.String(),
|
||||
Curve: keycurve.Bls12381.String(),
|
||||
Algorithm: keyalgorithm.Es256k.String(),
|
||||
Encoding: keyencoding.Multibase.String(),
|
||||
Type: keytype.Zk.String(),
|
||||
},
|
||||
|
||||
// Blockchain Key Info
|
||||
// Ethereum Key Info
|
||||
"auth.ethereum": {
|
||||
Role: KeyRole_KEY_ROLE_DELEGATION,
|
||||
Curve: KeyCurve_KEY_CURVE_KECCAK256,
|
||||
Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA,
|
||||
Encoding: KeyEncoding_KEY_ENCODING_HEX,
|
||||
Type: KeyType_KEY_TYPE_BIP32,
|
||||
Role: keyrole.Delegation.String(),
|
||||
Curve: keycurve.Keccak256.String(),
|
||||
Algorithm: keyalgorithm.Ecdsa.String(),
|
||||
Encoding: keyencoding.Hex.String(),
|
||||
Type: keytype.Bip32.String(),
|
||||
},
|
||||
// Bitcoin/IBC Key Info
|
||||
"auth.bitcoin": {
|
||||
Role: KeyRole_KEY_ROLE_DELEGATION,
|
||||
Curve: KeyCurve_KEY_CURVE_SECP256K1,
|
||||
Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA,
|
||||
Encoding: KeyEncoding_KEY_ENCODING_HEX,
|
||||
Type: KeyType_KEY_TYPE_BIP32,
|
||||
Role: keyrole.Delegation.String(),
|
||||
Curve: keycurve.Secp256k1.String(),
|
||||
Algorithm: keyalgorithm.Ecdsa.String(),
|
||||
Encoding: keyencoding.Hex.String(),
|
||||
Type: keytype.Bip32.String(),
|
||||
},
|
||||
|
||||
// Authentication Key Info
|
||||
// Browser based WebAuthn
|
||||
"webauthn.browser": {
|
||||
Role: KeyRole_KEY_ROLE_AUTHENTICATION,
|
||||
Curve: KeyCurve_KEY_CURVE_P256,
|
||||
Algorithm: KeyAlgorithm_KEY_ALGORITHM_ES256,
|
||||
Encoding: KeyEncoding_KEY_ENCODING_RAW,
|
||||
Type: KeyType_KEY_TYPE_WEBAUTHN,
|
||||
Role: keyrole.Authentication.String(),
|
||||
Curve: keycurve.P256.String(),
|
||||
Algorithm: keyalgorithm.Es256.String(),
|
||||
Encoding: keyencoding.Raw.String(),
|
||||
Type: keytype.Webauthn.String(),
|
||||
},
|
||||
// FIDO U2F
|
||||
"webauthn.fido": {
|
||||
Role: KeyRole_KEY_ROLE_AUTHENTICATION,
|
||||
Curve: KeyCurve_KEY_CURVE_P256,
|
||||
Algorithm: KeyAlgorithm_KEY_ALGORITHM_ES256,
|
||||
Encoding: KeyEncoding_KEY_ENCODING_RAW,
|
||||
Type: KeyType_KEY_TYPE_WEBAUTHN,
|
||||
Role: keyrole.Authentication.String(),
|
||||
Curve: keycurve.P256.String(),
|
||||
Algorithm: keyalgorithm.Es256.String(),
|
||||
Encoding: keyencoding.Raw.String(),
|
||||
Type: keytype.Webauthn.String(),
|
||||
},
|
||||
// Cross-Platform Passkeys
|
||||
"webauthn.passkey": {
|
||||
Role: KeyRole_KEY_ROLE_AUTHENTICATION,
|
||||
Curve: KeyCurve_KEY_CURVE_ED25519,
|
||||
Algorithm: KeyAlgorithm_KEY_ALGORITHM_EDDSA,
|
||||
Encoding: KeyEncoding_KEY_ENCODING_RAW,
|
||||
Type: KeyType_KEY_TYPE_WEBAUTHN,
|
||||
Role: keyrole.Authentication.String(),
|
||||
Curve: keycurve.Ed25519.String(),
|
||||
Algorithm: keyalgorithm.Eddsa.String(),
|
||||
Encoding: keyencoding.Raw.String(),
|
||||
Type: keytype.Webauthn.String(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
+2339
-935
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,102 +0,0 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"cosmossdk.io/x/nft"
|
||||
)
|
||||
|
||||
func (n DIDNamespace) ID() string {
|
||||
switch n {
|
||||
case DIDNamespace_DID_NAMESPACE_DWN:
|
||||
return "did:dwn:0"
|
||||
case DIDNamespace_DID_NAMESPACE_SONR:
|
||||
return "did:sonr:0"
|
||||
case DIDNamespace_DID_NAMESPACE_BITCOIN:
|
||||
return "did:btc:0"
|
||||
case DIDNamespace_DID_NAMESPACE_ETHEREUM:
|
||||
return "did:eth:0"
|
||||
case DIDNamespace_DID_NAMESPACE_IBC:
|
||||
return "did:ibc:0"
|
||||
case DIDNamespace_DID_NAMESPACE_WEBAUTHN:
|
||||
return "did:authn:0"
|
||||
case DIDNamespace_DID_NAMESPACE_SERVICE:
|
||||
return "did:web:0"
|
||||
case DIDNamespace_DID_NAMESPACE_IPFS:
|
||||
return "did:ipfs:0"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (n DIDNamespace) Name() string {
|
||||
switch n {
|
||||
case DIDNamespace_DID_NAMESPACE_DWN:
|
||||
return "DecentralizedWebNode"
|
||||
case DIDNamespace_DID_NAMESPACE_SONR:
|
||||
return "SonrNetwork"
|
||||
case DIDNamespace_DID_NAMESPACE_BITCOIN:
|
||||
return "BitcoinNetwork"
|
||||
case DIDNamespace_DID_NAMESPACE_ETHEREUM:
|
||||
return "EthereumNetwork"
|
||||
case DIDNamespace_DID_NAMESPACE_IBC:
|
||||
return "IBCNetwork"
|
||||
case DIDNamespace_DID_NAMESPACE_WEBAUTHN:
|
||||
return "WebAuthentication"
|
||||
case DIDNamespace_DID_NAMESPACE_SERVICE:
|
||||
return "DecentrlizedService"
|
||||
case DIDNamespace_DID_NAMESPACE_IPFS:
|
||||
return "IPFSStorage"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (n DIDNamespace) Symbol() string {
|
||||
switch n {
|
||||
case DIDNamespace_DID_NAMESPACE_DWN:
|
||||
return "DWN"
|
||||
case DIDNamespace_DID_NAMESPACE_SONR:
|
||||
return "SONR"
|
||||
case DIDNamespace_DID_NAMESPACE_BITCOIN:
|
||||
return "BTC"
|
||||
case DIDNamespace_DID_NAMESPACE_ETHEREUM:
|
||||
return "ETH"
|
||||
case DIDNamespace_DID_NAMESPACE_IBC:
|
||||
return "IBC"
|
||||
case DIDNamespace_DID_NAMESPACE_WEBAUTHN:
|
||||
return "WEBAUTHN"
|
||||
case DIDNamespace_DID_NAMESPACE_SERVICE:
|
||||
return "SERVICE"
|
||||
case DIDNamespace_DID_NAMESPACE_IPFS:
|
||||
return "IPFS"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (n DIDNamespace) Description() string {
|
||||
switch n {
|
||||
case DIDNamespace_DID_NAMESPACE_DWN:
|
||||
return "DWN Service Provider"
|
||||
case DIDNamespace_DID_NAMESPACE_SONR:
|
||||
return "Sonr Network Gateway"
|
||||
case DIDNamespace_DID_NAMESPACE_BITCOIN:
|
||||
return "Bitcoin Network Gateway"
|
||||
case DIDNamespace_DID_NAMESPACE_ETHEREUM:
|
||||
return "Ethereum Network Gateway"
|
||||
case DIDNamespace_DID_NAMESPACE_IBC:
|
||||
return "IBC Network Gateway"
|
||||
case DIDNamespace_DID_NAMESPACE_WEBAUTHN:
|
||||
return "Web Authentication Key"
|
||||
case DIDNamespace_DID_NAMESPACE_SERVICE:
|
||||
return "Decentrlized Service"
|
||||
case DIDNamespace_DID_NAMESPACE_IPFS:
|
||||
return "Data Storage on IPFS"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (n DIDNamespace) GetNFTClass() *nft.Class {
|
||||
return &nft.Class{
|
||||
Id: n.ID(),
|
||||
Name: n.Name(),
|
||||
Symbol: n.Symbol(),
|
||||
Description: n.Description(),
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package types
|
||||
|
||||
var (
|
||||
PermissionScopeStrings = [...]string{
|
||||
"profile",
|
||||
"permissions.read",
|
||||
"permissions.write",
|
||||
"transactions.read",
|
||||
"transactions.write",
|
||||
"wallets.read",
|
||||
"wallets.create",
|
||||
"wallets.subscribe",
|
||||
"wallets.update",
|
||||
"transactions.verify",
|
||||
"transactions.broadcast",
|
||||
"admin.user",
|
||||
"admin.validator",
|
||||
}
|
||||
|
||||
StringToPermissionScope = map[string]PermissionScope{
|
||||
"PERMISSION_SCOPE_UNSPECIFIED": PermissionScope_PERMISSION_SCOPE_UNSPECIFIED,
|
||||
"PERMISSION_SCOPE_PROFILE_NAME": PermissionScope_PERMISSION_SCOPE_BASIC_INFO,
|
||||
"PERMISSION_SCOPE_IDENTIFIERS_EMAIL": PermissionScope_PERMISSION_SCOPE_PERMISSIONS_READ,
|
||||
"PERMISSION_SCOPE_IDENTIFIERS_PHONE": PermissionScope_PERMISSION_SCOPE_PERMISSIONS_WRITE,
|
||||
"PERMISSION_SCOPE_TRANSACTIONS_READ": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_READ,
|
||||
"PERMISSION_SCOPE_TRANSACTIONS_WRITE": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_WRITE,
|
||||
"PERMISSION_SCOPE_WALLETS_READ": PermissionScope_PERMISSION_SCOPE_WALLETS_READ,
|
||||
"PERMISSION_SCOPE_WALLETS_CREATE": PermissionScope_PERMISSION_SCOPE_WALLETS_CREATE,
|
||||
"PERMISSION_SCOPE_WALLETS_SUBSCRIBE": PermissionScope_PERMISSION_SCOPE_WALLETS_SUBSCRIBE,
|
||||
"PERMISSION_SCOPE_WALLETS_UPDATE": PermissionScope_PERMISSION_SCOPE_WALLETS_UPDATE,
|
||||
"PERMISSION_SCOPE_TRANSACTIONS_VERIFY": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_VERIFY,
|
||||
"PERMISSION_SCOPE_TRANSACTIONS_BROADCAST": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_BROADCAST,
|
||||
"PERMISSION_SCOPE_ADMIN_USER": PermissionScope_PERMISSION_SCOPE_ADMIN_USER,
|
||||
"PERMISSION_SCOPE_ADMIN_VALIDATOR": PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR,
|
||||
}
|
||||
)
|
||||
@@ -1,153 +0,0 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"crypto/ecdsa"
|
||||
"encoding/hex"
|
||||
|
||||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
"github.com/mr-tron/base58/base58"
|
||||
"github.com/onsonr/crypto"
|
||||
"github.com/onsonr/crypto/macaroon"
|
||||
)
|
||||
|
||||
var WalletKeyInfo = &KeyInfo{
|
||||
Role: KeyRole_KEY_ROLE_DELEGATION,
|
||||
Curve: KeyCurve_KEY_CURVE_SECP256K1,
|
||||
Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA,
|
||||
Encoding: KeyEncoding_KEY_ENCODING_HEX,
|
||||
Type: KeyType_KEY_TYPE_BIP32,
|
||||
}
|
||||
|
||||
var EthKeyInfo = &KeyInfo{
|
||||
Role: KeyRole_KEY_ROLE_DELEGATION,
|
||||
Curve: KeyCurve_KEY_CURVE_KECCAK256,
|
||||
Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA,
|
||||
Encoding: KeyEncoding_KEY_ENCODING_HEX,
|
||||
Type: KeyType_KEY_TYPE_BIP32,
|
||||
}
|
||||
|
||||
var SonrKeyInfo = &KeyInfo{
|
||||
Role: KeyRole_KEY_ROLE_INVOCATION,
|
||||
Curve: KeyCurve_KEY_CURVE_P256,
|
||||
Algorithm: KeyAlgorithm_KEY_ALGORITHM_ECDSA,
|
||||
Encoding: KeyEncoding_KEY_ENCODING_HEX,
|
||||
Type: KeyType_KEY_TYPE_MPC,
|
||||
}
|
||||
|
||||
var ChainCodeKeyInfos = map[ChainCode]*KeyInfo{
|
||||
ChainCodeBTC: WalletKeyInfo,
|
||||
ChainCodeETH: EthKeyInfo,
|
||||
ChainCodeSNR: SonrKeyInfo,
|
||||
ChainCodeIBC: WalletKeyInfo,
|
||||
}
|
||||
|
||||
// NewEthPublicKey returns a new ethereum public key
|
||||
func NewPublicKey(data []byte, keyInfo *KeyInfo) (*PubKey, error) {
|
||||
encKey, err := keyInfo.Encoding.EncodeRaw(data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &PubKey{
|
||||
Raw: encKey,
|
||||
Role: keyInfo.Role,
|
||||
Encoding: keyInfo.Encoding,
|
||||
Algorithm: keyInfo.Algorithm,
|
||||
Curve: keyInfo.Curve,
|
||||
KeyType: keyInfo.Type,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Address returns the address of the public key
|
||||
func (k *PubKey) Address() cryptotypes.Address {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Bytes returns the raw bytes of the public key
|
||||
func (k *PubKey) Bytes() []byte {
|
||||
bz, _ := k.GetEncoding().DecodeRaw(k.GetRaw())
|
||||
return bz
|
||||
}
|
||||
|
||||
// Clone returns a copy of the public key
|
||||
func (k *PubKey) Clone() cryptotypes.PubKey {
|
||||
return &PubKey{
|
||||
Raw: k.GetRaw(),
|
||||
Role: k.GetRole(),
|
||||
Encoding: k.GetEncoding(),
|
||||
Algorithm: k.GetAlgorithm(),
|
||||
Curve: k.GetCurve(),
|
||||
KeyType: k.GetKeyType(),
|
||||
}
|
||||
}
|
||||
|
||||
// IssueMacaroon returns a macaroon for the public key with the given id and location
|
||||
func (pk *PubKey) IssueMacaroon(subject string, origin string) (*macaroon.Macaroon, error) {
|
||||
return macaroon.New(pk.Bytes(), []byte(subject), origin, macaroon.LatestVersion)
|
||||
}
|
||||
|
||||
// ECDSA returns the ECDSA public key
|
||||
func (k *PubKey) ECDSA() (*ecdsa.PublicKey, error) {
|
||||
return crypto.ComputeEcdsaPublicKey(k.Bytes())
|
||||
}
|
||||
|
||||
// VerifySignature verifies a signature over the given message
|
||||
func (k *PubKey) VerifySignature(msg []byte, sig []byte) bool {
|
||||
pk, err := crypto.ComputeEcdsaPublicKey(k.Bytes())
|
||||
sigMpc, err := crypto.DeserializeMPCSignature(sig)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return crypto.VerifyMPCSignature(sigMpc, msg, pk)
|
||||
}
|
||||
|
||||
// Equals returns true if two public keys are equal
|
||||
func (k *PubKey) Equals(k2 cryptotypes.PubKey) bool {
|
||||
if k == nil && k2 == nil {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Type returns the type of the public key
|
||||
func (k *PubKey) Type() string {
|
||||
return k.KeyType.String()
|
||||
}
|
||||
|
||||
// DecodePublicKey extracts the public key from the given data
|
||||
func (k *KeyInfo) DecodePublicKey(data interface{}) ([]byte, error) {
|
||||
var bz []byte
|
||||
switch v := data.(type) {
|
||||
case string:
|
||||
bz = []byte(v)
|
||||
case []byte:
|
||||
bz = v
|
||||
default:
|
||||
return nil, ErrUnsupportedKeyEncoding
|
||||
}
|
||||
|
||||
if k.Encoding == KeyEncoding_KEY_ENCODING_RAW {
|
||||
return bz, nil
|
||||
}
|
||||
if k.Encoding == KeyEncoding_KEY_ENCODING_HEX {
|
||||
return hex.DecodeString(string(bz))
|
||||
}
|
||||
if k.Encoding == KeyEncoding_KEY_ENCODING_MULTIBASE {
|
||||
return base58.Decode(string(bz))
|
||||
}
|
||||
return nil, ErrUnsupportedKeyEncoding
|
||||
}
|
||||
|
||||
// EncodePublicKey encodes the public key according to the KeyInfo's encoding
|
||||
func (k *KeyInfo) EncodePublicKey(data []byte) (string, error) {
|
||||
if k.Encoding == KeyEncoding_KEY_ENCODING_RAW {
|
||||
return string(data), nil
|
||||
}
|
||||
if k.Encoding == KeyEncoding_KEY_ENCODING_HEX {
|
||||
return hex.EncodeToString(data), nil
|
||||
}
|
||||
if k.Encoding == KeyEncoding_KEY_ENCODING_MULTIBASE {
|
||||
return base58.Encode(data), nil
|
||||
}
|
||||
return "", ErrUnsupportedKeyEncoding
|
||||
}
|
||||
+31
-352
@@ -258,68 +258,6 @@ func (m *QueryResolveResponse) GetDocument() *Document {
|
||||
return nil
|
||||
}
|
||||
|
||||
// QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method.
|
||||
type QueryServiceResponse struct {
|
||||
// options is the PublicKeyCredentialAttestationOptions
|
||||
Existing bool `protobuf:"varint,1,opt,name=existing,proto3" json:"existing,omitempty"`
|
||||
Service *ServiceInfo `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"`
|
||||
TxtRecord string `protobuf:"bytes,3,opt,name=txt_record,json=txtRecord,proto3" json:"txt_record,omitempty"`
|
||||
}
|
||||
|
||||
func (m *QueryServiceResponse) Reset() { *m = QueryServiceResponse{} }
|
||||
func (m *QueryServiceResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryServiceResponse) ProtoMessage() {}
|
||||
func (*QueryServiceResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ae1fa9bb626e2869, []int{4}
|
||||
}
|
||||
func (m *QueryServiceResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *QueryServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_QueryServiceResponse.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *QueryServiceResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_QueryServiceResponse.Merge(m, src)
|
||||
}
|
||||
func (m *QueryServiceResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *QueryServiceResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_QueryServiceResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_QueryServiceResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *QueryServiceResponse) GetExisting() bool {
|
||||
if m != nil {
|
||||
return m.Existing
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *QueryServiceResponse) GetService() *ServiceInfo {
|
||||
if m != nil {
|
||||
return m.Service
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *QueryServiceResponse) GetTxtRecord() string {
|
||||
if m != nil {
|
||||
return m.TxtRecord
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// SyncRequest is the request type for the Sync RPC method.
|
||||
type SyncRequest struct {
|
||||
Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"`
|
||||
@@ -329,7 +267,7 @@ func (m *SyncRequest) Reset() { *m = SyncRequest{} }
|
||||
func (m *SyncRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*SyncRequest) ProtoMessage() {}
|
||||
func (*SyncRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ae1fa9bb626e2869, []int{5}
|
||||
return fileDescriptor_ae1fa9bb626e2869, []int{4}
|
||||
}
|
||||
func (m *SyncRequest) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -374,7 +312,7 @@ func (m *SyncResponse) Reset() { *m = SyncResponse{} }
|
||||
func (m *SyncResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*SyncResponse) ProtoMessage() {}
|
||||
func (*SyncResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ae1fa9bb626e2869, []int{6}
|
||||
return fileDescriptor_ae1fa9bb626e2869, []int{5}
|
||||
}
|
||||
func (m *SyncResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -415,7 +353,6 @@ func init() {
|
||||
proto.RegisterType((*QueryResponse)(nil), "did.v1.QueryResponse")
|
||||
proto.RegisterType((*QueryParamsResponse)(nil), "did.v1.QueryParamsResponse")
|
||||
proto.RegisterType((*QueryResolveResponse)(nil), "did.v1.QueryResolveResponse")
|
||||
proto.RegisterType((*QueryServiceResponse)(nil), "did.v1.QueryServiceResponse")
|
||||
proto.RegisterType((*SyncRequest)(nil), "did.v1.SyncRequest")
|
||||
proto.RegisterType((*SyncResponse)(nil), "did.v1.SyncResponse")
|
||||
}
|
||||
@@ -423,41 +360,35 @@ func init() {
|
||||
func init() { proto.RegisterFile("did/v1/query.proto", fileDescriptor_ae1fa9bb626e2869) }
|
||||
|
||||
var fileDescriptor_ae1fa9bb626e2869 = []byte{
|
||||
// 543 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x41, 0x6f, 0xd3, 0x30,
|
||||
0x14, 0x6e, 0xba, 0xb5, 0x69, 0x5f, 0x3b, 0x18, 0x6e, 0x85, 0x42, 0x19, 0x01, 0xf9, 0x80, 0x76,
|
||||
0x80, 0x5a, 0x2b, 0x57, 0x90, 0x10, 0xda, 0x05, 0x89, 0x03, 0xcb, 0x2e, 0x88, 0x0b, 0x64, 0xb1,
|
||||
0x09, 0xd6, 0x5a, 0xbb, 0x8b, 0xdd, 0xaa, 0xd1, 0x34, 0x09, 0xf1, 0x0b, 0x90, 0x10, 0xff, 0x88,
|
||||
0x03, 0xc7, 0x49, 0x5c, 0x38, 0xa2, 0x96, 0x1f, 0x82, 0x62, 0x3b, 0xed, 0x3a, 0x69, 0x8c, 0x4b,
|
||||
0x94, 0xf7, 0xbd, 0xcf, 0xdf, 0x7b, 0xef, 0x7b, 0x36, 0x20, 0xca, 0x29, 0x99, 0xee, 0x91, 0x93,
|
||||
0x09, 0xcb, 0xf2, 0xfe, 0x38, 0x93, 0x5a, 0xa2, 0x3a, 0xe5, 0xb4, 0x3f, 0xdd, 0xeb, 0x75, 0x5d,
|
||||
0x2e, 0x65, 0x82, 0x29, 0xae, 0x6c, 0xb6, 0xd7, 0x71, 0xe8, 0x48, 0x52, 0x36, 0x2c, 0xc1, 0x9d,
|
||||
0x54, 0xca, 0x74, 0xc8, 0x48, 0x3c, 0xe6, 0x24, 0x16, 0x42, 0xea, 0x58, 0x73, 0x29, 0x5c, 0x16,
|
||||
0xbf, 0x87, 0xf6, 0x41, 0xa1, 0x1f, 0xb1, 0x93, 0x09, 0x53, 0x1a, 0x6d, 0xc3, 0x06, 0xe5, 0x34,
|
||||
0xf0, 0x1e, 0x78, 0xbb, 0xcd, 0xa8, 0xf8, 0x45, 0xb7, 0xa1, 0x2e, 0x33, 0x9e, 0x72, 0x11, 0x54,
|
||||
0x0d, 0xe8, 0xa2, 0x82, 0x79, 0xcc, 0xf2, 0x60, 0xc3, 0x32, 0x8f, 0x59, 0x8e, 0xba, 0x50, 0x8b,
|
||||
0x95, 0x62, 0x3a, 0xd8, 0x34, 0x98, 0x0d, 0xf0, 0x37, 0x0f, 0xb6, 0x5c, 0x09, 0x35, 0x96, 0x42,
|
||||
0x31, 0x14, 0x80, 0xaf, 0x26, 0x49, 0xc2, 0x94, 0x32, 0x75, 0x1a, 0x51, 0x19, 0x16, 0x0a, 0x66,
|
||||
0x5a, 0x57, 0xca, 0x06, 0xe8, 0x11, 0x34, 0xa8, 0x4c, 0x26, 0x23, 0x26, 0xb4, 0x29, 0xd7, 0x1a,
|
||||
0x6c, 0xf7, 0xad, 0x0f, 0xfd, 0x7d, 0x87, 0x47, 0x4b, 0x06, 0x7a, 0x08, 0xf5, 0x71, 0x9c, 0xc5,
|
||||
0x23, 0x15, 0xd4, 0x0c, 0xf7, 0x46, 0xc9, 0x7d, 0x6d, 0xd0, 0xc8, 0x65, 0xf1, 0x33, 0xe8, 0x98,
|
||||
0xb6, 0x1c, 0x5c, 0x36, 0xb7, 0x3a, 0xee, 0xfd, 0xf3, 0xf8, 0x3e, 0x74, 0xcb, 0xa9, 0xe4, 0x70,
|
||||
0xca, 0x96, 0xe7, 0x2f, 0x36, 0xeb, 0x5d, 0xd7, 0x2c, 0xfe, 0xe4, 0x39, 0x99, 0x43, 0x96, 0x4d,
|
||||
0x79, 0xb2, 0x92, 0xe9, 0x41, 0x83, 0xcd, 0xb8, 0xd2, 0x5c, 0xa4, 0xce, 0xa4, 0x65, 0x8c, 0x1e,
|
||||
0x83, 0xaf, 0x2c, 0xdd, 0xf8, 0xd4, 0x1a, 0x74, 0xca, 0x0a, 0x4e, 0xe5, 0xa5, 0xf8, 0x20, 0xa3,
|
||||
0x92, 0x83, 0xee, 0x01, 0xe8, 0x99, 0x7e, 0x97, 0xb1, 0x44, 0x66, 0xd4, 0xed, 0xab, 0xa9, 0x67,
|
||||
0x3a, 0x32, 0x00, 0xbe, 0x0f, 0xad, 0xc3, 0x5c, 0x24, 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xff, 0xfc, 0x65, 0xe3, 0x8b, 0x3f, 0x04, 0x00, 0x00,
|
||||
// 446 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0x4f, 0x6b, 0xd4, 0x40,
|
||||
0x14, 0xdf, 0x69, 0xbb, 0xd9, 0xf6, 0x75, 0xab, 0xe5, 0x35, 0x48, 0x58, 0x4b, 0x94, 0x39, 0x48,
|
||||
0x0f, 0x92, 0xa1, 0xf5, 0xaa, 0x20, 0xd2, 0xa3, 0x07, 0x1b, 0x6f, 0x9e, 0x4c, 0x33, 0x43, 0x1c,
|
||||
0xda, 0x9d, 0x49, 0x33, 0xc9, 0x62, 0x10, 0x2f, 0x7e, 0x02, 0x41, 0xfc, 0x4e, 0x1e, 0x0b, 0x5e,
|
||||
0x3c, 0xca, 0xae, 0x27, 0x3f, 0x85, 0x64, 0x66, 0x52, 0x77, 0x85, 0xba, 0x97, 0x65, 0xdf, 0xef,
|
||||
0xbd, 0xf7, 0xfb, 0xf3, 0x32, 0x80, 0x5c, 0x72, 0x36, 0x3b, 0x66, 0x57, 0x8d, 0xa8, 0xda, 0xa4,
|
||||
0xac, 0x74, 0xad, 0x31, 0xe0, 0x92, 0x27, 0xb3, 0xe3, 0x49, 0xe8, 0x7b, 0x85, 0x50, 0xc2, 0x48,
|
||||
0xe3, 0xba, 0x93, 0xc3, 0x42, 0xeb, 0xe2, 0x52, 0xb0, 0xac, 0x94, 0x2c, 0x53, 0x4a, 0xd7, 0x59,
|
||||
0x2d, 0xb5, 0xf2, 0x5d, 0xfa, 0x16, 0xc6, 0x67, 0x1d, 0x55, 0x2a, 0xae, 0x1a, 0x61, 0x6a, 0xdc,
|
||||
0x87, 0x4d, 0x2e, 0x79, 0x44, 0x1e, 0x92, 0xa3, 0x9d, 0xb4, 0xfb, 0x8b, 0xf7, 0x20, 0xd0, 0x95,
|
||||
0x2c, 0xa4, 0x8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0xc6, 0x5b, 0xe8, 0x0e, 0xff, 0x41, 0x57, 0xee, 0x41, 0xd1, 0xf2, 0x8d, 0x11, 0x58, 0xf7,
|
||||
0x3a, 0x3f, 0x70, 0xc9, 0x3f, 0xe2, 0x73, 0xd8, 0xea, 0x42, 0xe1, 0x41, 0xbf, 0xb9, 0x74, 0x83,
|
||||
0x49, 0xb8, 0x0a, 0x7a, 0x9a, 0x3d, 0x4b, 0x33, 0xa2, 0x43, 0x66, 0x5a, 0x95, 0xbf, 0x78, 0xfa,
|
||||
0x6d, 0x1e, 0x93, 0xeb, 0x79, 0x4c, 0x7e, 0xce, 0x63, 0xf2, 0x79, 0x11, 0x0f, 0xae, 0x17, 0xf1,
|
||||
0xe0, 0xc7, 0x22, 0x1e, 0xbc, 0xa1, 0x85, 0xac, 0xdf, 0x35, 0xe7, 0x49, 0xae, 0xa7, 0x4c, 0x2b,
|
||||
0xa3, 0x55, 0xc5, 0xec, 0xcf, 0x7b, 0xab, 0x5f, 0xb7, 0xa5, 0x30, 0xe7, 0x81, 0x7d, 0xfb, 0x4f,
|
||||
0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0x31, 0x4b, 0x75, 0xe8, 0x4d, 0x03, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -476,10 +407,6 @@ type QueryClient interface {
|
||||
Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
||||
// Resolve queries the DID document by its id.
|
||||
Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error)
|
||||
// Service returns associated ServiceInfo for a given Origin
|
||||
// if the servie is not found, a fingerprint is generated to be used
|
||||
// as a TXT record in DNS. v=sonr, o=origin, p=protocol
|
||||
Service(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error)
|
||||
// Sync queries the DID document by its id. And returns the required PKL information
|
||||
Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error)
|
||||
}
|
||||
@@ -510,15 +437,6 @@ func (c *queryClient) Resolve(ctx context.Context, in *QueryRequest, opts ...grp
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *queryClient) Service(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) {
|
||||
out := new(QueryServiceResponse)
|
||||
err := c.cc.Invoke(ctx, "/did.v1.Query/Service", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *queryClient) Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) {
|
||||
out := new(SyncResponse)
|
||||
err := c.cc.Invoke(ctx, "/did.v1.Query/Sync", in, out, opts...)
|
||||
@@ -534,10 +452,6 @@ type QueryServer interface {
|
||||
Params(context.Context, *QueryRequest) (*QueryParamsResponse, error)
|
||||
// Resolve queries the DID document by its id.
|
||||
Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error)
|
||||
// Service returns associated ServiceInfo for a given Origin
|
||||
// if the servie is not found, a fingerprint is generated to be used
|
||||
// as a TXT record in DNS. v=sonr, o=origin, p=protocol
|
||||
Service(context.Context, *QueryRequest) (*QueryServiceResponse, error)
|
||||
// Sync queries the DID document by its id. And returns the required PKL information
|
||||
Sync(context.Context, *SyncRequest) (*SyncResponse, error)
|
||||
}
|
||||
@@ -552,9 +466,6 @@ func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryRequest)
|
||||
func (*UnimplementedQueryServer) Resolve(ctx context.Context, req *QueryRequest) (*QueryResolveResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented")
|
||||
}
|
||||
func (*UnimplementedQueryServer) Service(ctx context.Context, req *QueryRequest) (*QueryServiceResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Service not implemented")
|
||||
}
|
||||
func (*UnimplementedQueryServer) Sync(ctx context.Context, req *SyncRequest) (*SyncResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented")
|
||||
}
|
||||
@@ -599,24 +510,6 @@ func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(inter
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QueryRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(QueryServer).Service(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/did.v1.Query/Service",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).Service(ctx, req.(*QueryRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Query_Sync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SyncRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -647,10 +540,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{
|
||||
MethodName: "Resolve",
|
||||
Handler: _Query_Resolve_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Service",
|
||||
Handler: _Query_Service_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Sync",
|
||||
Handler: _Query_Sync_Handler,
|
||||
@@ -845,58 +734,6 @@ func (m *QueryResolveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *QueryServiceResponse) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *QueryServiceResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *QueryServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.TxtRecord) > 0 {
|
||||
i -= len(m.TxtRecord)
|
||||
copy(dAtA[i:], m.TxtRecord)
|
||||
i = encodeVarintQuery(dAtA, i, uint64(len(m.TxtRecord)))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
if m.Service != nil {
|
||||
{
|
||||
size, err := m.Service.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintQuery(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.Existing {
|
||||
i--
|
||||
if m.Existing {
|
||||
dAtA[i] = 1
|
||||
} else {
|
||||
dAtA[i] = 0
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *SyncRequest) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
@@ -1046,26 +883,6 @@ func (m *QueryResolveResponse) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *QueryServiceResponse) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.Existing {
|
||||
n += 2
|
||||
}
|
||||
if m.Service != nil {
|
||||
l = m.Service.Size()
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
}
|
||||
l = len(m.TxtRecord)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *SyncRequest) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
@@ -1621,144 +1438,6 @@ func (m *QueryResolveResponse) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *QueryServiceResponse) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: QueryServiceResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: QueryServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Existing", wireType)
|
||||
}
|
||||
var v int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
v |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
m.Existing = bool(v != 0)
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Service == nil {
|
||||
m.Service = &ServiceInfo{}
|
||||
}
|
||||
if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field TxtRecord", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.TxtRecord = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipQuery(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *SyncRequest) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
||||
@@ -141,78 +141,6 @@ func local_request_Query_Resolve_0(ctx context.Context, marshaler runtime.Marsha
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_Query_Service_0 = &utilities.DoubleArray{Encoding: map[string]int{"origin": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
|
||||
)
|
||||
|
||||
func request_Query_Service_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq QueryRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["origin"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "origin")
|
||||
}
|
||||
|
||||
protoReq.Origin, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "origin", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Service_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.Service(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Query_Service_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq QueryRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["origin"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "origin")
|
||||
}
|
||||
|
||||
protoReq.Origin, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "origin", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Service_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.Service(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_Query_Sync_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
@@ -301,29 +229,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Query_Service_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Query_Service_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Query_Service_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Query_Sync_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
@@ -428,26 +333,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Query_Service_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Query_Service_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Query_Service_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Query_Sync_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
@@ -476,8 +361,6 @@ var (
|
||||
|
||||
pattern_Query_Resolve_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 0}, []string{"did"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||
|
||||
pattern_Query_Service_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1}, []string{"service", "origin"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||
|
||||
pattern_Query_Sync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"sync"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||
)
|
||||
|
||||
@@ -486,7 +369,5 @@ var (
|
||||
|
||||
forward_Query_Resolve_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Query_Service_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Query_Sync_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
|
||||
+239
-278
@@ -27,16 +27,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
type Alias struct {
|
||||
// The unique identifier of the alias
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
// The DID of the alias
|
||||
Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"`
|
||||
// The alias of the DID
|
||||
Alias string `protobuf:"bytes,3,opt,name=alias,proto3" json:"alias,omitempty"`
|
||||
Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"`
|
||||
// Origin of the alias
|
||||
Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"`
|
||||
// Permissions of the alias
|
||||
Scopes []string `protobuf:"bytes,5,rep,name=scopes,proto3" json:"scopes,omitempty"`
|
||||
// Expiration of the alias
|
||||
Expiration int64 `protobuf:"varint,6,opt,name=expiration,proto3" json:"expiration,omitempty"`
|
||||
Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Alias) Reset() { *m = Alias{} }
|
||||
@@ -79,16 +73,9 @@ func (m *Alias) GetId() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Alias) GetDid() string {
|
||||
func (m *Alias) GetSubject() string {
|
||||
if m != nil {
|
||||
return m.Did
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Alias) GetAlias() string {
|
||||
if m != nil {
|
||||
return m.Alias
|
||||
return m.Subject
|
||||
}
|
||||
return ""
|
||||
}
|
||||
@@ -100,36 +87,26 @@ func (m *Alias) GetOrigin() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Alias) GetScopes() []string {
|
||||
if m != nil {
|
||||
return m.Scopes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Alias) GetExpiration() int64 {
|
||||
if m != nil {
|
||||
return m.Expiration
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// Controller represents a Sonr DWN Vault
|
||||
type Controller struct {
|
||||
// The unique identifier of the controller
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
// The DID of the controller
|
||||
Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
|
||||
SonrAddress string `protobuf:"bytes,2,opt,name=sonr_address,json=sonrAddress,proto3" json:"sonr_address,omitempty"`
|
||||
// The DID of the controller
|
||||
EthAddress string `protobuf:"bytes,3,opt,name=eth_address,json=ethAddress,proto3" json:"eth_address,omitempty"`
|
||||
// The DID of the controller
|
||||
BtcAddress string `protobuf:"bytes,4,opt,name=btc_address,json=btcAddress,proto3" json:"btc_address,omitempty"`
|
||||
// Aliases of the controller
|
||||
Aliases []*Alias `protobuf:"bytes,3,rep,name=aliases,proto3" json:"aliases,omitempty"`
|
||||
Aliases []string `protobuf:"bytes,5,rep,name=aliases,proto3" json:"aliases,omitempty"`
|
||||
// PubKey is the verification method
|
||||
PublicKey *PubKey `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
|
||||
PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
|
||||
// The vault address or identifier
|
||||
VaultCid string `protobuf:"bytes,5,opt,name=vault_cid,json=vaultCid,proto3" json:"vault_cid,omitempty"`
|
||||
VaultCid string `protobuf:"bytes,7,opt,name=vault_cid,json=vaultCid,proto3" json:"vault_cid,omitempty"`
|
||||
// The Authentications of the controller
|
||||
Authentication []*Credential `protobuf:"bytes,6,rep,name=authentication,proto3" json:"authentication,omitempty"`
|
||||
Authentication []string `protobuf:"bytes,8,rep,name=authentication,proto3" json:"authentication,omitempty"`
|
||||
// The Status of the claims for the controller
|
||||
Status string `protobuf:"bytes,7,opt,name=status,proto3" json:"status,omitempty"`
|
||||
Status string `protobuf:"bytes,9,opt,name=status,proto3" json:"status,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Controller) Reset() { *m = Controller{} }
|
||||
@@ -172,14 +149,28 @@ func (m *Controller) GetId() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Controller) GetAddress() string {
|
||||
func (m *Controller) GetSonrAddress() string {
|
||||
if m != nil {
|
||||
return m.Address
|
||||
return m.SonrAddress
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Controller) GetAliases() []*Alias {
|
||||
func (m *Controller) GetEthAddress() string {
|
||||
if m != nil {
|
||||
return m.EthAddress
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Controller) GetBtcAddress() string {
|
||||
if m != nil {
|
||||
return m.BtcAddress
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Controller) GetAliases() []string {
|
||||
if m != nil {
|
||||
return m.Aliases
|
||||
}
|
||||
@@ -200,7 +191,7 @@ func (m *Controller) GetVaultCid() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Controller) GetAuthentication() []*Credential {
|
||||
func (m *Controller) GetAuthentication() []string {
|
||||
if m != nil {
|
||||
return m.Authentication
|
||||
}
|
||||
@@ -221,15 +212,15 @@ type Verification struct {
|
||||
// The controller of the verification
|
||||
Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"`
|
||||
// The DIDNamespace of the verification
|
||||
Method DIDNamespace `protobuf:"varint,3,opt,name=method,proto3,enum=did.v1.DIDNamespace" json:"method,omitempty"`
|
||||
DidMethod string `protobuf:"bytes,3,opt,name=did_method,json=didMethod,proto3" json:"did_method,omitempty"`
|
||||
// The value of the linked identifier
|
||||
Issuer string `protobuf:"bytes,4,opt,name=issuer,proto3" json:"issuer,omitempty"`
|
||||
// The subject of the verification
|
||||
Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"`
|
||||
// The public key of the verification
|
||||
PublicKey *PubKey `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
|
||||
// The Verification Kind (Authentication, Assertion, CapabilityDelegation, CapabilityInvocation)
|
||||
Kind string `protobuf:"bytes,7,opt,name=kind,proto3" json:"kind,omitempty"`
|
||||
// The Verification Type (Authentication, Assertion, CapabilityDelegation, CapabilityInvocation)
|
||||
VerificationType string `protobuf:"bytes,7,opt,name=verification_type,json=verificationType,proto3" json:"verification_type,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Verification) Reset() { *m = Verification{} }
|
||||
@@ -279,11 +270,11 @@ func (m *Verification) GetController() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Verification) GetMethod() DIDNamespace {
|
||||
func (m *Verification) GetDidMethod() string {
|
||||
if m != nil {
|
||||
return m.Method
|
||||
return m.DidMethod
|
||||
}
|
||||
return DIDNamespace_DID_NAMESPACE_UNSPECIFIED
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Verification) GetIssuer() string {
|
||||
@@ -307,9 +298,9 @@ func (m *Verification) GetPublicKey() *PubKey {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Verification) GetKind() string {
|
||||
func (m *Verification) GetVerificationType() string {
|
||||
if m != nil {
|
||||
return m.Kind
|
||||
return m.VerificationType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
@@ -323,43 +314,42 @@ func init() {
|
||||
func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) }
|
||||
|
||||
var fileDescriptor_f44bb702879c34b4 = []byte{
|
||||
// 561 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0x31, 0x8f, 0xd3, 0x3e,
|
||||
0x18, 0xc6, 0x2f, 0x49, 0x9b, 0xfe, 0xfb, 0xde, 0xff, 0x4a, 0x65, 0x2a, 0x30, 0x87, 0x14, 0xaa,
|
||||
0x0e, 0xd0, 0xa1, 0x34, 0x5c, 0x41, 0x0c, 0x15, 0x0b, 0xf4, 0x16, 0x74, 0x12, 0x42, 0x19, 0x18,
|
||||
0x58, 0x4e, 0x69, 0x6c, 0x5a, 0x73, 0x49, 0x1c, 0xd9, 0x4e, 0x75, 0xfd, 0x12, 0x88, 0x95, 0x85,
|
||||
0xcf, 0xc0, 0xce, 0x17, 0x60, 0x3c, 0x89, 0x85, 0x11, 0xb5, 0xdf, 0x80, 0x4f, 0x80, 0xec, 0x38,
|
||||
0xe5, 0x54, 0x06, 0x96, 0xca, 0xef, 0xe3, 0xa7, 0x7e, 0x9f, 0xf7, 0x17, 0x1b, 0x10, 0x61, 0x24,
|
||||
0x5c, 0x9d, 0x84, 0x52, 0xc5, 0x8a, 0x8e, 0x0b, 0xc1, 0x15, 0x47, 0x3e, 0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0xac, 0x2e, 0xf7, 0xe0, 0xfb, 0xff, 0x82, 0x8f,
|
||||
0xa0, 0x71, 0xc1, 0x72, 0x62, 0x09, 0x99, 0xf5, 0xf4, 0xa9, 0xe1, 0xf3, 0xc8, 0xf2, 0xb9, 0x0f,
|
||||
0xfd, 0x3f, 0xf1, 0x47, 0x55, 0xae, 0x51, 0x15, 0x63, 0x64, 0x9b, 0x9a, 0x9b, 0xd5, 0x7c, 0xf1,
|
||||
0xec, 0xdb, 0x26, 0x70, 0xae, 0x36, 0x81, 0xf3, 0x73, 0x13, 0x38, 0x1f, 0xb7, 0xc1, 0xc1, 0xd5,
|
||||
0x36, 0x38, 0xf8, 0xb1, 0x0d, 0x0e, 0xde, 0x0e, 0x16, 0x4c, 0x2d, 0xcb, 0xf9, 0x38, 0xe1, 0x59,
|
||||
0xc8, 0x73, 0xc9, 0x73, 0x11, 0x9a, 0x9f, 0xcb, 0x50, 0x3f, 0x2a, 0xb5, 0x2e, 0xa8, 0x9c, 0xfb,
|
||||
0xe6, 0x45, 0x3d, 0xfe, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x70, 0x7b, 0x75, 0x51, 0xb3, 0x03, 0x00,
|
||||
0x00,
|
||||
// 557 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xcb, 0x6e, 0xd3, 0x40,
|
||||
0x14, 0xed, 0xd8, 0x79, 0x34, 0x37, 0x55, 0x70, 0x47, 0x55, 0x19, 0x15, 0x30, 0x21, 0x42, 0x55,
|
||||
0x25, 0x42, 0xac, 0xc2, 0x2e, 0x62, 0x53, 0xba, 0xac, 0x90, 0x50, 0x85, 0x58, 0xb0, 0x89, 0x6c,
|
||||
0xcf, 0x90, 0x4c, 0x9b, 0x78, 0x82, 0x67, 0x1c, 0x91, 0x9f, 0x40, 0xac, 0x59, 0xf0, 0x3d, 0x2c,
|
||||
0x2b, 0xb1, 0x61, 0x83, 0x84, 0x92, 0x3f, 0xe0, 0x0b, 0xd0, 0x3c, 0x92, 0x38, 0xed, 0x8a, 0x8d,
|
||||
0xa5, 0x7b, 0xe6, 0x78, 0xce, 0xbd, 0xe7, 0xdc, 0x01, 0x4c, 0x39, 0x8d, 0x66, 0xa7, 0x91, 0x54,
|
||||
0xb1, 0x62, 0xbd, 0x69, 0x2e, 0x94, 0xc0, 0x35, 0xca, 0x69, 0x6f, 0x76, 0x7a, 0x74, 0x3f, 0x15,
|
||||
0x72, 0x22, 0x64, 0x24, 0xf2, 0x89, 0xa6, 0x88, 0x7c, 0x62, 0x09, 0x47, 0x07, 0xee, 0xa7, 0x21,
|
||||
0xcb, 0x98, 0xe4, 0xd2, 0xa2, 0x1d, 0x01, 0xd5, 0xb3, 0x31, 0x8f, 0x25, 0x6e, 0x81, 0xc7, 0x29,
|
||||
0x41, 0x6d, 0x74, 0xd2, 0xb8, 0xf4, 0x38, 0xc5, 0x04, 0xea, 0xb2, 0x48, 0xae, 0x58, 0xaa, 0x88,
|
||||
0x67, 0xc0, 0x55, 0x89, 0x0f, 0xa1, 0x26, 0x72, 0x3e, 0xe4, 0x19, 0xf1, 0xcd, 0x81, 0xab, 0xfa,
|
||||
0x4f, 0xff, 0x7e, 0xff, 0xf9, 0xc5, 0x0f, 0xa1, 0xa2, 0x6f, 0xc2, 0x07, 0xd0, 0x72, 0x3f, 0x74,
|
||||
0xed, 0x79, 0x80, 0x08, 0x22, 0xa8, 0xf3, 0xcd, 0x07, 0x38, 0x17, 0x99, 0xca, 0xc5, 0x78, 0xcc,
|
||||
0xf2, 0x3b, 0xb2, 0x4f, 0x60, 0x4f, 0x8a, 0x2c, 0x1f, 0xc4, 0x94, 0xe6, 0x4c, 0x4a, 0xa7, 0xdd,
|
||||
0xd4, 0xd8, 0x99, 0x85, 0xf0, 0x63, 0x68, 0x32, 0x35, 0x5a, 0x33, 0x6c, 0x13, 0xc0, 0xd4, 0xa8,
|
||||
0x44, 0x48, 0x54, 0xba, 0x26, 0x54, 0x2c, 0x21, 0x51, 0xe9, 0x8a, 0x40, 0xa0, 0x1e, 0xeb, 0xa1,
|
||||
0x99, 0x24, 0xd5, 0xb6, 0xaf, 0x67, 0x73, 0x25, 0x7e, 0x0e, 0x30, 0x2d, 0x92, 0x31, 0x4f, 0x07,
|
||||
0xd7, 0x6c, 0x4e, 0x6a, 0x6d, 0x74, 0xd2, 0x7c, 0xd1, 0xea, 0x59, 0x6b, 0x7b, 0x6f, 0x8b, 0xe4,
|
||||
0x82, 0xcd, 0x2f, 0x1b, 0x96, 0x71, 0xc1, 0xe6, 0xf8, 0x01, 0x34, 0x66, 0x71, 0x31, 0x56, 0x83,
|
||||
0x94, 0x53, 0x52, 0x37, 0x3a, 0xbb, 0x06, 0x38, 0xe7, 0x14, 0x1f, 0x43, 0x2b, 0x2e, 0xd4, 0x88,
|
||||
0x65, 0x8a, 0xa7, 0xb1, 0xe2, 0x22, 0x23, 0xbb, 0x46, 0xec, 0x16, 0xaa, 0xfd, 0xd4, 0x41, 0x16,
|
||||
0x92, 0x34, 0xac, 0x9f, 0xb6, 0xea, 0x7f, 0x32, 0x7e, 0x5e, 0x3b, 0x3f, 0xf1, 0xb6, 0x31, 0xda,
|
||||
0x4d, 0xbc, 0xbf, 0xe5, 0x44, 0xe0, 0x59, 0xa8, 0x34, 0x7b, 0xe0, 0x13, 0x84, 0xef, 0x95, 0x9a,
|
||||
0x0c, 0x2a, 0x04, 0xe1, 0x43, 0x08, 0xac, 0x44, 0x77, 0x83, 0x57, 0x09, 0x22, 0x5e, 0xe7, 0xb7,
|
||||
0x07, 0x7b, 0xef, 0x59, 0xce, 0x3f, 0xae, 0x7a, 0xbb, 0x1d, 0x4f, 0x08, 0x90, 0xae, 0xc3, 0x73,
|
||||
0xe1, 0x94, 0x10, 0xfc, 0x08, 0x80, 0x72, 0x3a, 0x98, 0x30, 0x35, 0x12, 0xd4, 0x45, 0xd3, 0xa0,
|
||||
0x9c, 0xbe, 0x31, 0x80, 0x1e, 0x95, 0x4b, 0x59, 0xb0, 0xdc, 0x85, 0xe2, 0xaa, 0xf2, 0xb2, 0x55,
|
||||
0xb7, 0x97, 0xed, 0x3f, 0x03, 0x79, 0x06, 0xfb, 0xb3, 0x52, 0xff, 0x03, 0x35, 0x9f, 0x32, 0x17,
|
||||
0x4c, 0x50, 0x3e, 0x78, 0x37, 0x9f, 0xb2, 0xfe, 0xd4, 0x18, 0x7c, 0xb5, 0x59, 0x58, 0xdb, 0x4d,
|
||||
0xd7, 0x69, 0x1b, 0x8b, 0x3b, 0xf0, 0x70, 0x33, 0x5e, 0x77, 0x33, 0x5b, 0xd7, 0x72, 0x8d, 0xe7,
|
||||
0xc7, 0xd0, 0xbe, 0x23, 0xba, 0xba, 0x64, 0xc5, 0xf3, 0x09, 0x22, 0xd5, 0xd7, 0xaf, 0x7e, 0x2c,
|
||||
0x42, 0x74, 0xb3, 0x08, 0xd1, 0x9f, 0x45, 0x88, 0xbe, 0x2e, 0xc3, 0x9d, 0x9b, 0x65, 0xb8, 0xf3,
|
||||
0x6b, 0x19, 0xee, 0x7c, 0xe8, 0x0c, 0xb9, 0x1a, 0x15, 0x49, 0x2f, 0x15, 0x93, 0x48, 0x64, 0x3a,
|
||||
0xe9, 0xc8, 0x7c, 0x3e, 0x47, 0xfa, 0xd9, 0xea, 0x1b, 0x65, 0x52, 0x33, 0x4f, 0xf6, 0xe5, 0xbf,
|
||||
0x00, 0x00, 0x00, 0xff, 0xff, 0x58, 0x8d, 0xb9, 0xaa, 0xff, 0x03, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *Alias) Marshal() (dAtA []byte, err error) {
|
||||
@@ -382,38 +372,17 @@ func (m *Alias) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Expiration != 0 {
|
||||
i = encodeVarintState(dAtA, i, uint64(m.Expiration))
|
||||
i--
|
||||
dAtA[i] = 0x30
|
||||
}
|
||||
if len(m.Scopes) > 0 {
|
||||
for iNdEx := len(m.Scopes) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i -= len(m.Scopes[iNdEx])
|
||||
copy(dAtA[i:], m.Scopes[iNdEx])
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Scopes[iNdEx])))
|
||||
i--
|
||||
dAtA[i] = 0x2a
|
||||
}
|
||||
}
|
||||
if len(m.Origin) > 0 {
|
||||
i -= len(m.Origin)
|
||||
copy(dAtA[i:], m.Origin)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Origin)))
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if len(m.Alias) > 0 {
|
||||
i -= len(m.Alias)
|
||||
copy(dAtA[i:], m.Alias)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Alias)))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
if len(m.Did) > 0 {
|
||||
i -= len(m.Did)
|
||||
copy(dAtA[i:], m.Did)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Did)))
|
||||
if len(m.Subject) > 0 {
|
||||
i -= len(m.Subject)
|
||||
copy(dAtA[i:], m.Subject)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Subject)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
@@ -452,20 +421,15 @@ func (m *Controller) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
copy(dAtA[i:], m.Status)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Status)))
|
||||
i--
|
||||
dAtA[i] = 0x3a
|
||||
dAtA[i] = 0x4a
|
||||
}
|
||||
if len(m.Authentication) > 0 {
|
||||
for iNdEx := len(m.Authentication) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.Authentication[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintState(dAtA, i, uint64(size))
|
||||
}
|
||||
i -= len(m.Authentication[iNdEx])
|
||||
copy(dAtA[i:], m.Authentication[iNdEx])
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Authentication[iNdEx])))
|
||||
i--
|
||||
dAtA[i] = 0x32
|
||||
dAtA[i] = 0x42
|
||||
}
|
||||
}
|
||||
if len(m.VaultCid) > 0 {
|
||||
@@ -473,7 +437,7 @@ func (m *Controller) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
copy(dAtA[i:], m.VaultCid)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.VaultCid)))
|
||||
i--
|
||||
dAtA[i] = 0x2a
|
||||
dAtA[i] = 0x3a
|
||||
}
|
||||
if m.PublicKey != nil {
|
||||
{
|
||||
@@ -485,26 +449,35 @@ func (m *Controller) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i = encodeVarintState(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
dAtA[i] = 0x32
|
||||
}
|
||||
if len(m.Aliases) > 0 {
|
||||
for iNdEx := len(m.Aliases) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.Aliases[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintState(dAtA, i, uint64(size))
|
||||
}
|
||||
i -= len(m.Aliases[iNdEx])
|
||||
copy(dAtA[i:], m.Aliases[iNdEx])
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Aliases[iNdEx])))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
dAtA[i] = 0x2a
|
||||
}
|
||||
}
|
||||
if len(m.Address) > 0 {
|
||||
i -= len(m.Address)
|
||||
copy(dAtA[i:], m.Address)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Address)))
|
||||
if len(m.BtcAddress) > 0 {
|
||||
i -= len(m.BtcAddress)
|
||||
copy(dAtA[i:], m.BtcAddress)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.BtcAddress)))
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if len(m.EthAddress) > 0 {
|
||||
i -= len(m.EthAddress)
|
||||
copy(dAtA[i:], m.EthAddress)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.EthAddress)))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
if len(m.SonrAddress) > 0 {
|
||||
i -= len(m.SonrAddress)
|
||||
copy(dAtA[i:], m.SonrAddress)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.SonrAddress)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
@@ -538,10 +511,10 @@ func (m *Verification) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Kind) > 0 {
|
||||
i -= len(m.Kind)
|
||||
copy(dAtA[i:], m.Kind)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Kind)))
|
||||
if len(m.VerificationType) > 0 {
|
||||
i -= len(m.VerificationType)
|
||||
copy(dAtA[i:], m.VerificationType)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.VerificationType)))
|
||||
i--
|
||||
dAtA[i] = 0x3a
|
||||
}
|
||||
@@ -571,10 +544,12 @@ func (m *Verification) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if m.Method != 0 {
|
||||
i = encodeVarintState(dAtA, i, uint64(m.Method))
|
||||
if len(m.DidMethod) > 0 {
|
||||
i -= len(m.DidMethod)
|
||||
copy(dAtA[i:], m.DidMethod)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.DidMethod)))
|
||||
i--
|
||||
dAtA[i] = 0x18
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
if len(m.Controller) > 0 {
|
||||
i -= len(m.Controller)
|
||||
@@ -614,11 +589,7 @@ func (m *Alias) Size() (n int) {
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
l = len(m.Did)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
l = len(m.Alias)
|
||||
l = len(m.Subject)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
@@ -626,15 +597,6 @@ func (m *Alias) Size() (n int) {
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
if len(m.Scopes) > 0 {
|
||||
for _, s := range m.Scopes {
|
||||
l = len(s)
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
}
|
||||
if m.Expiration != 0 {
|
||||
n += 1 + sovState(uint64(m.Expiration))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
@@ -648,13 +610,21 @@ func (m *Controller) Size() (n int) {
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
l = len(m.Address)
|
||||
l = len(m.SonrAddress)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
l = len(m.EthAddress)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
l = len(m.BtcAddress)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
if len(m.Aliases) > 0 {
|
||||
for _, e := range m.Aliases {
|
||||
l = e.Size()
|
||||
for _, s := range m.Aliases {
|
||||
l = len(s)
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
}
|
||||
@@ -667,8 +637,8 @@ func (m *Controller) Size() (n int) {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
if len(m.Authentication) > 0 {
|
||||
for _, e := range m.Authentication {
|
||||
l = e.Size()
|
||||
for _, s := range m.Authentication {
|
||||
l = len(s)
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
}
|
||||
@@ -693,8 +663,9 @@ func (m *Verification) Size() (n int) {
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
if m.Method != 0 {
|
||||
n += 1 + sovState(uint64(m.Method))
|
||||
l = len(m.DidMethod)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
l = len(m.Issuer)
|
||||
if l > 0 {
|
||||
@@ -708,7 +679,7 @@ func (m *Verification) Size() (n int) {
|
||||
l = m.PublicKey.Size()
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
l = len(m.Kind)
|
||||
l = len(m.VerificationType)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
@@ -784,7 +755,7 @@ func (m *Alias) Unmarshal(dAtA []byte) error {
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Did", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -812,41 +783,9 @@ func (m *Alias) Unmarshal(dAtA []byte) error {
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Did = string(dAtA[iNdEx:postIndex])
|
||||
m.Subject = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Alias", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Alias = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType)
|
||||
}
|
||||
@@ -878,57 +817,6 @@ func (m *Alias) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
m.Origin = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Scopes", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Scopes = append(m.Scopes, string(dAtA[iNdEx:postIndex]))
|
||||
iNdEx = postIndex
|
||||
case 6:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType)
|
||||
}
|
||||
m.Expiration = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.Expiration |= int64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipState(dAtA[iNdEx:])
|
||||
@@ -1013,7 +901,7 @@ func (m *Controller) Unmarshal(dAtA []byte) error {
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field SonrAddress", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -1041,13 +929,13 @@ func (m *Controller) Unmarshal(dAtA []byte) error {
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Address = string(dAtA[iNdEx:postIndex])
|
||||
m.SonrAddress = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field EthAddress", wireType)
|
||||
}
|
||||
var msglen int
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
@@ -1057,27 +945,89 @@ func (m *Controller) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Aliases = append(m.Aliases, &Alias{})
|
||||
if err := m.Aliases[len(m.Aliases)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
m.EthAddress = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field BtcAddress", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.BtcAddress = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Aliases = append(m.Aliases, string(dAtA[iNdEx:postIndex]))
|
||||
iNdEx = postIndex
|
||||
case 6:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType)
|
||||
}
|
||||
@@ -1113,7 +1063,7 @@ func (m *Controller) Unmarshal(dAtA []byte) error {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
case 7:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field VaultCid", wireType)
|
||||
}
|
||||
@@ -1145,11 +1095,11 @@ func (m *Controller) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
m.VaultCid = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 6:
|
||||
case 8:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Authentication", wireType)
|
||||
}
|
||||
var msglen int
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
@@ -1159,27 +1109,25 @@ func (m *Controller) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Authentication = append(m.Authentication, &Credential{})
|
||||
if err := m.Authentication[len(m.Authentication)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
m.Authentication = append(m.Authentication, string(dAtA[iNdEx:postIndex]))
|
||||
iNdEx = postIndex
|
||||
case 7:
|
||||
case 9:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
|
||||
}
|
||||
@@ -1326,10 +1274,10 @@ func (m *Verification) Unmarshal(dAtA []byte) error {
|
||||
m.Controller = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType)
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field DidMethod", wireType)
|
||||
}
|
||||
m.Method = 0
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
@@ -1339,11 +1287,24 @@ func (m *Verification) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.Method |= DIDNamespace(b&0x7F) << shift
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.DidMethod = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Issuer", wireType)
|
||||
@@ -1446,7 +1407,7 @@ func (m *Verification) Unmarshal(dAtA []byte) error {
|
||||
iNdEx = postIndex
|
||||
case 7:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field VerificationType", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -1474,7 +1435,7 @@ func (m *Verification) Unmarshal(dAtA []byte) error {
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Kind = string(dAtA[iNdEx:postIndex])
|
||||
m.VerificationType = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
|
||||
+186
-84
@@ -207,7 +207,7 @@ type MsgAllocateVaultResponse struct {
|
||||
// ExpiryBlock is the block number at which the vault will expire.
|
||||
ExpiryBlock int64 `protobuf:"varint,2,opt,name=expiry_block,json=expiryBlock,proto3" json:"expiry_block,omitempty"`
|
||||
// RegistrationOptions is a json string of the PublicKeyCredentialCreationOptions for WebAuthn
|
||||
RegistrationOptions string `protobuf:"bytes,3,opt,name=registration_options,json=registrationOptions,proto3" json:"registration_options,omitempty"`
|
||||
Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
|
||||
// IsLocalhost is a flag to indicate if the vault is localhost
|
||||
Localhost bool `protobuf:"varint,4,opt,name=localhost,proto3" json:"localhost,omitempty"`
|
||||
}
|
||||
@@ -259,9 +259,9 @@ func (m *MsgAllocateVaultResponse) GetExpiryBlock() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *MsgAllocateVaultResponse) GetRegistrationOptions() string {
|
||||
func (m *MsgAllocateVaultResponse) GetToken() string {
|
||||
if m != nil {
|
||||
return m.RegistrationOptions
|
||||
return m.Token
|
||||
}
|
||||
return ""
|
||||
}
|
||||
@@ -417,7 +417,7 @@ type MsgAuthorizeService struct {
|
||||
// Origin is the origin of the request in wildcard form.
|
||||
Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"`
|
||||
// Permissions is the scope of the service.
|
||||
Scopes *Permissions `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"`
|
||||
Permissions map[string]string `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
// token is the macron token to authenticate the operation.
|
||||
Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"`
|
||||
}
|
||||
@@ -469,9 +469,9 @@ func (m *MsgAuthorizeService) GetOrigin() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MsgAuthorizeService) GetScopes() *Permissions {
|
||||
func (m *MsgAuthorizeService) GetPermissions() map[string]string {
|
||||
if m != nil {
|
||||
return m.Scopes
|
||||
return m.Permissions
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -653,6 +653,7 @@ func init() {
|
||||
proto.RegisterType((*MsgRegisterControllerResponse)(nil), "did.v1.MsgRegisterControllerResponse")
|
||||
proto.RegisterMapType((map[string]string)(nil), "did.v1.MsgRegisterControllerResponse.AccountsEntry")
|
||||
proto.RegisterType((*MsgAuthorizeService)(nil), "did.v1.MsgAuthorizeService")
|
||||
proto.RegisterMapType((map[string]string)(nil), "did.v1.MsgAuthorizeService.PermissionsEntry")
|
||||
proto.RegisterType((*MsgAuthorizeServiceResponse)(nil), "did.v1.MsgAuthorizeServiceResponse")
|
||||
proto.RegisterType((*MsgRegisterService)(nil), "did.v1.MsgRegisterService")
|
||||
proto.RegisterType((*MsgRegisterServiceResponse)(nil), "did.v1.MsgRegisterServiceResponse")
|
||||
@@ -661,59 +662,58 @@ func init() {
|
||||
func init() { proto.RegisterFile("did/v1/tx.proto", fileDescriptor_d73284df019ff211) }
|
||||
|
||||
var fileDescriptor_d73284df019ff211 = []byte{
|
||||
// 824 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xbf, 0x8f, 0x1b, 0x45,
|
||||
0x14, 0xbe, 0xb1, 0x1d, 0xe7, 0xfc, 0x7c, 0x17, 0x5b, 0x63, 0xc3, 0x6d, 0x36, 0xc4, 0x31, 0x0b,
|
||||
0x48, 0x26, 0x80, 0xad, 0x73, 0x24, 0x14, 0x05, 0x9a, 0x33, 0x42, 0x8a, 0x84, 0xac, 0xc0, 0x06,
|
||||
0x28, 0xd2, 0x9c, 0xd6, 0xbb, 0xc3, 0x7a, 0xf0, 0x7a, 0x67, 0x35, 0x33, 0xb6, 0xce, 0x54, 0x40,
|
||||
0x89, 0x28, 0xf8, 0x07, 0x90, 0x28, 0x29, 0x53, 0xd0, 0x51, 0xd2, 0xa4, 0x8c, 0xa8, 0xa8, 0x10,
|
||||
0xba, 0x2b, 0xf2, 0x6f, 0xa0, 0xd9, 0xd9, 0x5d, 0xaf, 0x7f, 0x9c, 0x75, 0x84, 0xc6, 0x9e, 0xf7,
|
||||
0xbe, 0x37, 0xdf, 0x7c, 0xdf, 0xcc, 0x9b, 0x59, 0xa8, 0x79, 0xd4, 0xeb, 0xcd, 0x8f, 0x7b, 0xf2,
|
||||
0xac, 0x1b, 0x71, 0x26, 0x19, 0x2e, 0x7b, 0xd4, 0xeb, 0xce, 0x8f, 0xcd, 0x23, 0x97, 0x89, 0x29,
|
||||
0x13, 0xbd, 0xa9, 0xf0, 0x15, 0x3e, 0x15, 0xbe, 0x2e, 0x30, 0x6f, 0x6a, 0xe0, 0x34, 0x8e, 0x7a,
|
||||
0x3a, 0x48, 0xa0, 0x66, 0x42, 0xe6, 0x93, 0x90, 0x08, 0x9a, 0x66, 0x1b, 0x49, 0x76, 0xca, 0x3c,
|
||||
0x12, 0x64, 0xa5, 0x3e, 0xf3, 0x99, 0xa6, 0x50, 0x23, 0x9d, 0xb5, 0x7e, 0x46, 0x50, 0x1b, 0x0a,
|
||||
0xff, 0x8b, 0xc8, 0x73, 0x24, 0xf9, 0xd4, 0xe1, 0xce, 0x54, 0xe0, 0xf7, 0xa1, 0xe2, 0xcc, 0xe4,
|
||||
0x98, 0x71, 0x2a, 0x17, 0x06, 0x6a, 0xa3, 0x4e, 0x65, 0x60, 0xfc, 0xf9, 0xdb, 0x7b, 0xcd, 0x64,
|
||||
0xe5, 0x13, 0xcf, 0xe3, 0x44, 0x88, 0xc7, 0x92, 0xd3, 0xd0, 0xb7, 0x97, 0xa5, 0xf8, 0x5d, 0x28,
|
||||
0x47, 0x31, 0x83, 0x51, 0x68, 0xa3, 0x4e, 0xb5, 0x7f, 0xa3, 0xab, 0x9d, 0x75, 0x35, 0xef, 0xa0,
|
||||
0xf4, 0xec, 0xef, 0x3b, 0x7b, 0x76, 0x52, 0x83, 0x9b, 0x70, 0x4d, 0xb2, 0x09, 0x09, 0x8d, 0xa2,
|
||||
0x5a, 0xc1, 0xd6, 0xc1, 0x83, 0x1b, 0xdf, 0xbf, 0x78, 0x7a, 0x77, 0xc9, 0x69, 0xdd, 0x84, 0xa3,
|
||||
0x35, 0x79, 0x36, 0x11, 0x11, 0x0b, 0x05, 0xb1, 0x7e, 0x44, 0x50, 0x1f, 0x0a, 0xff, 0x24, 0x08,
|
||||
0x98, 0xeb, 0x48, 0xf2, 0xa5, 0x33, 0x0b, 0xe4, 0x4b, 0x6b, 0x37, 0xe0, 0xba, 0x98, 0x8d, 0xbe,
|
||||
0x26, 0xae, 0x8c, 0xc5, 0x57, 0xec, 0x34, 0xc4, 0xaf, 0x42, 0x99, 0x71, 0xea, 0xd3, 0x54, 0x68,
|
||||
0x12, 0x6d, 0x28, 0xfd, 0x05, 0x81, 0xb1, 0x2e, 0x27, 0xd5, 0x8a, 0xeb, 0x50, 0x74, 0xa9, 0xa7,
|
||||
0x05, 0xd9, 0x6a, 0x88, 0x5f, 0x87, 0x03, 0x72, 0x16, 0x51, 0xbe, 0x38, 0x1d, 0x05, 0xcc, 0x9d,
|
||||
0xc4, 0xab, 0x16, 0xed, 0xaa, 0xce, 0x0d, 0x54, 0x0a, 0x1f, 0x43, 0x93, 0x13, 0x9f, 0x0a, 0xc9,
|
||||
0x1d, 0x49, 0x59, 0x78, 0xca, 0x22, 0xf5, 0x27, 0x12, 0x1d, 0x8d, 0x3c, 0xf6, 0x48, 0x43, 0xf8,
|
||||
0x35, 0xa8, 0xa8, 0xe5, 0x83, 0x31, 0x13, 0xd2, 0x28, 0xb5, 0x51, 0x67, 0xdf, 0x5e, 0x26, 0xac,
|
||||
0x3f, 0x10, 0xbc, 0x32, 0x14, 0xbe, 0x1d, 0x4f, 0x24, 0xfc, 0x23, 0x16, 0x4a, 0xce, 0x82, 0x80,
|
||||
0xf0, 0x97, 0xde, 0xb6, 0x16, 0x80, 0x23, 0x04, 0xe1, 0x5a, 0x58, 0xa1, 0x5d, 0xec, 0x1c, 0xd8,
|
||||
0xb9, 0x8c, 0xd2, 0x33, 0x21, 0x0b, 0x31, 0x76, 0x38, 0x51, 0xba, 0x15, 0xbc, 0x4c, 0xe0, 0x37,
|
||||
0xe1, 0x70, 0x4e, 0x38, 0xfd, 0x8a, 0xba, 0x8e, 0x26, 0x28, 0xc5, 0x15, 0xab, 0xc9, 0x8d, 0x8d,
|
||||
0xfe, 0xae, 0x00, 0xb7, 0xb7, 0xba, 0xc8, 0x76, 0x3b, 0x3e, 0x4c, 0xd7, 0x25, 0x42, 0xc4, 0x5e,
|
||||
0xf6, 0xed, 0x34, 0xc4, 0xf7, 0x01, 0xdc, 0xac, 0x5e, 0x9f, 0xf4, 0x0e, 0xa3, 0xb9, 0x5a, 0xfc,
|
||||
0x08, 0xf6, 0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
|
||||
0x0e, 0x56, 0x9e, 0xe7, 0xa3, 0x5c, 0xdf, 0xe5, 0x01, 0xf3, 0xce, 0x25, 0x40, 0xb6, 0xfa, 0xe7,
|
||||
0x50, 0xdf, 0xe8, 0x98, 0x5b, 0xb9, 0x49, 0xeb, 0xa0, 0xf9, 0xc6, 0x0e, 0x30, 0x63, 0xfd, 0x04,
|
||||
0x0e, 0x57, 0xdf, 0x60, 0x23, 0x3f, 0x2b, 0x8f, 0x98, 0xed, 0xcb, 0x90, 0x8c, 0xec, 0x09, 0xe0,
|
||||
0x2d, 0xcf, 0xd3, 0xed, 0x9d, 0x57, 0xcd, 0x7c, 0xeb, 0x4a, 0x37, 0x11, 0x7f, 0x06, 0xb5, 0xf5,
|
||||
0x1e, 0x31, 0xb7, 0xcc, 0x4c, 0xcd, 0x5b, 0x97, 0x63, 0x29, 0xa5, 0x79, 0xed, 0xdb, 0x17, 0x4f,
|
||||
0xef, 0xa2, 0xc1, 0x87, 0xcf, 0xce, 0x5b, 0xe8, 0xf9, 0x79, 0x0b, 0xfd, 0x73, 0xde, 0x42, 0x3f,
|
||||
0x5d, 0xb4, 0xf6, 0x9e, 0x5f, 0xb4, 0xf6, 0xfe, 0xba, 0x68, 0xed, 0x3d, 0xb1, 0x7c, 0x2a, 0xc7,
|
||||
0xb3, 0x51, 0xd7, 0x65, 0xd3, 0x1e, 0x0b, 0x05, 0x0b, 0x79, 0x2f, 0xfe, 0x39, 0xeb, 0xa9, 0x6f,
|
||||
0xb4, 0x5c, 0x44, 0x44, 0x8c, 0xca, 0xf1, 0xa7, 0xf8, 0xde, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff,
|
||||
0xf9, 0xc0, 0x77, 0x8b, 0x1a, 0x08, 0x00, 0x00,
|
||||
// 806 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x6f, 0xfb, 0x44,
|
||||
0x10, 0x8d, 0xe3, 0xfc, 0xf2, 0x6b, 0x26, 0x6d, 0x13, 0x2d, 0x85, 0xba, 0x2e, 0x4d, 0x83, 0x01,
|
||||
0x29, 0x54, 0x25, 0x51, 0x5b, 0x09, 0x55, 0x05, 0x21, 0x35, 0x08, 0xa9, 0x12, 0x0a, 0x14, 0x17,
|
||||
0x38, 0xf4, 0x52, 0x39, 0xf6, 0xe2, 0x2c, 0x71, 0xbc, 0xd1, 0xee, 0x26, 0x6a, 0x38, 0xf1, 0xe7,
|
||||
0x86, 0x38, 0xf0, 0x05, 0xe0, 0xcc, 0xb1, 0x07, 0xbe, 0x01, 0x97, 0x1e, 0x2b, 0x4e, 0x9c, 0x10,
|
||||
0x6a, 0x0f, 0xfd, 0x1a, 0xc8, 0x5e, 0xdb, 0x71, 0xfe, 0x34, 0x6a, 0xcb, 0x25, 0xf2, 0xcc, 0x1b,
|
||||
0xcf, 0xbe, 0x37, 0xf3, 0xb2, 0x86, 0x92, 0x43, 0x9c, 0xc6, 0x70, 0xaf, 0x21, 0x2e, 0xeb, 0x7d,
|
||||
0x46, 0x05, 0x45, 0x79, 0x87, 0x38, 0xf5, 0xe1, 0x9e, 0xbe, 0x6e, 0x53, 0xde, 0xa3, 0xbc, 0xd1,
|
||||
0xe3, 0x6e, 0x80, 0xf7, 0xb8, 0x2b, 0x0b, 0xf4, 0x0d, 0x09, 0x5c, 0x84, 0x51, 0x43, 0x06, 0x11,
|
||||
0xb4, 0x16, 0x35, 0x73, 0xb1, 0x8f, 0x39, 0x49, 0xb2, 0x2e, 0x75, 0xa9, 0xac, 0x0e, 0x9e, 0x64,
|
||||
0xd6, 0xf8, 0x55, 0x81, 0x52, 0x8b, 0xbb, 0x5f, 0xf6, 0x1d, 0x4b, 0xe0, 0x53, 0x8b, 0x59, 0x3d,
|
||||
0x8e, 0xde, 0x83, 0x82, 0x35, 0x10, 0x1d, 0xca, 0x88, 0x18, 0x69, 0x4a, 0x55, 0xa9, 0x15, 0x9a,
|
||||
0xda, 0x5f, 0x7f, 0xbc, 0xbb, 0x16, 0x1d, 0x72, 0xec, 0x38, 0x0c, 0x73, 0x7e, 0x26, 0x18, 0xf1,
|
||||
0x5d, 0x73, 0x5c, 0x8a, 0x76, 0x21, 0xdf, 0x0f, 0x3b, 0x68, 0xd9, 0xaa, 0x52, 0x2b, 0xee, 0xaf,
|
||||
0xd6, 0xa5, 0x88, 0xba, 0xec, 0xdb, 0xcc, 0x5d, 0xff, 0xb3, 0x9d, 0x31, 0xa3, 0x1a, 0xb4, 0x06,
|
||||
0x2f, 0x04, 0xed, 0x62, 0x5f, 0x53, 0x83, 0x13, 0x4c, 0x19, 0x1c, 0xad, 0xfe, 0x70, 0x7f, 0xb5,
|
||||
0x33, 0xee, 0x69, 0x6c, 0xc0, 0xfa, 0x14, 0x3d, 0x13, 0xf3, 0x3e, 0xf5, 0x39, 0x36, 0x7e, 0x56,
|
||||
0xa0, 0xdc, 0xe2, 0xee, 0xb1, 0xe7, 0x51, 0xdb, 0x12, 0xf8, 0x2b, 0x6b, 0xe0, 0x89, 0x67, 0x73,
|
||||
0xd7, 0xe0, 0x25, 0x1f, 0xb4, 0xbf, 0xc1, 0xb6, 0x08, 0xc9, 0x17, 0xcc, 0x38, 0x44, 0xaf, 0x41,
|
||||
0x9e, 0x32, 0xe2, 0x92, 0x98, 0x68, 0x14, 0xcd, 0x30, 0xfd, 0x51, 0x01, 0x6d, 0x9a, 0x4e, 0xcc,
|
||||
0x15, 0x95, 0x41, 0xb5, 0x89, 0x23, 0x09, 0x99, 0xc1, 0x23, 0x7a, 0x03, 0x96, 0xf1, 0x65, 0x9f,
|
||||
0xb0, 0xd1, 0x45, 0xdb, 0xa3, 0x76, 0x37, 0x3c, 0x55, 0x35, 0x8b, 0x32, 0xd7, 0x0c, 0x52, 0xf3,
|
||||
0x27, 0x84, 0x5e, 0x87, 0x42, 0x70, 0x82, 0xd7, 0xa1, 0x5c, 0x68, 0xb9, 0xaa, 0x52, 0x5b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x47, 0x9f, 0x43, 0x69, 0xda, 0x23,
|
||||
0xfa, 0x9c, 0x37, 0x63, 0xf1, 0xc6, 0xc3, 0x58, 0xdc, 0x52, 0x7f, 0xf1, 0xdd, 0xfd, 0xd5, 0x8e,
|
||||
0xd2, 0xfc, 0xe0, 0xfa, 0xb6, 0xa2, 0xdc, 0xdc, 0x56, 0x94, 0x7f, 0x6f, 0x2b, 0xca, 0x2f, 0x77,
|
||||
0x95, 0xcc, 0xcd, 0x5d, 0x25, 0xf3, 0xf7, 0x5d, 0x25, 0x73, 0x6e, 0xb8, 0x44, 0x74, 0x06, 0xed,
|
||||
0xba, 0x4d, 0x7b, 0x0d, 0xea, 0x73, 0xea, 0xb3, 0x46, 0xf8, 0x73, 0xd9, 0x08, 0x3e, 0xf5, 0x62,
|
||||
0xd4, 0xc7, 0xbc, 0x9d, 0x0f, 0x3f, 0xe8, 0x07, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x20, 0x91,
|
||||
0xda, 0xb5, 0x4b, 0x08, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -1100,10 +1100,10 @@ func (m *MsgAllocateVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error
|
||||
i--
|
||||
dAtA[i] = 0x20
|
||||
}
|
||||
if len(m.RegistrationOptions) > 0 {
|
||||
i -= len(m.RegistrationOptions)
|
||||
copy(dAtA[i:], m.RegistrationOptions)
|
||||
i = encodeVarintTx(dAtA, i, uint64(len(m.RegistrationOptions)))
|
||||
if len(m.Token) > 0 {
|
||||
i -= len(m.Token)
|
||||
copy(dAtA[i:], m.Token)
|
||||
i = encodeVarintTx(dAtA, i, uint64(len(m.Token)))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
@@ -1265,17 +1265,24 @@ func (m *MsgAuthorizeService) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if m.Scopes != nil {
|
||||
{
|
||||
size, err := m.Scopes.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintTx(dAtA, i, uint64(size))
|
||||
if len(m.Permissions) > 0 {
|
||||
for k := range m.Permissions {
|
||||
v := m.Permissions[k]
|
||||
baseI := i
|
||||
i -= len(v)
|
||||
copy(dAtA[i:], v)
|
||||
i = encodeVarintTx(dAtA, i, uint64(len(v)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
i -= len(k)
|
||||
copy(dAtA[i:], k)
|
||||
i = encodeVarintTx(dAtA, i, uint64(len(k)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
i = encodeVarintTx(dAtA, i, uint64(baseI-i))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
if len(m.Origin) > 0 {
|
||||
i -= len(m.Origin)
|
||||
@@ -1489,7 +1496,7 @@ func (m *MsgAllocateVaultResponse) Size() (n int) {
|
||||
if m.ExpiryBlock != 0 {
|
||||
n += 1 + sovTx(uint64(m.ExpiryBlock))
|
||||
}
|
||||
l = len(m.RegistrationOptions)
|
||||
l = len(m.Token)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
@@ -1568,9 +1575,13 @@ func (m *MsgAuthorizeService) Size() (n int) {
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
if m.Scopes != nil {
|
||||
l = m.Scopes.Size()
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
if len(m.Permissions) > 0 {
|
||||
for k, v := range m.Permissions {
|
||||
_ = k
|
||||
_ = v
|
||||
mapEntrySize := 1 + len(k) + sovTx(uint64(len(k))) + 1 + len(v) + sovTx(uint64(len(v)))
|
||||
n += mapEntrySize + 1 + sovTx(uint64(mapEntrySize))
|
||||
}
|
||||
}
|
||||
l = len(m.Token)
|
||||
if l > 0 {
|
||||
@@ -2059,7 +2070,7 @@ func (m *MsgAllocateVaultResponse) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field RegistrationOptions", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -2087,7 +2098,7 @@ func (m *MsgAllocateVaultResponse) Unmarshal(dAtA []byte) error {
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.RegistrationOptions = string(dAtA[iNdEx:postIndex])
|
||||
m.Token = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 0 {
|
||||
@@ -2632,7 +2643,7 @@ func (m *MsgAuthorizeService) Unmarshal(dAtA []byte) error {
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Scopes", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -2659,12 +2670,103 @@ func (m *MsgAuthorizeService) Unmarshal(dAtA []byte) error {
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Scopes == nil {
|
||||
m.Scopes = &Permissions{}
|
||||
if m.Permissions == nil {
|
||||
m.Permissions = make(map[string]string)
|
||||
}
|
||||
if err := m.Scopes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
var mapkey string
|
||||
var mapvalue string
|
||||
for iNdEx < postIndex {
|
||||
entryPreIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
if fieldNum == 1 {
|
||||
var stringLenmapkey uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLenmapkey |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLenmapkey := int(stringLenmapkey)
|
||||
if intStringLenmapkey < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
postStringIndexmapkey := iNdEx + intStringLenmapkey
|
||||
if postStringIndexmapkey < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if postStringIndexmapkey > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
|
||||
iNdEx = postStringIndexmapkey
|
||||
} else if fieldNum == 2 {
|
||||
var stringLenmapvalue uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLenmapvalue |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLenmapvalue := int(stringLenmapvalue)
|
||||
if intStringLenmapvalue < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
postStringIndexmapvalue := iNdEx + intStringLenmapvalue
|
||||
if postStringIndexmapvalue < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if postStringIndexmapvalue > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
|
||||
iNdEx = postStringIndexmapvalue
|
||||
} else {
|
||||
iNdEx = entryPreIndex
|
||||
skippy, err := skipTx(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if (iNdEx + skippy) > postIndex {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
m.Permissions[mapkey] = mapvalue
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
|
||||
Reference in New Issue
Block a user