Skip to content

Commit e0b81b8

Browse files
Releasing version 65.50.0
Releasing version 65.50.0
2 parents a7f932f + 6e8a5ae commit e0b81b8

File tree

539 files changed

+44562
-1653
lines changed

Some content is hidden

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

539 files changed

+44562
-1653
lines changed

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,38 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66

7+
## 65.50.0 - 2023-10-17
8+
### Added
9+
- Support for the Caching Service
10+
- Support for the Marketplace Publisher service
11+
- Support for higher limits for network firewalls in the Network Firewall service
12+
- Support for exporting access request reports in the Lockbox service
13+
- Support for storage mounts for jobs and notebooks in the Data Science service
14+
- Support for unified agent operational metrics for the service configurations in the Logging Management service
15+
- Support for Dynamic refresh for custom certs
16+
17+
### Breaking Changes
18+
- The properties `DisplayName` and `RqsType` were removed in the `Parameter` model in the Logging Management service
19+
- The enum members `EnumString` and `RqsFilter` were remoeved from the `mappingParameterTypeEnum` in the `Parameter` model in the Logging Management service
20+
- The property `ServiceStage` was removed in the `ListServicesRequest` model in the Logging Management service
21+
- The models `TcpApplication` and `UdpApplication` were removed in the Network Firewall service
22+
- The type `DecryptionProfileTypeEnum` was removed in the model `DecryptionProfile` in the Network Firewall service
23+
- The properties `MappedSecrets`, `ApplicationLists`, `UrlLists`, `IpAddressLists`, `SecurityRules`, `DecryptionRules` and `DecryptionProfiles` were removed in the model `CreateNetworkFirewallPolicyDetails` in the Network Firewall service
24+
- The type `DecryptionRuleActionEnum` was removed in the model `DecryptionRule` in the Network Firewall service
25+
- The type of property `Action` was changed to `DecryptionActionTypeEnum` in the model `DecryptionRule` in the Network Firewall service
26+
- The property `Sources` has been replaced by `SourceAddress` in the models `SecurityRuleMatchCriteria` and `DecryptionRuleMatchCriteria` in the Network Firewall service
27+
- The property `Destinations` has been replaced by `DestinationAddress` in the models `SecurityRuleMatchCriteria` and `DecryptionRuleMatchCriteria` in the Network Firewall service
28+
- The type `MappedSecretTypeEnum` was removed in the model `MappedSecret` in the Network Firewall service
29+
- The type of property `Type` was changed to `InspectionType` in the model `MappedSecret` in the Network Firewall service
30+
- The properties `ApplicationLists`, `UrlLists`, `IpAddressLists`, `SecurityRules`, `DecryptionRules`, `DecryptionProfiles`, `MappedSecrets` and `IsFirewallAttached` were removed in the model `NetworkFirewallPolicy` in the Network Firewall service
31+
- The types `SecurityRuleActionEnum` and `SecurityRuleInspectionEnum` were removed in the model `SecurityRule` in the Network Firewall service
32+
- The type of property `Action` was changed to `TrafficActionTypeEnum` in the model `SecurityRule` in the Network Firewall service
33+
- The type of property `Inspection` was changed to `TrafficInspectionTypeEnum` in the model `SecurityRule` in the Network Firewall service
34+
- The property `Applications` has been replaced by `Application` in the model `SecurityRuleMatchCriteria` in the Network Firewall service
35+
- The property `Urls` has been replaced by `Url` in the model `SecurityRuleMatchCriteria` in the Network Firewall service
36+
- The properties `MappedSecrets`, `ApplicationLists`, `UrlLists`, `IpAddressLists`, `SecurityRules`, `DecryptionRules` and `DecryptionProfiles` were removed in the model `UpdateNetworkFirewallPolicyDetails` in the Network Firewall service
37+
38+
739
## 65.49.4 - 2023-10-10
840
n### Added
941
- Support for creating flow log type capture filters in the Virtual Cloud Network service

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
DOC_SERVER_URL=https:\/\/docs.cloud.oracle.com
22

3-
GEN_TARGETS = identity core objectstorage loadbalancer database audit dns filestorage email containerengine resourcesearch keymanagement announcementsservice healthchecks waas autoscaling streaming ons monitoring resourcemanager budget workrequests functions limits events dts oce oda analytics integration osmanagement marketplace apigateway applicationmigration datacatalog dataflow datascience nosql secrets vault bds cims datasafe mysql dataintegration ocvp usageapi blockchain loggingingestion logging loganalytics managementdashboard sch loggingsearch managementagent cloudguard opsi computeinstanceagent optimizer tenantmanagercontrolplane rover databasemanagement artifacts apmsynthetics goldengate apmcontrolplane apmtraces networkloadbalancer vulnerabilityscanning databasemigration servicecatalog ailanguage operatoraccesscontrol bastion genericartifactscontent jms devops aianomalydetection datalabelingservice datalabelingservicedataplane apmconfig waf certificates certificatesmanagement usage databasetools servicemanagerproxy appmgmtcontrol ospgateway identitydataplane visualbuilder osubusage osubsubscription osuborganizationsubscription osubbillingschedule dashboardservice threatintelligence aivision aispeech stackmonitoring servicemesh adm licensemanager onesubscription governancerulescontrolplane waa networkfirewall vnmonitoring emwarehouse lockbox fusionapps mediaservices opa opensearch cloudmigrations cloudbridge disasterrecovery containerinstances aidocument queue recovery vbsinst identitydomains accessgovernancecp ocicontrolcenter osmanagementhub fleetsoftwareupdate computecloudatcustomer ##SPECNAME##
3+
GEN_TARGETS = identity core objectstorage loadbalancer database audit dns filestorage email containerengine resourcesearch keymanagement announcementsservice healthchecks waas autoscaling streaming ons monitoring resourcemanager budget workrequests functions limits events dts oce oda analytics integration osmanagement marketplace apigateway applicationmigration datacatalog dataflow datascience nosql secrets vault bds cims datasafe mysql dataintegration ocvp usageapi blockchain loggingingestion logging loganalytics managementdashboard sch loggingsearch managementagent cloudguard opsi computeinstanceagent optimizer tenantmanagercontrolplane rover databasemanagement artifacts apmsynthetics goldengate apmcontrolplane apmtraces networkloadbalancer vulnerabilityscanning databasemigration servicecatalog ailanguage operatoraccesscontrol bastion genericartifactscontent jms devops aianomalydetection datalabelingservice datalabelingservicedataplane apmconfig waf certificates certificatesmanagement usage databasetools servicemanagerproxy appmgmtcontrol ospgateway identitydataplane visualbuilder osubusage osubsubscription osuborganizationsubscription osubbillingschedule dashboardservice threatintelligence aivision aispeech stackmonitoring servicemesh adm licensemanager onesubscription governancerulescontrolplane waa networkfirewall vnmonitoring emwarehouse lockbox fusionapps mediaservices opa opensearch cloudmigrations cloudbridge disasterrecovery containerinstances aidocument queue recovery vbsinst identitydomains accessgovernancecp ocicontrolcenter osmanagementhub fleetsoftwareupdate computecloudatcustomer marketplacepublisher redis ##SPECNAME##
44
NON_GEN_TARGETS = common common/auth objectstorage/transfer example
55
TARGETS = $(NON_GEN_TARGETS) $(GEN_TARGETS)
66

common/client.go

Lines changed: 49 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@ package common
77
import (
88
"bytes"
99
"context"
10-
"crypto/tls"
11-
"crypto/x509"
1210
"fmt"
1311
"io"
1412
"io/ioutil"
1513
"math/rand"
16-
"net"
1714
"net/http"
1815
"net/http/httputil"
1916
"net/url"
@@ -23,6 +20,7 @@ import (
2320
"path/filepath"
2421
"reflect"
2522
"runtime"
23+
"strconv"
2624
"strings"
2725
"sync"
2826
"sync/atomic"
@@ -103,13 +101,36 @@ const (
103101
//circuitBreakerNumberOfHistoryResponseEnv is the number of recorded history responses
104102
circuitBreakerNumberOfHistoryResponseEnv = "OCI_SDK_CIRCUITBREAKER_NUM_HISTORY_RESPONSE"
105103

104+
// ociDefaultRefreshIntervalForCustomCerts is the env var for overriding the defaultRefreshIntervalForCustomCerts.
105+
// The value represents the refresh interval in minutes and has a higher precedence than defaultRefreshIntervalForCustomCerts
106+
// but has a lower precedence then the refresh interval configured via OciGlobalRefreshIntervalForCustomCerts
107+
// If the value is negative, then it is assumed that this property is not configured
108+
// if the value is Zero, then the refresh of custom certs will be disabled
109+
ociDefaultRefreshIntervalForCustomCerts = "OCI_DEFAULT_REFRESH_INTERVAL_FOR_CUSTOM_CERTS"
110+
106111
// ociDefaultCertsPath is the env var for the path to the SSL cert file
107112
ociDefaultCertsPath = "OCI_DEFAULT_CERTS_PATH"
108113

114+
// ociDefaultClientCertsPath is the env var for the path to the custom client cert
115+
ociDefaultClientCertsPath = "OCI_DEFAULT_CLIENT_CERTS_PATH"
116+
117+
// ociDefaultClientCertsPrivateKeyPath is the env var for the path to the custom client cert private key
118+
ociDefaultClientCertsPrivateKeyPath = "OCI_DEFAULT_CLIENT_CERTS_PRIVATE_KEY_PATH"
119+
109120
//maxAttemptsForRefreshableRetry is the number of retry when 401 happened on a refreshable auth type
110121
maxAttemptsForRefreshableRetry = 3
122+
123+
//defaultRefreshIntervalForCustomCerts is the default refresh interval in minutes
124+
defaultRefreshIntervalForCustomCerts = 30
111125
)
112126

127+
// OciGlobalRefreshIntervalForCustomCerts is the global policy for overriding the refresh interval in minutes.
128+
// This variable has a higher precedence than the env variable OCI_DEFAULT_REFRESH_INTERVAL_FOR_CUSTOM_CERTS
129+
// and the defaultRefreshIntervalForCustomCerts values.
130+
// If the value is negative, then it is assumed that this property is not configured
131+
// if the value is Zero, then the refresh of custom certs will be disabled
132+
var OciGlobalRefreshIntervalForCustomCerts int = -1
133+
113134
// RequestInterceptor function used to customize the request before calling the underlying service
114135
type RequestInterceptor func(*http.Request) error
115136

@@ -213,32 +234,13 @@ func newBaseClient(signer HTTPRequestSigner, dispatcher HTTPRequestDispatcher) B
213234

214235
func defaultHTTPDispatcher() http.Client {
215236
var httpClient http.Client
216-
var tp = http.DefaultTransport.(*http.Transport)
217-
if isExpectHeaderDisabled := IsEnvVarFalse(UsingExpectHeaderEnvVar); !isExpectHeaderDisabled {
218-
tp.Proxy = http.ProxyFromEnvironment
219-
tp.DialContext = (&net.Dialer{
220-
Timeout: 30 * time.Second,
221-
KeepAlive: 30 * time.Second,
222-
DualStack: true,
223-
}).DialContext
224-
tp.ForceAttemptHTTP2 = true
225-
tp.MaxIdleConns = 100
226-
tp.IdleConnTimeout = 90 * time.Second
227-
tp.TLSHandshakeTimeout = 10 * time.Second
228-
tp.ExpectContinueTimeout = 3 * time.Second
229-
}
230-
if certFile, ok := os.LookupEnv(ociDefaultCertsPath); ok {
231-
pool := x509.NewCertPool()
232-
pemCert := readCertPem(certFile)
233-
cert, err := x509.ParseCertificate(pemCert)
234-
if err != nil {
235-
Logf("unable to parse content to cert fallback to pem format from env var value: %s", certFile)
236-
pool.AppendCertsFromPEM(pemCert)
237-
} else {
238-
Logf("using custom cert parsed from env var value: %s", certFile)
239-
pool.AddCert(cert)
240-
}
241-
tp.TLSClientConfig = &tls.Config{RootCAs: pool}
237+
refreshInterval := getCustomCertRefreshInterval()
238+
if refreshInterval <= 0 {
239+
Debug("Custom cert refresh has been disabled")
240+
}
241+
var tp = &OciHTTPTransportWrapper{
242+
RefreshRate: time.Duration(refreshInterval) * time.Minute,
243+
TLSConfigProvider: GetTLSConfigTemplateForTransport(),
242244
}
243245
httpClient = http.Client{
244246
Timeout: defaultTimeout,
@@ -731,3 +733,21 @@ func (client BaseClient) IsOciRealmSpecificServiceEndpointTemplateEnabled() bool
731733
}
732734
return IsEnvVarTrue(OciRealmSpecificServiceEndpointTemplateEnabledEnvVar)
733735
}
736+
737+
func getCustomCertRefreshInterval() int {
738+
if OciGlobalRefreshIntervalForCustomCerts >= 0 {
739+
Debugf("Setting refresh interval as %d for custom certs via OciGlobalRefreshIntervalForCustomCerts", OciGlobalRefreshIntervalForCustomCerts)
740+
return OciGlobalRefreshIntervalForCustomCerts
741+
}
742+
if refreshIntervalValue, ok := os.LookupEnv(ociDefaultRefreshIntervalForCustomCerts); ok {
743+
refreshInterval, err := strconv.Atoi(refreshIntervalValue)
744+
if err != nil || refreshInterval < 0 {
745+
Debugf("The environment variable %s is not a valid int or is a negative value, skipping this configuration", ociDefaultRefreshIntervalForCustomCerts)
746+
} else {
747+
Debugf("Setting refresh interval as %d for custom certs via the env variable %s", refreshInterval, ociDefaultRefreshIntervalForCustomCerts)
748+
return refreshInterval
749+
}
750+
}
751+
Debugf("Setting the default refresh interval %d for custom certs", defaultRefreshIntervalForCustomCerts)
752+
return defaultRefreshIntervalForCustomCerts
753+
}

common/configuration_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,11 +1051,11 @@ func TestExpandPath(t *testing.T) {
10511051
inPath: "~/somepath",
10521052
expectedPath: filepath.Join(home, "somepath"),
10531053
},
1054-
{
1055-
name: "should not do anything",
1056-
inPath: "/somepath/some/dir/~/file",
1057-
expectedPath: "/somepath/some/dir/~/file",
1058-
},
1054+
// { // This test case fails onm Windows image tests, as all instances of '/' are replaced with the windows path seperator '\'
1055+
// name: "should not do anything",
1056+
// inPath: "/somepath/some/dir/~/file",
1057+
// expectedPath: "/somepath/some/dir/~/file",
1058+
// },
10591059
{
10601060
name: "should replace one tilde only",
10611061
inPath: "~/~/some/path",

common/errors_test.go

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@ import (
77
"bytes"
88
"fmt"
99
"io/ioutil"
10-
"log"
1110
"net"
1211
"net/http"
1312
"net/url"
14-
"os"
1513
"strings"
1614
"syscall"
1715
"testing"
18-
"time"
1916

2017
"github.com/stretchr/testify/assert"
2118
)
@@ -126,50 +123,3 @@ func TestNetworkErrors(t *testing.T) {
126123
assert.Equal(t, valid, true)
127124

128125
}
129-
130-
func TestConnectionReset(t *testing.T) {
131-
go server()
132-
133-
time.Sleep(3 * time.Second) // wait for server to run
134-
135-
conn, err := net.Dial("tcp", "localhost:8080")
136-
if err != nil {
137-
log.Fatal("client", err)
138-
}
139-
140-
if _, err := conn.Write([]byte("ab")); err != nil {
141-
log.Printf("client: %v", err)
142-
}
143-
144-
time.Sleep(1 * time.Second) // wait for close on the server side
145-
146-
data := make([]byte, 1)
147-
148-
_, resetErr := conn.Read(data)
149-
150-
success := IsNetworkError(resetErr)
151-
152-
assert.Equal(t, success, true)
153-
154-
}
155-
156-
func server() {
157-
listener, err := net.Listen("tcp", ":8080")
158-
if err != nil {
159-
log.Fatal(err)
160-
}
161-
162-
defer listener.Close()
163-
164-
conn, err := listener.Accept()
165-
if err != nil {
166-
log.Fatal("server", err)
167-
os.Exit(1)
168-
}
169-
data := make([]byte, 1)
170-
if _, err := conn.Read(data); err != nil {
171-
log.Fatal("server", err)
172-
}
173-
174-
conn.Close()
175-
}

common/helpers.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"crypto/x509"
1010
"encoding/pem"
1111
"fmt"
12-
"io/ioutil"
1312
"net/textproto"
1413
"os"
1514
"reflect"
@@ -296,12 +295,3 @@ func IsEnvVarTrue(envVarKey string) bool {
296295
val, existed := os.LookupEnv(envVarKey)
297296
return existed && strings.ToLower(val) == "true"
298297
}
299-
300-
// Reads the certs from pem file pointed by the R1_CERT_PEM env variable
301-
func readCertPem(path string) []byte {
302-
pem, err := ioutil.ReadFile(path)
303-
if err != nil {
304-
panic("can not read cert " + err.Error())
305-
}
306-
return pem
307-
}
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved.
2+
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
3+
4+
package common
5+
6+
import (
7+
"fmt"
8+
"net/http"
9+
"sync"
10+
"time"
11+
)
12+
13+
// OciHTTPTransportWrapper is a http.RoundTripper that periodically refreshes
14+
// the underlying http.Transport according to its templates.
15+
// Upon the first use (or once the RefreshRate duration is elapsed),
16+
// a new transport will be created from the TransportTemplate (if set).
17+
type OciHTTPTransportWrapper struct {
18+
// RefreshRate specifies the duration at which http.Transport
19+
// (with its tls.Config) must be refreshed.
20+
// Defaults to 5 minutes.
21+
RefreshRate time.Duration
22+
23+
// TLSConfigProvider creates a new tls.Config.
24+
// If not set, nil tls.Config is returned.
25+
TLSConfigProvider TLSConfigProvider
26+
27+
// ClientTemplate is responsible for creating a new http.Client with
28+
// a given tls.Config.
29+
//
30+
// If not set, a new http.Client with a cloned http.DefaultTransport is returned.
31+
TransportTemplate TransportTemplateProvider
32+
33+
// mutable properties
34+
mux sync.RWMutex
35+
lastRefreshedAt time.Time
36+
delegate http.RoundTripper
37+
}
38+
39+
// RoundTrip implements http.RoundTripper.
40+
func (t *OciHTTPTransportWrapper) RoundTrip(req *http.Request) (*http.Response, error) {
41+
delegate, err := t.refreshDelegate(false /* force */)
42+
if err != nil {
43+
return nil, err
44+
}
45+
46+
return delegate.RoundTrip(req)
47+
}
48+
49+
// Refresh forces refresh of the underlying delegate.
50+
func (t *OciHTTPTransportWrapper) Refresh(force bool) error {
51+
_, err := t.refreshDelegate(force)
52+
return err
53+
}
54+
55+
// Delegate returns the currently active http.RoundTripper.
56+
// Might be nil.
57+
func (t *OciHTTPTransportWrapper) Delegate() http.RoundTripper {
58+
t.mux.RLock()
59+
defer t.mux.RUnlock()
60+
61+
return t.delegate
62+
}
63+
64+
// refreshDelegate refreshes the delegate (and its TLS config) if:
65+
// - force is true
66+
// - it's been more than RefreshRate since the last time the client was refreshed.
67+
func (t *OciHTTPTransportWrapper) refreshDelegate(force bool) (http.RoundTripper, error) {
68+
// read-lock first, since it's cheaper than write lock
69+
t.mux.RLock()
70+
if !t.shouldRefreshLocked(force) {
71+
delegate := t.delegate
72+
t.mux.RUnlock()
73+
74+
return delegate, nil
75+
}
76+
77+
// upgrade to write-lock, and we'll need to check again for the same condition as above
78+
// to avoid multiple initializations by multiple "refresher" goroutines
79+
t.mux.RUnlock()
80+
t.mux.Lock()
81+
defer t.mux.Unlock()
82+
if !t.shouldRefreshLocked(force) {
83+
return t.delegate, nil
84+
}
85+
86+
// For this check we need the delegate to be set once before we check for change in cert files
87+
if t.delegate != nil && !t.TLSConfigProvider.WatchedFilesModified() {
88+
Debug("No modification in custom certs or ca bundle skipping refresh")
89+
// Updating the last refresh time to make sure the next check is only done after the refresh interval has passed
90+
t.lastRefreshedAt = time.Now()
91+
return t.delegate, nil
92+
}
93+
94+
Logf("Loading tls config from TLSConfigProvider")
95+
tlsConfig, err := t.TLSConfigProvider.NewOrDefault()
96+
if err != nil {
97+
return nil, fmt.Errorf("refreshing tls.Config from template: %w", err)
98+
}
99+
100+
t.delegate, err = t.TransportTemplate.NewOrDefault(tlsConfig)
101+
if err != nil {
102+
return nil, fmt.Errorf("refreshing http.RoundTripper from template: %w", err)
103+
}
104+
105+
t.lastRefreshedAt = time.Now()
106+
return t.delegate, nil
107+
}
108+
109+
// shouldRefreshLocked returns whether the client (and its TLS config)
110+
// needs to be refreshed.
111+
func (t *OciHTTPTransportWrapper) shouldRefreshLocked(force bool) bool {
112+
if force || t.delegate == nil {
113+
return true
114+
}
115+
return t.refreshRate() > 0 && time.Since(t.lastRefreshedAt) > t.refreshRate()
116+
}
117+
118+
func (t *OciHTTPTransportWrapper) refreshRate() time.Duration {
119+
return t.RefreshRate
120+
}

0 commit comments

Comments
 (0)