-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #480 from splitio/release_2.23.0
Release 2.23.0
- Loading branch information
Showing
120 changed files
with
3,826 additions
and
357 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Build and Test iOS Streaming 1 | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
- development | ||
|
||
jobs: | ||
build: | ||
runs-on: [macos-latest] | ||
|
||
steps: | ||
- name: Select Xcode | ||
uses: maxim-lobanov/setup-xcode@v1 | ||
with: | ||
xcode-version: 13.2.1 | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Test iOS Streaming integration | ||
uses: sersoft-gmbh/xcodebuild-action@v1 | ||
with: | ||
action: build test | ||
build-settings: ONLY_ACTIVE_ARCH=NO TEST_AFTER_BUILD=YES | ||
configuration: Debug | ||
derived-data-path: "${{github.workspace}}/SplitApp" | ||
destination: 'platform=iOS Simulator,OS=15.2,name=iPhone 12' | ||
project: Split.xcodeproj | ||
scheme: Split | ||
sdk: 'iphonesimulator' | ||
test-plan: 'SplitiOSStreaming_1' | ||
use-xcpretty: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Pod::Spec.new do |s| | ||
s.name = 'Split' | ||
s.module_name = 'Split' | ||
s.version = '2.22.0' | ||
s.version = '2.23.0' | ||
s.summary = 'iOS SDK for Split' | ||
s.description = <<-DESC | ||
This SDK is designed to work with Split, the platform for controlled rollouts, serving features to your users via the Split feature flag to manage your complete customer experience. | ||
|
@@ -11,7 +11,7 @@ This SDK is designed to work with Split, the platform for controlled rollouts, s | |
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' } | ||
s.author = { 'Patricio Echague' => '[email protected]', 'Sebastian Arrubia' => '[email protected]', 'Fernando Martin' => '[email protected]'} | ||
s.source = { :git => 'https://github.com/splitio/ios-client.git', :tag => s.version.to_s } | ||
s.platforms = { :ios => "9.0", :osx => "10.11", :watchos => "7.0", :tvos => "9.0" } | ||
s.platforms = { :ios => "12.0", :osx => "10.13", :watchos => "7.0", :tvos => "12.0" } | ||
s.frameworks = 'Foundation' | ||
s.swift_versions = ['4.0', '4.2', '5.0', '5.1', '5.2', '5.3'] | ||
s.resources = "Split/Storage/split_cache.xcdatamodeld" | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// | ||
// FlagSetValidator.swift | ||
// Split | ||
// | ||
// Created by Javier Avrudsky on 22/09/2023. | ||
// Copyright © 2023 Split. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol FlagSetsValidator { | ||
func validateOnEvaluation(_ values: [String], calledFrom method: String, setsInFilter: [String]) -> [String] | ||
func cleanAndValidateValues(_ values: [String], calledFrom method: String) -> [String] | ||
} | ||
|
||
struct DefaultFlagSetsValidator: FlagSetsValidator { | ||
|
||
private var telemetryProducer: TelemetryInitProducer? | ||
|
||
init(telemetryProducer: TelemetryInitProducer?) { | ||
self.telemetryProducer = telemetryProducer | ||
} | ||
|
||
private let setRegex = "^[a-z0-9][a-z0-9_]{0,49}$" | ||
|
||
func validateOnEvaluation(_ values: [String], calledFrom method: String, setsInFilter: [String]) -> [String] { | ||
let filterSet = Set(setsInFilter) | ||
return cleanAndValidateValues(values, calledFrom: method).filter { value in | ||
if filterSet.count > 0, !filterSet.contains(value) { | ||
Logger.w("\(method): you passed Flag Set: \(value) and is not part of " + | ||
"the configured Flag set list, ignoring the request.") | ||
return false | ||
} | ||
return true | ||
} | ||
} | ||
|
||
func cleanAndValidateValues(_ values: [String], calledFrom method: String = "SDK Init") -> [String] { | ||
var cleanSets = Set<String>() | ||
for value in values { | ||
let cleanValue = value.trimmingCharacters(in: .whitespacesAndNewlines).lowercased() | ||
if cleanValue.count < value.count { | ||
Logger.w("\(method): Flag Set name <<\(value)>> has extra whitespace, trimming") | ||
} | ||
if !isValid(cleanValue) { | ||
Logger.w("\(method): you passed \(cleanValue), Flag Set must adhere to the regular " + | ||
"expressions \(setRegex). This means an Flag Set must be start with a letter, " + | ||
"be in lowercase, alphanumeric and have a max length of 50 characters." + | ||
"\(cleanValue) was discarded.") | ||
continue | ||
} | ||
if !cleanSets.insert(cleanValue).inserted { | ||
Logger.w("\(method): you passed duplicated Flag Set. \(cleanValue) was deduplicated.") | ||
} | ||
} | ||
telemetryProducer?.recordTotalFlagSets(values.count) | ||
telemetryProducer?.recordInvalidFlagSets(values.count - cleanSets.count) | ||
return Array(cleanSets) | ||
} | ||
|
||
private func isValid(_ value: String) -> Bool { | ||
let regex = try? NSRegularExpression(pattern: setRegex) | ||
let range = NSRange(location: 0, length: value.utf16.count) | ||
return regex?.numberOfMatches(in: value, options: [], range: range) ?? 0 > 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.