Verify Resource integrity base struct
This commit is contained in:
@@ -27,6 +27,7 @@ type AbstractResource struct {
|
||||
Owners []utils.Owner `json:"owners,omitempty" bson:"owners,omitempty"` // Owners is the list of owners of the resource
|
||||
UsageRestrictions string `bson:"usage_restrictions,omitempty" json:"usage_restrictions,omitempty"`
|
||||
AllowedBookingModes map[booking.BookingMode]*pricing.PricingVariation `bson:"allowed_booking_modes" json:"allowed_booking_modes"`
|
||||
Signature string `bson:"signature" json:"signature"`
|
||||
}
|
||||
|
||||
func (abs *AbstractResource) FilterPeer(peerID string) *dbs.Filters {
|
||||
|
||||
@@ -25,7 +25,9 @@ type NATSResponse struct {
|
||||
type NATSMethod int
|
||||
|
||||
var meths = []string{"remove execution", "create execution", "discovery",
|
||||
"workflow event", "remove peer", "create peer", "create resource", "remove resource", "propalgation event", "catalogsearch event"}
|
||||
"workflow event", "remove peer", "create peer", "create resource", "remove resource", "verify_resource",
|
||||
"propalgation event", "catalogsearch event",
|
||||
}
|
||||
|
||||
const (
|
||||
REMOVE_EXECUTION NATSMethod = iota
|
||||
@@ -38,6 +40,7 @@ const (
|
||||
|
||||
CREATE_RESOURCE
|
||||
REMOVE_RESOURCE
|
||||
VERIFY_RESOURCE
|
||||
|
||||
PROPALGATION_EVENT
|
||||
CATALOG_SEARCH_EVENT
|
||||
@@ -50,7 +53,7 @@ func (n NATSMethod) String() string {
|
||||
// NameToMethod returns the NATSMethod enum value from a string
|
||||
func NameToMethod(name string) NATSMethod {
|
||||
for _, v := range [...]NATSMethod{REMOVE_EXECUTION, CREATE_EXECTUTION, DISCOVERY, WORKFLOW_EVENT,
|
||||
REMOVE_PEER, CREATE_PEER, CREATE_RESOURCE, REMOVE_RESOURCE, PROPALGATION_EVENT, CATALOG_SEARCH_EVENT} {
|
||||
REMOVE_PEER, CREATE_PEER, CREATE_RESOURCE, REMOVE_RESOURCE, VERIFY_RESOURCE, PROPALGATION_EVENT, CATALOG_SEARCH_EVENT} {
|
||||
if strings.Contains(strings.ToLower(v.String()), strings.ToLower(name)) {
|
||||
return v
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user