File tree 4 files changed +5
-3
lines changed
4 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -170,13 +170,14 @@ client:
170
170
# # the maximum time between events being dispatched
171
171
flushInterval : 30s
172
172
# # Template URL for SDK datafile location. The template should specify a "%s" token for SDK key substitution.
173
+ # # For secure environments, the datafileURLTemplate should be set to "https://config.optimizely.com/datafiles/auth/%s.json"
173
174
datafileURLTemplate : " https://cdn.optimizely.com/datafiles/%s.json"
174
175
# # URL for dispatching events.
175
176
eventURL : " https://logx.optimizely.com/v1/events"
176
177
# # Validation Regex on the request SDK Key
177
178
# # By default Agent assumes only alphanumeric characters as part of the SDK Key string.
178
179
# # https://github.com/google/re2/wiki/Syntax
179
- sdkKeyRegex : " ^\\ w+(:\\ w+)?$"
180
+ sdkKeyRegex : " ^[ \\ w=] +(:[ \\ w=] +)?$"
180
181
# # configure optional User profile service
181
182
userProfileService :
182
183
default : " "
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ func NewDefaultConfig() *AgentConfig {
82
82
DatafileURLTemplate : "https://cdn.optimizely.com/datafiles/%s.json" ,
83
83
EventURL : "https://logx.optimizely.com/v1/events" ,
84
84
// https://github.com/google/re2/wiki/Syntax
85
- SdkKeyRegex : "^\\ w+(:\\ w+)?$" ,
85
+ SdkKeyRegex : "^[ \\ w=] +(:[ \\ w=] +)?$" ,
86
86
UserProfileService : UserProfileServiceConfigs {
87
87
"default" : "" ,
88
88
"services" : map [string ]interface {}{},
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ func TestDefaultConfig(t *testing.T) {
82
82
assert .Equal (t , 30 * time .Second , conf .Client .FlushInterval )
83
83
assert .Equal (t , "https://cdn.optimizely.com/datafiles/%s.json" , conf .Client .DatafileURLTemplate )
84
84
assert .Equal (t , "https://logx.optimizely.com/v1/events" , conf .Client .EventURL )
85
- assert .Equal (t , "^\\ w+(:\\ w+)?$" , conf .Client .SdkKeyRegex )
85
+ assert .Equal (t , "^[ \\ w=] +(:[ \\ w=] +)?$" , conf .Client .SdkKeyRegex )
86
86
assert .Equal (t , "" , conf .Client .UserProfileService ["default" ])
87
87
assert .Equal (t , false , conf .Client .ODP .Disable )
88
88
assert .Equal (t , 1 * time .Second , conf .Client .ODP .EventsFlushInterval )
Original file line number Diff line number Diff line change @@ -780,6 +780,7 @@ func (s *DefaultLoaderTestSuite) TestDefaultRegexValidator() {
780
780
{":" , false },
781
781
{"abc:def:hij" , false },
782
782
{"abc:" , false },
783
+ {"123sdkKey:accesTokenWith=" , true },
783
784
}
784
785
785
786
conf := config .NewDefaultConfig ()
You can’t perform that action at this time.
0 commit comments