edgio / ec-sdk-go Goto Github PK
View Code? Open in Web Editor NEWEdgeCast Go SDK
License: Apache License 2.0
EdgeCast Go SDK
License: Apache License 2.0
The EdgeCast SDK is missing a number of properties related to TLS settings in the Origin Model. As a result, the Edgecast Terraform provider does not support setting any of the affected options. These options exist in the Edgecast Portal UI, hence I would expect them to be available via the REST API / Go SDK.
Missing options for feature parity are:
Related files:
https://github.com/EdgeCast/ec-sdk-go/blob/main/edgecast/origin/origin_models.go
Tie up loose ends from repo initialization so it's ready for consumption by our Terraform Provider
Describe the solution you'd like
ManagedRule has DisabledRules and RuleTargetUpdates. These arrays should hold collections of DisabledRule and RuleTargetUpdate types instead of the plural form.
GeneralSettings is embedded into ManagedRule but should instead be included as a single field.
Is your feature request related to a problem? Please describe.
In my scenario, I need to replace the underlying http.Client used by the sdk with my company customized http.Client (for emitting mertics, using our company's http mesh, etc).
Describe the solution you'd like
There is a similar feature in aws's sdk here:
// WithHTTPClient sets a config HTTPClient value returning a Config pointer
// for chaining.
func (c *Config) WithHTTPClient(client *http.Client) *Config {
c.HTTPClient = client
return c
}
Describe alternatives you've considered
NA
Additional context
NA
Is your feature request related to a problem? Please describe.
Analytics unreachable via go sdk.
Describe the solution you'd like
Implement analytics client or expose basic ecclient.
Describe alternatives you've considered
I'm just gonna manually implement http reqs.
Describe the bug
The following rate rule does not work:
{
"condition_groups": [
{
"conditions": [
{
"target": {
"type": "REQUEST_METHOD"
},
"op": {
"type": "EM",
"values": [
"POST"
]
}
}
]
}
],
"customer_id": "CEA78",
"disabled": false,
"duration_sec": 5,
"num": 10
}
To Reproduce
Steps to reproduce the behavior.
Call wafService.AddRateRule
with:
rule := waf.RateRule{
DurationSec: 5,
Num: 10,
CustomerID: "CEA78",
ConditionGroups: []waf.ConditionGroup{
{
Conditions: []waf.Condition{
{
Target: waf.Target{
Type: "REQUEST_METHOD",
},
OP: waf.OP{
Type: "EM",
Values: []string{"POST"},
},
},
},
},
},
}
Expected behavior
Rate rule is created
Screenshots
[DEBUG] POST https://qa-api.edgecast.com/v2/mcc/customers/CEA78/waf/v1.0/limit
failed AddRateRule: SendRequest failed: {"errors":[{"code":400,"message":"value is not accepted for operator type EM. You must use a values array"}],"success":false}
Describe the bug
wafConfig := waf.NewConfig(*apiToken)
wafConfig.Logger = edgecast.NewStandardLogger()
wafService, err := waf.New(wafConfig)
instead of
idsCredentials := auth.OAuth2Credentials{} // WAF does not use these credentials
sdkConfig := edgecast.NewSDKConfig(*apiToken, idsCredentials)
wafService, err := waf.New(sdkConfig)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.