Skip to content

Commit 756dbaa

Browse files
authored
Merge pull request #175 from akamai/release/v3.1.0
Release/v3.1.0
2 parents 6b82d41 + 3c6af38 commit 756dbaa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+7563
-349
lines changed

.github/workflows/checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ jobs:
1515
- name: Checkout
1616
uses: actions/checkout@v2
1717
- name: Set up Go
18-
uses: actions/setup-go@v2
18+
uses: actions/setup-go@v3
1919
with:
2020
go-version-file: 'go.mod'
2121
- name: Fmt check
2222
run: make fmt-check
2323
- name: Linter check
2424
run: make lint
2525
- name: Run tests
26-
run: make test-verbose
26+
run: make test-verbose

.golangci.yaml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
linters:
22
disable-all: true
33
enable:
4+
- gocyclo
5+
- gofmt
6+
- goimports
7+
- govet
8+
- ineffassign
9+
- misspell
410
- revive
511

612
output:
@@ -20,24 +26,24 @@ linters-settings:
2026
- name: context-as-argument
2127
- name: context-keys-type
2228
- name: dot-imports
29+
- name: empty-block
30+
- name: errorf
2331
- name: error-return
2432
- name: error-strings
2533
- name: error-naming
2634
- name: exported
2735
- name: if-return
2836
- name: increment-decrement
29-
- name: var-naming
30-
arguments: [["JSON", "ID", "API", "UUID", "HTTP", "IP"], []]
31-
- name: var-declaration
37+
- name: indent-error-flow
3238
- name: package-comments
3339
- name: range
3440
- name: receiver-naming
41+
- name: redefines-builtin-id
42+
- name: superfluous-else
3543
- name: time-naming
3644
- name: unexported-return
37-
- name: indent-error-flow
38-
- name: errorf
39-
- name: empty-block
40-
- name: superfluous-else
41-
- name: unused-parameter
4245
- name: unreachable-code
43-
- name: redefines-builtin-id
46+
- name: unused-parameter
47+
- name: var-declaration
48+
- name: var-naming
49+
arguments: [["JSON", "ID", "API", "UUID", "HTTP", "IP"], []]

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
11
# EDGEGRID GOLANG RELEASE NOTES
22

3+
## 3.1.0 (Dec 12, 2022)
4+
5+
#### FEATURES/ENHANCEMENTS:
6+
7+
* General
8+
* Add badges to readme and improve code quality
9+
10+
* [IMPORTANT] Added Property Include API support
11+
* Includes
12+
* [ListIncludes](https://techdocs.akamai.com/property-mgr/reference/get-includes)
13+
* [ListIncludeParents](https://techdocs.akamai.com/property-mgr/reference/get-include-parents)
14+
* [GetInclude](https://techdocs.akamai.com/property-mgr/reference/get-include)
15+
* [CreateInclude](https://techdocs.akamai.com/property-mgr/reference/post-includes)
16+
* [DeleteInclude](https://techdocs.akamai.com/property-mgr/reference/delete-include)
17+
* Include Activations
18+
* [ActivateInclude](https://techdocs.akamai.com/property-mgr/reference/post-include-activation)
19+
* [DeactivateInclude](https://techdocs.akamai.com/property-mgr/reference/post-include-activation)
20+
* [CancelIncludeActivation](https://techdocs.akamai.com/property-mgr/reference/delete-include-activation)
21+
* [GetIncludeActivation](https://techdocs.akamai.com/property-mgr/reference/get-include-activation)
22+
* [ListIncludeActivations](https://techdocs.akamai.com/property-mgr/reference/get-include-activations)
23+
* Include Rules
24+
* [GetIncludeRuleTree](https://techdocs.akamai.com/property-mgr/reference/get-include-version-rules)
25+
* [UpdateIncludeRuleTree](https://techdocs.akamai.com/property-mgr/reference/patch-include-version-rules)
26+
* Include Versions
27+
* [CreateIncludeVersion](https://techdocs.akamai.com/property-mgr/reference/post-include-versions)
28+
* [GetIncludeVersion](https://techdocs.akamai.com/property-mgr/reference/get-include-version)
29+
* [ListIncludeVersions](https://techdocs.akamai.com/property-mgr/reference/get-include-versions)
30+
* [ListIncludeVersionAvailableCriteria](https://techdocs.akamai.com/property-mgr/reference/get-include-available-criteria)
31+
* [ListIncludeVersionAvailableBehaviors](https://techdocs.akamai.com/property-mgr/reference/get-include-available-behaviors)
32+
33+
#### BREAKING CHANGES:
34+
35+
* APPSEC
36+
* Factor out `PolicySecurityControls` struct
37+
338
## 3.0.0 (November 28, 2022)
439

540
### Deprecations

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Akamai OPEN EdgeGrid for GoLang v3
22

3+
![Build Status](https://github.com/akamai/akamaiOPEN-edgegrid-golang/actions/workflows/checks.yml/badge.svg)
4+
[![Go Report Card](https://goreportcard.com/badge/github.com/akamai/akamaiOPEN-edgegrid-golang/v3)](https://goreportcard.com/report/github.com/akamai/akamaiOPEN-edgegrid-golang/v3)
5+
![GitHub release (latest by date)](https://img.shields.io/github/v/release/akamai/akamaiOPEN-edgegrid-golang)
6+
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
7+
[![GoDoc](https://pkg.go.dev/badge/github.com/akamai/akamaiOPEN-edgegrid-golang?utm_source=godoc)](https://pkg.go.dev/github.com/akamai/AkamaiOPEN-edgegrid-golang/v3)
8+
39
This module is presently in active development and provides Akamai REST API support for the Akamai Terraform Provider.
410

511
## Backward Compatibility

pkg/appsec/api_constraints_protection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type (
3232
ApplyAPIConstraints bool `json:"applyApiConstraints"`
3333
}
3434

35-
// ProtectionsResponse is returned from a call to GetAPIConstraintsProtection and similiar security policy protection requests.
35+
// ProtectionsResponse is returned from a call to GetAPIConstraintsProtection and similar security policy protection requests.
3636
ProtectionsResponse struct {
3737
ApplyAPIConstraints bool `json:"applyApiConstraints,omitempty"`
3838
ApplyApplicationLayerControls bool `json:"applyApplicationLayerControls,omitempty"`

pkg/appsec/mocks.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ type Mock struct {
1212
mock.Mock
1313
}
1414

15+
var _ APPSEC = &Mock{}
16+
1517
func (m *Mock) UpdateWAPSelectedHostnames(ctx context.Context, req UpdateWAPSelectedHostnamesRequest) (*UpdateWAPSelectedHostnamesResponse, error) {
1618
args := m.Called(ctx, req)
1719
if args.Get(0) == nil {

pkg/appsec/security_policy.go

Lines changed: 38 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,10 @@ type (
4141
ConfigID int `json:"configId,omitempty"`
4242
Version int `json:"version,omitempty"`
4343
Policies []struct {
44-
PolicyID string `json:"policyId,omitempty"`
45-
PolicyName string `json:"policyName,omitempty"`
46-
HasRatePolicyWithAPIKey bool `json:"hasRatePolicyWithApiKey,omitempty"`
47-
PolicySecurityControls struct {
48-
ApplyApplicationLayerControls bool `json:"applyApplicationLayerControls,omitempty"`
49-
ApplyNetworkLayerControls bool `json:"applyNetworkLayerControls,omitempty"`
50-
ApplyRateControls bool `json:"applyRateControls,omitempty"`
51-
ApplyReputationControls bool `json:"applyReputationControls,omitempty"`
52-
ApplyBotmanControls bool `json:"applyBotmanControls,omitempty"`
53-
ApplyAPIConstraints bool `json:"applyApiConstraints,omitempty"`
54-
ApplySlowPostControls bool `json:"applySlowPostControls,omitempty"`
55-
} `json:"policySecurityControls,omitempty"`
44+
PolicyID string `json:"policyId,omitempty"`
45+
PolicyName string `json:"policyName,omitempty"`
46+
HasRatePolicyWithAPIKey bool `json:"hasRatePolicyWithApiKey,omitempty"`
47+
PolicySecurityControls *SecurityControls `json:"policySecurityControls,omitempty"`
5648
} `json:"policies,omitempty"`
5749
}
5850

@@ -65,20 +57,12 @@ type (
6557

6658
// GetSecurityPolicyResponse is returned from a call to GetSecurityPolicy.
6759
GetSecurityPolicyResponse struct {
68-
ConfigID int `json:"configId,omitempty"`
69-
PolicyID string `json:"policyId,omitempty"`
70-
PolicyName string `json:"policyName,omitempty"`
71-
DefaultSettings bool `json:"defaultSettings,omitempty"`
72-
PolicySecurityControls struct {
73-
ApplyAPIConstraints bool `json:"applyApiConstraints,omitempty"`
74-
ApplyApplicationLayerControls bool `json:"applyApplicationLayerControls,omitempty"`
75-
ApplyBotmanControls bool `json:"applyBotmanControls,omitempty"`
76-
ApplyNetworkLayerControls bool `json:"applyNetworkLayerControls,omitempty"`
77-
ApplyRateControls bool `json:"applyRateControls,omitempty"`
78-
ApplyReputationControls bool `json:"applyReputationControls,omitempty"`
79-
ApplySlowPostControls bool `json:"applySlowPostControls,omitempty"`
80-
} `json:"policySecurityControls,omitempty"`
81-
Version int `json:"version,omitempty"`
60+
ConfigID int `json:"configId,omitempty"`
61+
PolicyID string `json:"policyId,omitempty"`
62+
PolicyName string `json:"policyName,omitempty"`
63+
DefaultSettings bool `json:"defaultSettings,omitempty"`
64+
PolicySecurityControls *SecurityControls `json:"policySecurityControls,omitempty"`
65+
Version int `json:"version,omitempty"`
8266
}
8367

8468
// CreateSecurityPolicyRequest is used to create a ecurity policy.
@@ -93,20 +77,12 @@ type (
9377

9478
// CreateSecurityPolicyResponse is returned from a call to CreateSecurityPolicy.
9579
CreateSecurityPolicyResponse struct {
96-
ConfigID int `json:"configId"`
97-
PolicyID string `json:"policyId"`
98-
PolicyName string `json:"policyName"`
99-
DefaultSettings bool `json:"defaultSettings,omitempty"`
100-
PolicySecurityControls struct {
101-
ApplyAPIConstraints bool `json:"applyApiConstraints"`
102-
ApplyApplicationLayerControls bool `json:"applyApplicationLayerControls"`
103-
ApplyBotmanControls bool `json:"applyBotmanControls"`
104-
ApplyNetworkLayerControls bool `json:"applyNetworkLayerControls"`
105-
ApplyRateControls bool `json:"applyRateControls"`
106-
ApplyReputationControls bool `json:"applyReputationControls"`
107-
ApplySlowPostControls bool `json:"applySlowPostControls"`
108-
} `json:"policySecurityControls"`
109-
Version int `json:"version"`
80+
ConfigID int `json:"configId"`
81+
PolicyID string `json:"policyId"`
82+
PolicyName string `json:"policyName"`
83+
DefaultSettings bool `json:"defaultSettings,omitempty"`
84+
PolicySecurityControls *SecurityControls `json:"policySecurityControls,omitempty"`
85+
Version int `json:"version"`
11086
}
11187

11288
// UpdateSecurityPolicyRequest is used to modify a security policy.
@@ -119,20 +95,12 @@ type (
11995

12096
// UpdateSecurityPolicyResponse is returned from a call to UpdateSecurityPolicy.
12197
UpdateSecurityPolicyResponse struct {
122-
ConfigID int `json:"configId"`
123-
PolicyID string `json:"policyId"`
124-
PolicyName string `json:"policyName"`
125-
DefaultSettings bool `json:"defaultSettings,omitempty"`
126-
PolicySecurityControls struct {
127-
ApplyAPIConstraints bool `json:"applyApiConstraints"`
128-
ApplyApplicationLayerControls bool `json:"applyApplicationLayerControls"`
129-
ApplyBotmanControls bool `json:"applyBotmanControls"`
130-
ApplyNetworkLayerControls bool `json:"applyNetworkLayerControls"`
131-
ApplyRateControls bool `json:"applyRateControls"`
132-
ApplyReputationControls bool `json:"applyReputationControls"`
133-
ApplySlowPostControls bool `json:"applySlowPostControls"`
134-
} `json:"policySecurityControls"`
135-
Version int `json:"version"`
98+
ConfigID int `json:"configId"`
99+
PolicyID string `json:"policyId"`
100+
PolicyName string `json:"policyName"`
101+
DefaultSettings bool `json:"defaultSettings,omitempty"`
102+
PolicySecurityControls *SecurityControls `json:"policySecurityControls,omitempty"`
103+
Version int `json:"version"`
136104
}
137105

138106
// RemoveSecurityPolicyRequest is used to remove a security policy.
@@ -144,19 +112,22 @@ type (
144112

145113
// RemoveSecurityPolicyResponse is returned from a call to RemoveSecurityPolicy.
146114
RemoveSecurityPolicyResponse struct {
147-
ConfigID int `json:"configId"`
148-
PolicyID string `json:"policyId"`
149-
PolicyName string `json:"policyName"`
150-
PolicySecurityControls struct {
151-
ApplyAPIConstraints bool `json:"applyApiConstraints"`
152-
ApplyApplicationLayerControls bool `json:"applyApplicationLayerControls"`
153-
ApplyBotmanControls bool `json:"applyBotmanControls"`
154-
ApplyNetworkLayerControls bool `json:"applyNetworkLayerControls"`
155-
ApplyRateControls bool `json:"applyRateControls"`
156-
ApplyReputationControls bool `json:"applyReputationControls"`
157-
ApplySlowPostControls bool `json:"applySlowPostControls"`
158-
} `json:"policySecurityControls"`
159-
Version int `json:"version"`
115+
ConfigID int `json:"configId"`
116+
PolicyID string `json:"policyId"`
117+
PolicyName string `json:"policyName"`
118+
PolicySecurityControls *SecurityControls `json:"policySecurityControls,omitempty"`
119+
Version int `json:"version"`
120+
}
121+
122+
// SecurityControls is returned as part of GetSecurityPoliciesResponse and similar responses.
123+
SecurityControls struct {
124+
ApplyApplicationLayerControls bool `json:"applyApplicationLayerControls,omitempty"`
125+
ApplyAPIConstraints bool `json:"applyApiConstraints,omitempty"`
126+
ApplyBotmanControls bool `json:"applyBotmanControls,omitempty"`
127+
ApplyNetworkLayerControls bool `json:"applyNetworkLayerControls,omitempty"`
128+
ApplyRateControls bool `json:"applyRateControls,omitempty"`
129+
ApplyReputationControls bool `json:"applyReputationControls,omitempty"`
130+
ApplySlowPostControls bool `json:"applySlowPostControls,omitempty"`
160131
}
161132
)
162133

pkg/botman/mocks.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ type Mock struct {
1212
mock.Mock
1313
}
1414

15+
var _ BotMan = &Mock{}
16+
1517
func (p *Mock) GetAkamaiBotCategoryList(ctx context.Context, params GetAkamaiBotCategoryListRequest) (*GetAkamaiBotCategoryListResponse, error) {
1618
args := p.Called(ctx, params)
1719
if args.Error(1) != nil {

pkg/cloudlets/mocks.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ type Mock struct {
1212
mock.Mock
1313
}
1414

15+
var _ Cloudlets = &Mock{}
16+
1517
func (m *Mock) DeletePolicyProperty(ctx context.Context, req DeletePolicyPropertyRequest) error {
1618
args := m.Called(ctx, req)
1719
return args.Error(0)

pkg/cloudlets/policy_property_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func TestGetPolicyProperties(t *testing.T) {
100100
`,
101101
expectedPath: "/cloudlets/api/v2/policies/11754/properties",
102102
expectedResponse: map[string]PolicyProperty{
103-
"www.myproperty.com": PolicyProperty{
103+
"www.myproperty.com": {
104104
GroupID: 40498,
105105
ID: 179120478,
106106
Name: "www.myproperty.com",

0 commit comments

Comments
 (0)