Skip to content

Commit

Permalink
Update agbot secure api swagger
Browse files Browse the repository at this point in the history
Signed-off-by: Le Zhang <zhangl@us.ibm.com>
  • Loading branch information
LiilyZhang committed Oct 23, 2023
1 parent 17512f7 commit ba88cf0
Show file tree
Hide file tree
Showing 16 changed files with 138 additions and 250 deletions.
369 changes: 119 additions & 250 deletions agreementbot/secure_api.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions businesspolicy/business_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func (w BusinessPolicy) String() string {
w.SecretBinding)
}

// swagger:model
type ServiceRef struct {
Name string `json:"name"` // refers to a service definition in the exchange
Org string `json:"org,omitempty"` // the org holding the service definition
Expand Down
2 changes: 2 additions & 0 deletions common/pattern_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/open-horizon/anax/policy"
)

// swagger:model
type AbstractPatternFile interface {
GetOrg() string
GetServices() []exchange.ServiceReference
Expand Down Expand Up @@ -92,6 +93,7 @@ func (p *PatternFile) GetClusterNamespace() string {
return p.ClusterNamespace
}

// swagger:model
type ServiceReferenceFile struct {
ServiceURL string `json:"serviceUrl"` // refers to a service definition in the exchange
ServiceOrg string `json:"serviceOrgid"` // the org holding the service definition
Expand Down
1 change: 1 addition & 0 deletions common/service_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"golang.org/x/text/message"
)

// swagger:model
type AbstractServiceFile interface {
GetOrg() string
GetURL() string
Expand Down
2 changes: 2 additions & 0 deletions compcheck/comp_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func NewCompCheckError(err error, errCode int) *CompCheckError {
}

// The input format for the comptible check
// swagger:model
type CompCheck struct {
NodeId string `json:"node_id,omitempty"`
NodeArch string `json:"node_arch,omitempty"`
Expand Down Expand Up @@ -164,6 +165,7 @@ func NewCompCheckOutput(compatible bool, reason map[string]string, input *CompCh
}

// To store the resource (pattern, bp, services etc) used for compatibility check
// swagger:model
type CompCheckResource struct {
NodeId string `json:"node_id,omitempty"`
NodeArch string `json:"node_arch,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions compcheck/policy_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
)

// The input format for the policy check
// swagger:model
type PolicyCheck struct {
NodeId string `json:"node_id,omitempty"`
NodeArch string `json:"node_arch,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions compcheck/secretbinding_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
)

// The input format for the userinput check
// swagger:model
type SecretBindingCheck struct {
NodeId string `json:"node_id,omitempty"`
NodeArch string `json:"node_arch,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions compcheck/userinput_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
)

// The input format for the userinput check
// swagger:model
type UserInputCheck struct {
NodeId string `json:"node_id,omitempty"`
NodeArch string `json:"node_arch,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions exchange/pattern.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ type Blockchain struct {

type BlockchainList []Blockchain

// swagger:model
type AgreementProtocol struct {
Name string `json:"name,omitempty"` // The name of the agreement protocol to be used
ProtocolVersion int `json:"protocolVersion,omitempty"` // The max protocol version supported
Expand Down
1 change: 1 addition & 0 deletions exchange/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func GetId(id string) string {
}
}

// swagger:model
type PutPostDeleteStandardResponse struct {
Code string `json:"code"`
Msg string `json:"msg"`
Expand Down
1 change: 1 addition & 0 deletions exchangecommon/nodepolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const NODEPOLICY_VERSION_VERSION_2 = "v2"
// the perperty value of the second level takes the precedence.
// If there are constraints defined in the second level, all the constraints defined in
// the top level will be ignored.
// swagger:model
type NodePolicy struct {
Label string `json:"label,omitempty"`
Description string `json:"description,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions exchangecommon/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
)

// a binding that maps a secret name to a secret manager secret name.
// swagger:model
type BoundSecret map[string]string

// return both service secret name and secret manager secret name
Expand Down Expand Up @@ -42,6 +43,7 @@ func (w BoundSecret) IsSame(other BoundSecret) bool {
}

// The secret binding that maps service secret names to secret manager secret names
// swagger:model
type SecretBinding struct {
ServiceOrgid string `json:"serviceOrgid"`
ServiceUrl string `json:"serviceUrl"`
Expand Down
1 change: 1 addition & 0 deletions exchangecommon/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const SERVICE_SHARING_MODE_MULTIPLE = "multiple"
// Types and functions used to work with the exchange's service objects.

// This type is a tuple used to refer to a specific service that is a dependency for the referencing service.
// swagger:model
type ServiceDependency struct {
URL string `json:"url"`
Org string `json:"org"`
Expand Down
1 change: 1 addition & 0 deletions externalpolicy/constraint_expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
)

// This type implements all the ConstraintLanguage Plugin methods and delegates to plugin system.
// swagger:model
type ConstraintExpression []string

func (c *ConstraintExpression) Validate() ([]string, error) {
Expand Down
2 changes: 2 additions & 0 deletions externalpolicy/property_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ const (
)

// This struct represents property values advertised by the policy
// swagger:model
type PropertyList []Property

// swagger:model
type Property struct {
Name string `json:"name"` // The Property name
Value interface{} `json:"value"` // The Property value
Expand Down
1 change: 1 addition & 0 deletions policy/user_input.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func (s Input) IsSame(input Input) bool {
return true
}

// swagger:model
type UserInput struct {
ServiceOrgid string `json:"serviceOrgid"`
ServiceUrl string `json:"serviceUrl"`
Expand Down

0 comments on commit ba88cf0

Please sign in to comment.