mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
feature/1214 session fetch refactor (#1215)
* chore(docs): remove token economy guide * refactor(context): update GatewayContext to use Querier interface * chore(database): update schema path * docs: Update READMEs for x/did, x/dwn, and x/svc with UCAN integration * chore(pkg): update database scope name * refactor(did): optimize GenesisState proto methods * refactor(svc): update Service proto to use repeated fields * refactor(api): rename MsgSpawn to MsgInitialize
This commit is contained in:
+28
-5
@@ -1,6 +1,6 @@
|
||||
# `x/did`
|
||||
|
||||
The Decentralized Identity module is responsible for managing native Sonr Accounts, their derived wallets, and associated user identification information.
|
||||
The Decentralized Identity module is responsible for managing native Sonr Accounts, their derived wallets, and associated user identification information. This module now incorporates UCAN (User Controlled Authorization Networks) for enhanced authorization and access control.
|
||||
|
||||
## State
|
||||
|
||||
@@ -75,13 +75,13 @@ The DID module defines the following messages:
|
||||
5. MsgUnlinkAuthentication
|
||||
6. MsgUpdateParams
|
||||
|
||||
Each message triggers specific state machine behaviors related to managing DIDs, authentications, assertions, and module parameters.
|
||||
Each message triggers specific state machine behaviors related to managing DIDs, authentications, assertions, and module parameters. These messages now also involve UCAN authorization checks where applicable.
|
||||
|
||||
## Query
|
||||
|
||||
The DID module provides the following query endpoints:
|
||||
|
||||
1. Params: Query all parameters of the module
|
||||
1. Params: Query all parameters of the module, including UCAN-related parameters.
|
||||
2. Resolve: Query the DID document by its ID
|
||||
3. Sign: Sign a message with the DID document
|
||||
4. Verify: Verify a message with the DID document
|
||||
@@ -92,18 +92,41 @@ The module parameters include:
|
||||
- Allowed public keys (map of KeyInfo)
|
||||
- Conveyance preference
|
||||
- Attestation formats
|
||||
- UCAN Authorization Parameters:
|
||||
- `UcanPermissions`: Specifies the required UCAN permissions for various actions within the module.
|
||||
|
||||
## Client
|
||||
|
||||
The module provides gRPC and REST endpoints for all defined messages and queries.
|
||||
|
||||
## UCAN Authorization
|
||||
|
||||
This module utilizes UCAN (User Controlled Authorization Networks) to provide a decentralized and user-centric authorization mechanism. UCANs are self-contained authorization tokens that allow users to delegate specific capabilities to other entities without relying on a central authority.
|
||||
|
||||
### UCAN Integration
|
||||
|
||||
- The module parameters include a `UcanPermissions` field that defines the default UCAN permissions required for actions within the module.
|
||||
- Message handlers in the `MsgServer` perform UCAN authorization checks by:
|
||||
- Retrieving the UCAN permissions from the context (injected by a middleware).
|
||||
- Retrieving the required UCAN permissions from the module parameters.
|
||||
- Verifying that the provided UCAN permissions satisfy the required permissions.
|
||||
- A dedicated middleware is responsible for:
|
||||
- Parsing incoming requests for UCAN tokens.
|
||||
- Verifying UCAN token signatures and validity.
|
||||
- Extracting UCAN permissions.
|
||||
- Injecting UCAN permissions into the context.
|
||||
- UCAN verification logic involves:
|
||||
- Checking UCAN token signatures against the issuer's public key (resolved via the `x/did` module).
|
||||
- Validating token expiration and other constraints.
|
||||
- Parsing token capabilities and extracting relevant permissions.
|
||||
|
||||
## Future Improvements
|
||||
|
||||
Potential future improvements could include:
|
||||
1. Enhanced privacy features for DID operations
|
||||
1. Enhanced privacy features for DID operations, potentially leveraging UCAN capabilities for privacy-preserving authorization.
|
||||
2. Integration with more blockchain networks
|
||||
3. Support for additional key types and cryptographic algorithms
|
||||
4. Improved revocation mechanisms for credentials and assertions
|
||||
4. Improved revocation mechanisms for credentials, assertions, and UCAN tokens.
|
||||
|
||||
## Tests
|
||||
|
||||
|
||||
@@ -43,3 +43,64 @@ func (gs GenesisState) Validate() error {
|
||||
|
||||
return gs.Params.Validate()
|
||||
}
|
||||
|
||||
// Equal checks if two Attenuation are equal
|
||||
func (a *Attenuation) Equal(that *Attenuation) bool {
|
||||
if that == nil {
|
||||
return false
|
||||
}
|
||||
if a.Resource != nil {
|
||||
if that.Resource == nil {
|
||||
return false
|
||||
}
|
||||
if !a.Resource.Equal(that.Resource) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if len(a.Capabilities) != len(that.Capabilities) {
|
||||
return false
|
||||
}
|
||||
for i := range a.Capabilities {
|
||||
if !a.Capabilities[i].Equal(that.Capabilities[i]) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Equal checks if two Capability are equal
|
||||
func (c *Capability) Equal(that *Capability) bool {
|
||||
if that == nil {
|
||||
return false
|
||||
}
|
||||
if c.Name != that.Name {
|
||||
return false
|
||||
}
|
||||
if c.Parent != that.Parent {
|
||||
return false
|
||||
}
|
||||
// TODO: check description
|
||||
if len(c.Resources) != len(that.Resources) {
|
||||
return false
|
||||
}
|
||||
for i := range c.Resources {
|
||||
if c.Resources[i] != that.Resources[i] {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Equal checks if two Resource are equal
|
||||
func (r *Resource) Equal(that *Resource) bool {
|
||||
if that == nil {
|
||||
return false
|
||||
}
|
||||
if r.Kind != that.Kind {
|
||||
return false
|
||||
}
|
||||
if r.Template != that.Template {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
+1015
-145
File diff suppressed because it is too large
Load Diff
+33
-9
@@ -1,6 +1,6 @@
|
||||
# `x/dwn`
|
||||
|
||||
The DWN module is responsible for the management of IPFS deployed Decentralized Web Nodes (DWNs) and their associated data.
|
||||
The DWN module is responsible for the management of IPFS deployed Decentralized Web Nodes (DWNs) and their associated data. This module now incorporates UCAN (User Controlled Authorization Networks) for enhanced authorization and access control.
|
||||
|
||||
## Concepts
|
||||
|
||||
@@ -9,6 +9,7 @@ The DWN module introduces several key concepts:
|
||||
1. Decentralized Web Node (DWN): A distributed network for storing and sharing data.
|
||||
2. Schema: A structure defining the format of various data types in the dwn.
|
||||
3. IPFS Integration: The module can interact with IPFS for decentralized data storage.
|
||||
4. UCAN Authorization: The module utilizes UCANs for a decentralized and user-centric authorization mechanism.
|
||||
|
||||
## State
|
||||
|
||||
@@ -38,6 +39,7 @@ message Params {
|
||||
bool ipfs_active = 1;
|
||||
bool local_registration_enabled = 2;
|
||||
Schema schema = 4;
|
||||
repeated string allowed_operators = 5;
|
||||
}
|
||||
```
|
||||
|
||||
@@ -64,15 +66,15 @@ message Schema {
|
||||
|
||||
State transitions in the DWN module are primarily triggered by:
|
||||
|
||||
1. Updating module parameters
|
||||
2. Allocating new dwns
|
||||
3. Syncing DID documents
|
||||
1. Updating module parameters (including UCAN-related parameters)
|
||||
2. Allocating new dwns (with UCAN authorization checks)
|
||||
3. Syncing DID documents (with UCAN authorization checks)
|
||||
|
||||
## Messages
|
||||
|
||||
The DWN module defines the following message:
|
||||
|
||||
1. `MsgUpdateParams`: Used to update the module parameters.
|
||||
1. `MsgUpdateParams`: Used to update the module parameters, including UCAN permissions.
|
||||
|
||||
```protobuf
|
||||
message MsgUpdateParams {
|
||||
@@ -89,22 +91,43 @@ No specific begin-block operations are defined for this module.
|
||||
|
||||
No specific end-block operations are defined for this module.
|
||||
|
||||
## UCAN Authorization
|
||||
|
||||
This module utilizes UCAN (User Controlled Authorization Networks) to provide a decentralized and user-centric authorization mechanism. UCANs are self-contained authorization tokens that allow users to delegate specific capabilities to other entities without relying on a central authority.
|
||||
|
||||
### UCAN Integration
|
||||
|
||||
- The module parameters include a `UcanPermissions` field that defines the default UCAN permissions required for actions within the module, such as allocating new DWNs or syncing DID documents.
|
||||
- Message handlers in the `MsgServer` perform UCAN authorization checks by:
|
||||
- Retrieving the UCAN permissions from the context (injected by a middleware).
|
||||
- Retrieving the required UCAN permissions from the module parameters.
|
||||
- Verifying that the provided UCAN permissions satisfy the required permissions.
|
||||
- A dedicated middleware is responsible for:
|
||||
- Parsing incoming requests for UCAN tokens.
|
||||
- Verifying UCAN token signatures and validity.
|
||||
- Extracting UCAN permissions.
|
||||
- Injecting UCAN permissions into the context.
|
||||
- UCAN verification logic involves:
|
||||
- Checking UCAN token signatures against the issuer's public key (resolved via the `x/did` module).
|
||||
- Validating token expiration and other constraints.
|
||||
- Parsing token capabilities and extracting relevant permissions.
|
||||
|
||||
## Hooks
|
||||
|
||||
The DWN module does not define any hooks.
|
||||
|
||||
## Events
|
||||
|
||||
The DWN module does not explicitly define any events. However, standard Cosmos SDK events may be emitted during state transitions.
|
||||
The DWN module does not explicitly define any events. However, standard Cosmos SDK events may be emitted during state transitions, including those related to UCAN authorization.
|
||||
|
||||
## Client
|
||||
|
||||
The DWN module provides the following gRPC query endpoints:
|
||||
|
||||
1. `Params`: Queries all parameters of the module.
|
||||
1. `Params`: Queries all parameters of the module, including UCAN-related parameters.
|
||||
2. `Schema`: Queries the DID document schema.
|
||||
3. `Allocate`: Initializes a Target DWN available for claims.
|
||||
4. `Sync`: Queries the DID document by its ID and returns required information.
|
||||
3. `Allocate`: Initializes a Target DWN available for claims (subject to UCAN authorization).
|
||||
4. `Sync`: Queries the DID document by its ID and returns required information (subject to UCAN authorization).
|
||||
|
||||
## Params
|
||||
|
||||
@@ -113,6 +136,7 @@ The module parameters include:
|
||||
- `ipfs_active` (bool): Indicates if IPFS integration is active.
|
||||
- `local_registration_enabled` (bool): Indicates if local registration is enabled.
|
||||
- `schema` (Schema): Defines the structure for various data types in the dwn.
|
||||
- `UcanPermissions`: Specifies the required UCAN permissions for various actions within the module.
|
||||
|
||||
## Future Improvements
|
||||
|
||||
|
||||
@@ -34,10 +34,3 @@ func (ms msgServer) Initialize(ctx context.Context, msg *types.MsgInitialize) (*
|
||||
panic("Initialize is unimplemented")
|
||||
return &types.MsgInitializeResponse{}, nil
|
||||
}
|
||||
|
||||
// Spawn implements types.MsgServer.
|
||||
func (ms msgServer) Spawn(ctx context.Context, msg *types.MsgSpawn) (*types.MsgSpawnResponse, error) {
|
||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
panic("Spawn is unimplemented")
|
||||
return &types.MsgSpawnResponse{}, nil
|
||||
}
|
||||
|
||||
+72
-72
@@ -133,7 +133,7 @@ var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo
|
||||
// operation that must be performed interacting with the Vault.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
type MsgSpawn struct {
|
||||
type MsgInitialize struct {
|
||||
// authority is the address of the governance account.
|
||||
Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
|
||||
// params defines the parameters to update.
|
||||
@@ -142,18 +142,18 @@ type MsgSpawn struct {
|
||||
Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
|
||||
}
|
||||
|
||||
func (m *MsgSpawn) Reset() { *m = MsgSpawn{} }
|
||||
func (m *MsgSpawn) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgSpawn) ProtoMessage() {}
|
||||
func (*MsgSpawn) Descriptor() ([]byte, []int) {
|
||||
func (m *MsgInitialize) Reset() { *m = MsgInitialize{} }
|
||||
func (m *MsgInitialize) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgInitialize) ProtoMessage() {}
|
||||
func (*MsgInitialize) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_32d2464465560de7, []int{2}
|
||||
}
|
||||
func (m *MsgSpawn) XXX_Unmarshal(b []byte) error {
|
||||
func (m *MsgInitialize) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgSpawn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
func (m *MsgInitialize) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgSpawn.Marshal(b, m, deterministic)
|
||||
return xxx_messageInfo_MsgInitialize.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
@@ -163,26 +163,26 @@ func (m *MsgSpawn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *MsgSpawn) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgSpawn.Merge(m, src)
|
||||
func (m *MsgInitialize) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgInitialize.Merge(m, src)
|
||||
}
|
||||
func (m *MsgSpawn) XXX_Size() int {
|
||||
func (m *MsgInitialize) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgSpawn) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgSpawn.DiscardUnknown(m)
|
||||
func (m *MsgInitialize) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgInitialize.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgSpawn proto.InternalMessageInfo
|
||||
var xxx_messageInfo_MsgInitialize proto.InternalMessageInfo
|
||||
|
||||
func (m *MsgSpawn) GetAuthority() string {
|
||||
func (m *MsgInitialize) GetAuthority() string {
|
||||
if m != nil {
|
||||
return m.Authority
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MsgSpawn) GetParams() Params {
|
||||
func (m *MsgInitialize) GetParams() Params {
|
||||
if m != nil {
|
||||
return m.Params
|
||||
}
|
||||
@@ -193,21 +193,21 @@ func (m *MsgSpawn) GetParams() Params {
|
||||
// MsgSpawn message.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
type MsgSpawnResponse struct {
|
||||
type MsgInitializeResponse struct {
|
||||
}
|
||||
|
||||
func (m *MsgSpawnResponse) Reset() { *m = MsgSpawnResponse{} }
|
||||
func (m *MsgSpawnResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgSpawnResponse) ProtoMessage() {}
|
||||
func (*MsgSpawnResponse) Descriptor() ([]byte, []int) {
|
||||
func (m *MsgInitializeResponse) Reset() { *m = MsgInitializeResponse{} }
|
||||
func (m *MsgInitializeResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgInitializeResponse) ProtoMessage() {}
|
||||
func (*MsgInitializeResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_32d2464465560de7, []int{3}
|
||||
}
|
||||
func (m *MsgSpawnResponse) XXX_Unmarshal(b []byte) error {
|
||||
func (m *MsgInitializeResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgSpawnResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
func (m *MsgInitializeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgSpawnResponse.Marshal(b, m, deterministic)
|
||||
return xxx_messageInfo_MsgInitializeResponse.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
@@ -217,29 +217,29 @@ func (m *MsgSpawnResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, er
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *MsgSpawnResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgSpawnResponse.Merge(m, src)
|
||||
func (m *MsgInitializeResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgInitializeResponse.Merge(m, src)
|
||||
}
|
||||
func (m *MsgSpawnResponse) XXX_Size() int {
|
||||
func (m *MsgInitializeResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgSpawnResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgSpawnResponse.DiscardUnknown(m)
|
||||
func (m *MsgInitializeResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgInitializeResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgSpawnResponse proto.InternalMessageInfo
|
||||
var xxx_messageInfo_MsgInitializeResponse proto.InternalMessageInfo
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*MsgUpdateParams)(nil), "dwn.v1.MsgUpdateParams")
|
||||
proto.RegisterType((*MsgUpdateParamsResponse)(nil), "dwn.v1.MsgUpdateParamsResponse")
|
||||
proto.RegisterType((*MsgSpawn)(nil), "dwn.v1.MsgSpawn")
|
||||
proto.RegisterType((*MsgSpawnResponse)(nil), "dwn.v1.MsgSpawnResponse")
|
||||
proto.RegisterType((*MsgInitialize)(nil), "dwn.v1.MsgInitialize")
|
||||
proto.RegisterType((*MsgInitializeResponse)(nil), "dwn.v1.MsgInitializeResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("dwn/v1/tx.proto", fileDescriptor_32d2464465560de7) }
|
||||
|
||||
var fileDescriptor_32d2464465560de7 = []byte{
|
||||
// 356 bytes of a gzipped FileDescriptorProto
|
||||
// 361 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4f, 0x29, 0xcf, 0xd3,
|
||||
0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4b, 0x29, 0xcf,
|
||||
0xd3, 0x2b, 0x33, 0x94, 0x12, 0x4f, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0xcf, 0x2d, 0x4e, 0x07,
|
||||
@@ -252,17 +252,17 @@ var fileDescriptor_32d2464465560de7 = []byte{
|
||||
0xca, 0xcc, 0x4b, 0x0f, 0x42, 0x28, 0x15, 0xd2, 0xe1, 0x62, 0x2b, 0x00, 0x9b, 0x20, 0xc1, 0xa4,
|
||||
0xc0, 0xa8, 0xc1, 0x6d, 0xc4, 0xa7, 0x07, 0xf1, 0x84, 0x1e, 0xc4, 0x5c, 0x27, 0x96, 0x13, 0xf7,
|
||||
0xe4, 0x19, 0x82, 0xa0, 0x6a, 0xac, 0xf8, 0x9a, 0x9e, 0x6f, 0xd0, 0x42, 0xe8, 0x56, 0x92, 0xe4,
|
||||
0x12, 0x47, 0x73, 0x48, 0x50, 0x6a, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x52, 0x03, 0x23, 0x17,
|
||||
0x87, 0x6f, 0x71, 0x7a, 0x70, 0x41, 0x62, 0x79, 0xde, 0x00, 0xb9, 0x4e, 0x88, 0x4b, 0x00, 0xe6,
|
||||
0x02, 0x98, 0xb3, 0x8c, 0xba, 0x19, 0xb9, 0x98, 0x7d, 0x8b, 0xd3, 0x85, 0x3c, 0xb8, 0x78, 0x50,
|
||||
0xc2, 0x4f, 0x1c, 0x66, 0x32, 0x9a, 0x7f, 0xa4, 0xe4, 0x71, 0x48, 0xc0, 0x4c, 0x14, 0x32, 0xe6,
|
||||
0x62, 0x85, 0x78, 0x52, 0x00, 0x49, 0x25, 0x58, 0x44, 0x4a, 0x02, 0x5d, 0x04, 0xa6, 0x49, 0x8a,
|
||||
0xb5, 0xe1, 0xf9, 0x06, 0x2d, 0x46, 0x27, 0x9b, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63,
|
||||
0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96,
|
||||
0x63, 0x88, 0x52, 0x4a, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0xcf, 0xcf,
|
||||
0x2b, 0xce, 0xcf, 0x2b, 0xd2, 0x07, 0x13, 0x15, 0xfa, 0xa0, 0x34, 0x54, 0x52, 0x59, 0x90, 0x5a,
|
||||
0x9c, 0xc4, 0x06, 0x4e, 0x0e, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x38, 0x9d, 0x99, 0x0f,
|
||||
0x89, 0x02, 0x00, 0x00,
|
||||
0x12, 0x47, 0x73, 0x48, 0x50, 0x6a, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x52, 0x2b, 0x23, 0x17,
|
||||
0xaf, 0x6f, 0x71, 0xba, 0x67, 0x5e, 0x66, 0x49, 0x66, 0x62, 0x4e, 0x66, 0x55, 0xea, 0x00, 0x39,
|
||||
0x51, 0x9c, 0x4b, 0x14, 0xc5, 0x19, 0x30, 0x07, 0x1a, 0xcd, 0x62, 0xe4, 0x62, 0xf6, 0x2d, 0x4e,
|
||||
0x17, 0xf2, 0xe0, 0xe2, 0x41, 0x09, 0x49, 0x71, 0x98, 0xf1, 0x68, 0x3e, 0x93, 0x92, 0xc7, 0x21,
|
||||
0x01, 0x33, 0x51, 0xc8, 0x89, 0x8b, 0x0b, 0xc9, 0xbb, 0xa2, 0x48, 0xca, 0x11, 0xc2, 0x52, 0xb2,
|
||||
0x58, 0x85, 0x61, 0x66, 0x48, 0xb1, 0x36, 0x3c, 0xdf, 0xa0, 0xc5, 0xe8, 0x64, 0x73, 0xe2, 0x91,
|
||||
0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1,
|
||||
0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x4a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a,
|
||||
0xc9, 0xf9, 0xb9, 0xfa, 0xf9, 0x79, 0xc5, 0xf9, 0x79, 0x45, 0xfa, 0x60, 0xa2, 0x42, 0x1f, 0x94,
|
||||
0xb8, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xe9, 0xc4, 0x18, 0x10, 0x00, 0x00, 0xff,
|
||||
0xff, 0xbb, 0x62, 0x4e, 0x8b, 0xa2, 0x02, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -282,7 +282,7 @@ type MsgClient interface {
|
||||
// Since: cosmos-sdk 0.47
|
||||
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
||||
// Spawn spawns a new Vault
|
||||
Spawn(ctx context.Context, in *MsgSpawn, opts ...grpc.CallOption) (*MsgSpawnResponse, error)
|
||||
Initialize(ctx context.Context, in *MsgInitialize, opts ...grpc.CallOption) (*MsgInitializeResponse, error)
|
||||
}
|
||||
|
||||
type msgClient struct {
|
||||
@@ -302,9 +302,9 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) Spawn(ctx context.Context, in *MsgSpawn, opts ...grpc.CallOption) (*MsgSpawnResponse, error) {
|
||||
out := new(MsgSpawnResponse)
|
||||
err := c.cc.Invoke(ctx, "/dwn.v1.Msg/Spawn", in, out, opts...)
|
||||
func (c *msgClient) Initialize(ctx context.Context, in *MsgInitialize, opts ...grpc.CallOption) (*MsgInitializeResponse, error) {
|
||||
out := new(MsgInitializeResponse)
|
||||
err := c.cc.Invoke(ctx, "/dwn.v1.Msg/Initialize", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -318,7 +318,7 @@ type MsgServer interface {
|
||||
// Since: cosmos-sdk 0.47
|
||||
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||
// Spawn spawns a new Vault
|
||||
Spawn(context.Context, *MsgSpawn) (*MsgSpawnResponse, error)
|
||||
Initialize(context.Context, *MsgInitialize) (*MsgInitializeResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedMsgServer can be embedded to have forward compatible implementations.
|
||||
@@ -328,8 +328,8 @@ type UnimplementedMsgServer struct {
|
||||
func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
||||
}
|
||||
func (*UnimplementedMsgServer) Spawn(ctx context.Context, req *MsgSpawn) (*MsgSpawnResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Spawn not implemented")
|
||||
func (*UnimplementedMsgServer) Initialize(ctx context.Context, req *MsgInitialize) (*MsgInitializeResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Initialize not implemented")
|
||||
}
|
||||
|
||||
func RegisterMsgServer(s grpc1.Server, srv MsgServer) {
|
||||
@@ -354,20 +354,20 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_Spawn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgSpawn)
|
||||
func _Msg_Initialize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgInitialize)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).Spawn(ctx, in)
|
||||
return srv.(MsgServer).Initialize(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/dwn.v1.Msg/Spawn",
|
||||
FullMethod: "/dwn.v1.Msg/Initialize",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).Spawn(ctx, req.(*MsgSpawn))
|
||||
return srv.(MsgServer).Initialize(ctx, req.(*MsgInitialize))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -382,8 +382,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||
Handler: _Msg_UpdateParams_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Spawn",
|
||||
Handler: _Msg_Spawn_Handler,
|
||||
MethodName: "Initialize",
|
||||
Handler: _Msg_Initialize_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
@@ -453,7 +453,7 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgSpawn) Marshal() (dAtA []byte, err error) {
|
||||
func (m *MsgInitialize) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
@@ -463,12 +463,12 @@ func (m *MsgSpawn) Marshal() (dAtA []byte, err error) {
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *MsgSpawn) MarshalTo(dAtA []byte) (int, error) {
|
||||
func (m *MsgInitialize) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgSpawn) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
func (m *MsgInitialize) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
@@ -493,7 +493,7 @@ func (m *MsgSpawn) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgSpawnResponse) Marshal() (dAtA []byte, err error) {
|
||||
func (m *MsgInitializeResponse) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
@@ -503,12 +503,12 @@ func (m *MsgSpawnResponse) Marshal() (dAtA []byte, err error) {
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *MsgSpawnResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
func (m *MsgInitializeResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgSpawnResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
func (m *MsgInitializeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
@@ -551,7 +551,7 @@ func (m *MsgUpdateParamsResponse) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgSpawn) Size() (n int) {
|
||||
func (m *MsgInitialize) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
@@ -566,7 +566,7 @@ func (m *MsgSpawn) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgSpawnResponse) Size() (n int) {
|
||||
func (m *MsgInitializeResponse) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
@@ -746,7 +746,7 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *MsgSpawn) Unmarshal(dAtA []byte) error {
|
||||
func (m *MsgInitialize) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
@@ -769,10 +769,10 @@ func (m *MsgSpawn) Unmarshal(dAtA []byte) error {
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: MsgSpawn: wiretype end group for non-group")
|
||||
return fmt.Errorf("proto: MsgInitialize: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgSpawn: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
return fmt.Errorf("proto: MsgInitialize: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
@@ -861,7 +861,7 @@ func (m *MsgSpawn) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *MsgSpawnResponse) Unmarshal(dAtA []byte) error {
|
||||
func (m *MsgInitializeResponse) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
@@ -884,10 +884,10 @@ func (m *MsgSpawnResponse) Unmarshal(dAtA []byte) error {
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: MsgSpawnResponse: wiretype end group for non-group")
|
||||
return fmt.Errorf("proto: MsgInitializeResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgSpawnResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
return fmt.Errorf("proto: MsgInitializeResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
default:
|
||||
|
||||
+29
-6
@@ -1,12 +1,13 @@
|
||||
# `x/svc`
|
||||
|
||||
The svc module is responsible for managing the registration and authorization of services within the Sonr ecosystem. It provides a secure and verifiable mechanism for registering and authorizing services using Decentralized Identifiers (DIDs).
|
||||
The svc module is responsible for managing the registration and authorization of services within the Sonr ecosystem. It provides a secure and verifiable mechanism for registering and authorizing services using Decentralized Identifiers (DIDs) and now incorporates UCAN (User Controlled Authorization Networks) for enhanced authorization capabilities.
|
||||
|
||||
## Concepts
|
||||
|
||||
- **Service**: A decentralized svc on the Sonr Blockchain with properties such as ID, authority, origin, name, description, category, tags, and expiry height.
|
||||
- **Profile**: Represents a DID alias with properties like ID, subject, origin, and controller.
|
||||
- **Metadata**: Contains information about a svc, including name, description, category, icon, and tags.
|
||||
- **UCAN Authorization**: The module utilizes UCANs for a decentralized and user-centric authorization mechanism.
|
||||
|
||||
### Dependencies
|
||||
|
||||
@@ -38,11 +39,11 @@ Stores DID alias information:
|
||||
|
||||
### MsgUpdateParams
|
||||
|
||||
Updates the module parameters. Can only be executed by the governance account.
|
||||
Updates the module parameters, including UCAN-related parameters. Can only be executed by the governance account.
|
||||
|
||||
### MsgRegisterService
|
||||
|
||||
Registers a new svc on the blockchain. Requires a valid TXT record in DNS for the origin.
|
||||
Registers a new svc on the blockchain. Requires a valid TXT record in DNS for the origin and may be subject to UCAN authorization checks.
|
||||
|
||||
## Params
|
||||
|
||||
@@ -50,6 +51,7 @@ The module has the following parameters:
|
||||
|
||||
- `categories`: List of allowed svc categories
|
||||
- `types`: List of allowed svc types
|
||||
- `UcanPermissions`: Specifies the required UCAN permissions for various actions within the module, such as registering a service.
|
||||
|
||||
## Query
|
||||
|
||||
@@ -57,7 +59,7 @@ The module provides the following query:
|
||||
|
||||
### Params
|
||||
|
||||
Retrieves all parameters of the module.
|
||||
Retrieves all parameters of the module, including UCAN-related parameters.
|
||||
|
||||
## Client
|
||||
|
||||
@@ -65,7 +67,7 @@ Retrieves all parameters of the module.
|
||||
|
||||
The module provides a gRPC Query svc with the following RPC:
|
||||
|
||||
- `Params`: Get all parameters of the module
|
||||
- `Params`: Get all parameters of the module, including UCAN-related parameters.
|
||||
|
||||
### CLI
|
||||
|
||||
@@ -73,7 +75,28 @@ The module provides a gRPC Query svc with the following RPC:
|
||||
|
||||
## Events
|
||||
|
||||
(TODO: List and describe event tags used by the module)
|
||||
(TODO: List and describe event tags used by the module, including those related to UCAN authorization)
|
||||
|
||||
## UCAN Authorization
|
||||
|
||||
This module utilizes UCAN (User Controlled Authorization Networks) to provide a decentralized and user-centric authorization mechanism. UCANs are self-contained authorization tokens that allow users to delegate specific capabilities to other entities without relying on a central authority.
|
||||
|
||||
### UCAN Integration
|
||||
|
||||
- The module parameters include a `UcanPermissions` field that defines the default UCAN permissions required for actions within the module.
|
||||
- Message handlers in the `MsgServer` perform UCAN authorization checks by:
|
||||
- Retrieving the UCAN permissions from the context (injected by a middleware).
|
||||
- Retrieving the required UCAN permissions from the module parameters.
|
||||
- Verifying that the provided UCAN permissions satisfy the required permissions.
|
||||
- A dedicated middleware is responsible for:
|
||||
- Parsing incoming requests for UCAN tokens.
|
||||
- Verifying UCAN token signatures and validity.
|
||||
- Extracting UCAN permissions.
|
||||
- Injecting UCAN permissions into the context.
|
||||
- UCAN verification logic involves:
|
||||
- Checking UCAN token signatures against the issuer's public key (resolved via the `x/did` module).
|
||||
- Validating token expiration and other constraints.
|
||||
- Parsing token capabilities and extracting relevant permissions.
|
||||
|
||||
## Future Improvements
|
||||
|
||||
|
||||
@@ -28,3 +28,17 @@ func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*type
|
||||
|
||||
return &types.QueryParamsResponse{Params: &p}, nil
|
||||
}
|
||||
|
||||
// OriginExists implements types.QueryServer.
|
||||
func (k Querier) OriginExists(goCtx context.Context, req *types.QueryOriginExistsRequest) (*types.QueryOriginExistsResponse, error) {
|
||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
panic("OriginExists is unimplemented")
|
||||
return &types.QueryOriginExistsResponse{}, nil
|
||||
}
|
||||
|
||||
// ResolveOrigin implements types.QueryServer.
|
||||
func (k Querier) ResolveOrigin(goCtx context.Context, req *types.QueryResolveOriginRequest) (*types.QueryResolveOriginResponse, error) {
|
||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
panic("ResolveOrigin is unimplemented")
|
||||
return &types.QueryResolveOriginResponse{}, nil
|
||||
}
|
||||
|
||||
+61
-2
@@ -6,7 +6,6 @@ const DefaultIndex uint64 = 1
|
||||
// DefaultGenesis returns the default genesis state
|
||||
func DefaultGenesis() *GenesisState {
|
||||
return &GenesisState{
|
||||
|
||||
Params: DefaultParams(),
|
||||
}
|
||||
}
|
||||
@@ -14,6 +13,66 @@ func DefaultGenesis() *GenesisState {
|
||||
// Validate performs basic genesis state validation returning an error upon any
|
||||
// failure.
|
||||
func (gs GenesisState) Validate() error {
|
||||
|
||||
return gs.Params.Validate()
|
||||
}
|
||||
|
||||
// Equal checks if two Attenuation are equal
|
||||
func (a *Attenuation) Equal(that *Attenuation) bool {
|
||||
if that == nil {
|
||||
return false
|
||||
}
|
||||
if a.Resource != nil {
|
||||
if that.Resource == nil {
|
||||
return false
|
||||
}
|
||||
if !a.Resource.Equal(that.Resource) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if len(a.Capabilities) != len(that.Capabilities) {
|
||||
return false
|
||||
}
|
||||
for i := range a.Capabilities {
|
||||
if !a.Capabilities[i].Equal(that.Capabilities[i]) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Equal checks if two Capability are equal
|
||||
func (c *Capability) Equal(that *Capability) bool {
|
||||
if that == nil {
|
||||
return false
|
||||
}
|
||||
if c.Name != that.Name {
|
||||
return false
|
||||
}
|
||||
if c.Parent != that.Parent {
|
||||
return false
|
||||
}
|
||||
// TODO: check description
|
||||
if len(c.Resources) != len(that.Resources) {
|
||||
return false
|
||||
}
|
||||
for i := range c.Resources {
|
||||
if c.Resources[i] != that.Resources[i] {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Equal checks if two Resource are equal
|
||||
func (r *Resource) Equal(that *Resource) bool {
|
||||
if that == nil {
|
||||
return false
|
||||
}
|
||||
if r.Kind != that.Kind {
|
||||
return false
|
||||
}
|
||||
if r.Template != that.Template {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
+639
-291
File diff suppressed because it is too large
Load Diff
@@ -25,3 +25,5 @@ func (p Params) Validate() error {
|
||||
// TODO:
|
||||
return nil
|
||||
}
|
||||
|
||||
// DefaultAttenuations returns the default Attenuation
|
||||
|
||||
+789
-17
@@ -111,31 +111,228 @@ func (m *QueryParamsResponse) GetParams() *Params {
|
||||
return nil
|
||||
}
|
||||
|
||||
// QueryOriginExistsRequest is the request type for the Query/OriginExists RPC method.
|
||||
type QueryOriginExistsRequest struct {
|
||||
// origin is the origin to query.
|
||||
Origin string `protobuf:"bytes,1,opt,name=origin,proto3" json:"origin,omitempty"`
|
||||
}
|
||||
|
||||
func (m *QueryOriginExistsRequest) Reset() { *m = QueryOriginExistsRequest{} }
|
||||
func (m *QueryOriginExistsRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryOriginExistsRequest) ProtoMessage() {}
|
||||
func (*QueryOriginExistsRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_81a1010cdbf4bc9c, []int{2}
|
||||
}
|
||||
func (m *QueryOriginExistsRequest) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *QueryOriginExistsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_QueryOriginExistsRequest.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 *QueryOriginExistsRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_QueryOriginExistsRequest.Merge(m, src)
|
||||
}
|
||||
func (m *QueryOriginExistsRequest) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *QueryOriginExistsRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_QueryOriginExistsRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_QueryOriginExistsRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *QueryOriginExistsRequest) GetOrigin() string {
|
||||
if m != nil {
|
||||
return m.Origin
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// QueryOriginExistsResponse is the response type for the Query/OriginExists RPC method.
|
||||
type QueryOriginExistsResponse struct {
|
||||
// exists is the boolean value representing whether the origin exists.
|
||||
Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"`
|
||||
}
|
||||
|
||||
func (m *QueryOriginExistsResponse) Reset() { *m = QueryOriginExistsResponse{} }
|
||||
func (m *QueryOriginExistsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryOriginExistsResponse) ProtoMessage() {}
|
||||
func (*QueryOriginExistsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_81a1010cdbf4bc9c, []int{3}
|
||||
}
|
||||
func (m *QueryOriginExistsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *QueryOriginExistsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_QueryOriginExistsResponse.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 *QueryOriginExistsResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_QueryOriginExistsResponse.Merge(m, src)
|
||||
}
|
||||
func (m *QueryOriginExistsResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *QueryOriginExistsResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_QueryOriginExistsResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_QueryOriginExistsResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *QueryOriginExistsResponse) GetExists() bool {
|
||||
if m != nil {
|
||||
return m.Exists
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// QueryResolveOriginRequest is the request type for the Query/ResolveOrigin RPC method.
|
||||
type QueryResolveOriginRequest struct {
|
||||
// origin is the origin to query.
|
||||
Origin string `protobuf:"bytes,1,opt,name=origin,proto3" json:"origin,omitempty"`
|
||||
}
|
||||
|
||||
func (m *QueryResolveOriginRequest) Reset() { *m = QueryResolveOriginRequest{} }
|
||||
func (m *QueryResolveOriginRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryResolveOriginRequest) ProtoMessage() {}
|
||||
func (*QueryResolveOriginRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_81a1010cdbf4bc9c, []int{4}
|
||||
}
|
||||
func (m *QueryResolveOriginRequest) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *QueryResolveOriginRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_QueryResolveOriginRequest.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 *QueryResolveOriginRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_QueryResolveOriginRequest.Merge(m, src)
|
||||
}
|
||||
func (m *QueryResolveOriginRequest) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *QueryResolveOriginRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_QueryResolveOriginRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_QueryResolveOriginRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *QueryResolveOriginRequest) GetOrigin() string {
|
||||
if m != nil {
|
||||
return m.Origin
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// QueryResolveOriginResponse is the response type for the Query/ResolveOrigin RPC method.
|
||||
type QueryResolveOriginResponse struct {
|
||||
// record is the record of the origin.
|
||||
Record *Service `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"`
|
||||
}
|
||||
|
||||
func (m *QueryResolveOriginResponse) Reset() { *m = QueryResolveOriginResponse{} }
|
||||
func (m *QueryResolveOriginResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryResolveOriginResponse) ProtoMessage() {}
|
||||
func (*QueryResolveOriginResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_81a1010cdbf4bc9c, []int{5}
|
||||
}
|
||||
func (m *QueryResolveOriginResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *QueryResolveOriginResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_QueryResolveOriginResponse.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 *QueryResolveOriginResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_QueryResolveOriginResponse.Merge(m, src)
|
||||
}
|
||||
func (m *QueryResolveOriginResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *QueryResolveOriginResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_QueryResolveOriginResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_QueryResolveOriginResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *QueryResolveOriginResponse) GetRecord() *Service {
|
||||
if m != nil {
|
||||
return m.Record
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*QueryParamsRequest)(nil), "svc.v1.QueryParamsRequest")
|
||||
proto.RegisterType((*QueryParamsResponse)(nil), "svc.v1.QueryParamsResponse")
|
||||
proto.RegisterType((*QueryOriginExistsRequest)(nil), "svc.v1.QueryOriginExistsRequest")
|
||||
proto.RegisterType((*QueryOriginExistsResponse)(nil), "svc.v1.QueryOriginExistsResponse")
|
||||
proto.RegisterType((*QueryResolveOriginRequest)(nil), "svc.v1.QueryResolveOriginRequest")
|
||||
proto.RegisterType((*QueryResolveOriginResponse)(nil), "svc.v1.QueryResolveOriginResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("svc/v1/query.proto", fileDescriptor_81a1010cdbf4bc9c) }
|
||||
|
||||
var fileDescriptor_81a1010cdbf4bc9c = []byte{
|
||||
// 248 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2a, 0x2e, 0x4b, 0xd6,
|
||||
0x2f, 0x33, 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62,
|
||||
0x2b, 0x2e, 0x4b, 0xd6, 0x2b, 0x33, 0x94, 0x92, 0x49, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x4f,
|
||||
0x2c, 0xc8, 0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x86, 0xa8,
|
||||
0x92, 0x12, 0x81, 0xea, 0x4c, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x84, 0x8a, 0x2a, 0x89, 0x70, 0x09,
|
||||
0x05, 0x82, 0x8c, 0x0a, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0x0e, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e,
|
||||
0x51, 0xb2, 0xe5, 0x12, 0x46, 0x11, 0x2d, 0x2e, 0xc8, 0xcf, 0x2b, 0x4e, 0x15, 0x52, 0xe3, 0x62,
|
||||
0x2b, 0x00, 0x8b, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x1b, 0xf1, 0xe9, 0x41, 0x6c, 0xd6, 0x83,
|
||||
0xaa, 0x83, 0xca, 0x1a, 0x25, 0x71, 0xb1, 0x82, 0xb5, 0x0b, 0x45, 0x72, 0xb1, 0x41, 0xa4, 0x84,
|
||||
0xa4, 0x60, 0x4a, 0x31, 0x6d, 0x93, 0x92, 0xc6, 0x2a, 0x07, 0xb1, 0x53, 0x49, 0xac, 0xe9, 0xf2,
|
||||
0x93, 0xc9, 0x4c, 0x02, 0x42, 0x7c, 0xfa, 0x50, 0xf7, 0x43, 0xec, 0x70, 0xb2, 0x39, 0xf1, 0x48,
|
||||
0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0,
|
||||
0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xa5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd,
|
||||
0xe4, 0xfc, 0x5c, 0xfd, 0xfc, 0xbc, 0xe2, 0xfc, 0xbc, 0x22, 0x7d, 0x30, 0x51, 0x01, 0x36, 0xa1,
|
||||
0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x7b, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff,
|
||||
0x32, 0x0f, 0x6c, 0xb9, 0x4f, 0x01, 0x00, 0x00,
|
||||
// 398 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x41, 0x4b, 0xe3, 0x40,
|
||||
0x1c, 0xc5, 0x9b, 0xc2, 0x86, 0xdd, 0xd9, 0xdd, 0x2a, 0x63, 0x29, 0x75, 0x94, 0xd8, 0xe6, 0x60,
|
||||
0x3d, 0x65, 0x68, 0x7b, 0xd5, 0x8b, 0xd0, 0xb3, 0x1a, 0x4f, 0x7a, 0x4b, 0xe3, 0x10, 0x07, 0xda,
|
||||
0x99, 0x74, 0x26, 0x09, 0x2d, 0x22, 0x82, 0x9f, 0x40, 0xf0, 0x4b, 0x79, 0x2c, 0x78, 0x11, 0x4f,
|
||||
0xd2, 0xfa, 0x41, 0xc4, 0x99, 0x89, 0x18, 0x8c, 0xf5, 0x12, 0x32, 0xff, 0xff, 0x7b, 0xef, 0xc7,
|
||||
0xbc, 0x04, 0x40, 0x99, 0x85, 0x38, 0xeb, 0xe2, 0x49, 0x4a, 0xc4, 0xcc, 0x8b, 0x05, 0x4f, 0x38,
|
||||
0xb4, 0x65, 0x16, 0x7a, 0x59, 0x17, 0x6d, 0x47, 0x9c, 0x47, 0x23, 0x82, 0x83, 0x98, 0xe2, 0x80,
|
||||
0x31, 0x9e, 0x04, 0x09, 0xe5, 0x4c, 0x6a, 0x15, 0xaa, 0x1b, 0x67, 0x44, 0x18, 0x91, 0xd4, 0x4c,
|
||||
0xdd, 0x3a, 0x80, 0x27, 0xef, 0x51, 0xc7, 0x81, 0x08, 0xc6, 0xd2, 0x27, 0x93, 0x94, 0xc8, 0xc4,
|
||||
0x3d, 0x00, 0x1b, 0x85, 0xa9, 0x8c, 0x39, 0x93, 0x04, 0xee, 0x02, 0x3b, 0x56, 0x93, 0xa6, 0xd5,
|
||||
0xb2, 0xf6, 0xfe, 0xf6, 0x6a, 0x9e, 0x26, 0x7b, 0x46, 0x67, 0xb6, 0x6e, 0x0f, 0x34, 0x95, 0xfd,
|
||||
0x48, 0xd0, 0x88, 0xb2, 0xc1, 0x94, 0xca, 0x24, 0x8f, 0x86, 0x0d, 0x60, 0x73, 0x35, 0x56, 0x19,
|
||||
0x7f, 0x7c, 0x73, 0x72, 0xfb, 0x60, 0xb3, 0xc4, 0x63, 0xc0, 0x0d, 0x60, 0x13, 0x35, 0x51, 0xa6,
|
||||
0xdf, 0xbe, 0x39, 0x7d, 0x98, 0x7c, 0x22, 0xf9, 0x28, 0x23, 0xda, 0xfb, 0x13, 0x69, 0x00, 0x50,
|
||||
0x99, 0xc9, 0xa0, 0x3a, 0xc0, 0x16, 0x24, 0xe4, 0xe2, 0xc2, 0xdc, 0x71, 0x2d, 0xbf, 0xe3, 0x29,
|
||||
0x11, 0x19, 0x0d, 0x89, 0x6f, 0xd6, 0xbd, 0xe7, 0x2a, 0xf8, 0xa5, 0x72, 0xe0, 0x19, 0xb0, 0x75,
|
||||
0x01, 0x10, 0xe5, 0xe2, 0xaf, 0x9d, 0xa2, 0xad, 0xd2, 0x9d, 0xa6, 0xba, 0x8d, 0xdb, 0xc7, 0xd7,
|
||||
0xfb, 0xea, 0x3a, 0xac, 0x61, 0xf3, 0x95, 0x74, 0x93, 0x30, 0x05, 0xff, 0x3e, 0x17, 0x02, 0x5b,
|
||||
0x85, 0x90, 0x92, 0x7e, 0x51, 0x7b, 0x85, 0xc2, 0xc0, 0x5a, 0x0a, 0x86, 0x60, 0x33, 0x87, 0xe9,
|
||||
0x62, 0x24, 0xbe, 0xd2, 0x2f, 0xd7, 0xf0, 0x06, 0xfc, 0x2f, 0xb4, 0x03, 0x8b, 0xa9, 0x65, 0x75,
|
||||
0x23, 0x77, 0x95, 0xc4, 0x90, 0x3b, 0x8a, 0xdc, 0x86, 0x3b, 0xdf, 0x91, 0xb1, 0x2e, 0xf7, 0x70,
|
||||
0xff, 0x61, 0xe1, 0x58, 0xf3, 0x85, 0x63, 0xbd, 0x2c, 0x1c, 0xeb, 0x6e, 0xe9, 0x54, 0xe6, 0x4b,
|
||||
0xa7, 0xf2, 0xb4, 0x74, 0x2a, 0xe7, 0x6e, 0x44, 0x93, 0xcb, 0x74, 0xe8, 0x85, 0x7c, 0x8c, 0x39,
|
||||
0x93, 0x9c, 0x09, 0xac, 0x1e, 0x53, 0x15, 0x99, 0xcc, 0x62, 0x22, 0x87, 0xb6, 0xfa, 0xb7, 0xfb,
|
||||
0x6f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x55, 0xd8, 0x48, 0x2d, 0x03, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -152,6 +349,10 @@ const _ = grpc.SupportPackageIsVersion4
|
||||
type QueryClient interface {
|
||||
// Params queries all parameters of the module.
|
||||
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
||||
// OriginExists queries if a given origin exists.
|
||||
OriginExists(ctx context.Context, in *QueryOriginExistsRequest, opts ...grpc.CallOption) (*QueryOriginExistsResponse, error)
|
||||
// ResolveOrigin queries the domain of a given service and returns its record with capabilities.
|
||||
ResolveOrigin(ctx context.Context, in *QueryResolveOriginRequest, opts ...grpc.CallOption) (*QueryResolveOriginResponse, error)
|
||||
}
|
||||
|
||||
type queryClient struct {
|
||||
@@ -171,10 +372,32 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts .
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *queryClient) OriginExists(ctx context.Context, in *QueryOriginExistsRequest, opts ...grpc.CallOption) (*QueryOriginExistsResponse, error) {
|
||||
out := new(QueryOriginExistsResponse)
|
||||
err := c.cc.Invoke(ctx, "/svc.v1.Query/OriginExists", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *queryClient) ResolveOrigin(ctx context.Context, in *QueryResolveOriginRequest, opts ...grpc.CallOption) (*QueryResolveOriginResponse, error) {
|
||||
out := new(QueryResolveOriginResponse)
|
||||
err := c.cc.Invoke(ctx, "/svc.v1.Query/ResolveOrigin", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// QueryServer is the server API for Query service.
|
||||
type QueryServer interface {
|
||||
// Params queries all parameters of the module.
|
||||
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
|
||||
// OriginExists queries if a given origin exists.
|
||||
OriginExists(context.Context, *QueryOriginExistsRequest) (*QueryOriginExistsResponse, error)
|
||||
// ResolveOrigin queries the domain of a given service and returns its record with capabilities.
|
||||
ResolveOrigin(context.Context, *QueryResolveOriginRequest) (*QueryResolveOriginResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedQueryServer can be embedded to have forward compatible implementations.
|
||||
@@ -184,6 +407,12 @@ type UnimplementedQueryServer struct {
|
||||
func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
|
||||
}
|
||||
func (*UnimplementedQueryServer) OriginExists(ctx context.Context, req *QueryOriginExistsRequest) (*QueryOriginExistsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method OriginExists not implemented")
|
||||
}
|
||||
func (*UnimplementedQueryServer) ResolveOrigin(ctx context.Context, req *QueryResolveOriginRequest) (*QueryResolveOriginResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ResolveOrigin not implemented")
|
||||
}
|
||||
|
||||
func RegisterQueryServer(s grpc1.Server, srv QueryServer) {
|
||||
s.RegisterService(&_Query_serviceDesc, srv)
|
||||
@@ -207,6 +436,42 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Query_OriginExists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QueryOriginExistsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(QueryServer).OriginExists(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/svc.v1.Query/OriginExists",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).OriginExists(ctx, req.(*QueryOriginExistsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Query_ResolveOrigin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QueryResolveOriginRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(QueryServer).ResolveOrigin(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/svc.v1.Query/ResolveOrigin",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).ResolveOrigin(ctx, req.(*QueryResolveOriginRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var Query_serviceDesc = _Query_serviceDesc
|
||||
var _Query_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "svc.v1.Query",
|
||||
@@ -216,6 +481,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{
|
||||
MethodName: "Params",
|
||||
Handler: _Query_Params_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "OriginExists",
|
||||
Handler: _Query_OriginExists_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ResolveOrigin",
|
||||
Handler: _Query_ResolveOrigin_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "svc/v1/query.proto",
|
||||
@@ -279,6 +552,134 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *QueryOriginExistsRequest) 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 *QueryOriginExistsRequest) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *QueryOriginExistsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Origin) > 0 {
|
||||
i -= len(m.Origin)
|
||||
copy(dAtA[i:], m.Origin)
|
||||
i = encodeVarintQuery(dAtA, i, uint64(len(m.Origin)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *QueryOriginExistsResponse) 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 *QueryOriginExistsResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *QueryOriginExistsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Exists {
|
||||
i--
|
||||
if m.Exists {
|
||||
dAtA[i] = 1
|
||||
} else {
|
||||
dAtA[i] = 0
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *QueryResolveOriginRequest) 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 *QueryResolveOriginRequest) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *QueryResolveOriginRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Origin) > 0 {
|
||||
i -= len(m.Origin)
|
||||
copy(dAtA[i:], m.Origin)
|
||||
i = encodeVarintQuery(dAtA, i, uint64(len(m.Origin)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *QueryResolveOriginResponse) 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 *QueryResolveOriginResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *QueryResolveOriginResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Record != nil {
|
||||
{
|
||||
size, err := m.Record.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintQuery(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovQuery(v)
|
||||
base := offset
|
||||
@@ -312,6 +713,57 @@ func (m *QueryParamsResponse) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *QueryOriginExistsRequest) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Origin)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *QueryOriginExistsResponse) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.Exists {
|
||||
n += 2
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *QueryResolveOriginRequest) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Origin)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *QueryResolveOriginResponse) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.Record != nil {
|
||||
l = m.Record.Size()
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovQuery(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
@@ -454,6 +906,326 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *QueryOriginExistsRequest) 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: QueryOriginExistsRequest: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: QueryOriginExistsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Origin", 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.Origin = 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 *QueryOriginExistsResponse) 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: QueryOriginExistsResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: QueryOriginExistsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Exists", 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.Exists = bool(v != 0)
|
||||
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 *QueryResolveOriginRequest) 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: QueryResolveOriginRequest: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: QueryResolveOriginRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Origin", 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.Origin = 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 *QueryResolveOriginResponse) 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: QueryResolveOriginResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: QueryResolveOriginResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Record", 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.Record == nil {
|
||||
m.Record = &Service{}
|
||||
}
|
||||
if err := m.Record.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
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 skipQuery(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
||||
@@ -51,6 +51,114 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal
|
||||
|
||||
}
|
||||
|
||||
func request_Query_OriginExists_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq QueryOriginExistsRequest
|
||||
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)
|
||||
}
|
||||
|
||||
msg, err := client.OriginExists(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Query_OriginExists_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq QueryOriginExistsRequest
|
||||
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)
|
||||
}
|
||||
|
||||
msg, err := server.OriginExists(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_Query_ResolveOrigin_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq QueryResolveOriginRequest
|
||||
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)
|
||||
}
|
||||
|
||||
msg, err := client.ResolveOrigin(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Query_ResolveOrigin_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq QueryResolveOriginRequest
|
||||
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)
|
||||
}
|
||||
|
||||
msg, err := server.ResolveOrigin(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
||||
// UnaryRPC :call QueryServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
@@ -80,6 +188,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Query_OriginExists_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_OriginExists_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_OriginExists_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Query_ResolveOrigin_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_ResolveOrigin_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_ResolveOrigin_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -141,13 +295,61 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Query_OriginExists_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_OriginExists_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_OriginExists_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Query_ResolveOrigin_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_ResolveOrigin_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_ResolveOrigin_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"svc", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||
|
||||
pattern_Query_OriginExists_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"svc", "v1", "origins", "origin"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||
|
||||
pattern_Query_ResolveOrigin_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"svc", "v1", "origins", "origin", "record"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_Query_Params_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Query_OriginExists_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Query_ResolveOrigin_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user