Skip to content

Commit

Permalink
prepare 9.1.0 release (#307)
Browse files Browse the repository at this point in the history
## [9.1.0] - 2023-09-11
### Changed:
- Deprecated `LDValue.init(integerLiteral: Double)` as this method
signature is misleading. A new `LDValue.init(integerLiteral: Int)`
signature has been added for clarity.

### Fixed:
- Adjusted key encoding for some contexts generated by the Auto
Environment Attributes feature.

---------

Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: torchhound <[email protected]>
Co-authored-by: Gavin Whelan <[email protected]>
Co-authored-by: Louis Chan <[email protected]>
Co-authored-by: Matthew Keeler <[email protected]>
Co-authored-by: Louis Chan <[email protected]>
Co-authored-by: Ember Stevens <[email protected]>
Co-authored-by: Ember Stevens <[email protected]>
Co-authored-by: Ryan Lamb <[email protected]>
Co-authored-by: ld-repository-standards[bot] <113625520+ld-repository-standards[bot]@users.noreply.github.com>
Co-authored-by: Kane Parkinson <[email protected]>
  • Loading branch information
12 people authored Sep 11, 2023
1 parent 4e535fa commit e7e956c
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 25 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to the LaunchDarkly iOS SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).

## [9.1.0] - 2023-09-11
### Changed:
- Deprecated `LDValue.init(integerLiteral: Double)` as this method signature is misleading. A new `LDValue.init(integerLiteral: Int)` signature has been added for clarity.

### Fixed:
- Adjusted key encoding for some contexts generated by the Auto Environment Attributes feature.

## [9.0.2] - 2023-08-25
### Fixed:
- Updated how Auto Environment Attributes sanitizes and validates provided values to provide a more user friendly experience.
Expand All @@ -17,6 +24,10 @@ All notable changes to the LaunchDarkly iOS SDK will be documented in this file.
### Removed
- Removed LDUser and related functionality. Use LDContext instead. To learn more, read https://docs.launchdarkly.com/home/contexts.

## [8.3.0] - 2023-09-08
### Changed:
- Deprecated `LDValue.init(integerLiteral: Double)` as this method signature is misleading. A new `LDValue.init(integerLiteral: Int)` signature has been added for clarity.

## [8.2.0] - 2023-08-02
### Changed:
- Deprecated LDUser and related functionality. Use LDContext instead. To learn more, read https://docs.launchdarkly.com/home/contexts.
Expand Down
2 changes: 1 addition & 1 deletion LaunchDarkly.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Pod::Spec.new do |ld|

ld.name = "LaunchDarkly"
ld.version = "9.0.2"
ld.version = "9.1.0"
ld.summary = "iOS SDK for LaunchDarkly"

ld.description = <<-DESC
Expand Down
40 changes: 24 additions & 16 deletions LaunchDarkly.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1571,12 +1571,13 @@
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = NO;
DYLIB_CURRENT_VERSION = 9.0.2;
DYLIB_COMPATIBILITY_VERSION = 9.1.0;
DYLIB_CURRENT_VERSION = 9.1.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 9.0.2;
MARKETING_VERSION = 9.1.0;
MODULEMAP_FILE = "";
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-tvOS";
PRODUCT_NAME = LaunchDarkly_tvOS;
Expand All @@ -1595,12 +1596,13 @@
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = NO;
DYLIB_CURRENT_VERSION = 9.0.2;
DYLIB_COMPATIBILITY_VERSION = 9.1.0;
DYLIB_CURRENT_VERSION = 9.1.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 9.0.2;
MARKETING_VERSION = 9.1.0;
MODULEMAP_FILE = "";
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-tvOS";
PRODUCT_NAME = LaunchDarkly_tvOS;
Expand All @@ -1619,12 +1621,13 @@
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = NO;
DYLIB_CURRENT_VERSION = 9.0.2;
DYLIB_COMPATIBILITY_VERSION = 9.1.0;
DYLIB_CURRENT_VERSION = 9.1.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 9.0.2;
MARKETING_VERSION = 9.1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-macOS";
PRODUCT_NAME = LaunchDarkly_macOS;
SDKROOT = macosx;
Expand All @@ -1641,12 +1644,13 @@
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = NO;
DYLIB_CURRENT_VERSION = 9.0.2;
DYLIB_COMPATIBILITY_VERSION = 9.1.0;
DYLIB_CURRENT_VERSION = 9.1.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 9.0.2;
MARKETING_VERSION = 9.1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-macOS";
PRODUCT_NAME = LaunchDarkly_macOS;
SDKROOT = macosx;
Expand Down Expand Up @@ -1796,12 +1800,13 @@
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES;
CODE_SIGN_IDENTITY = "";
DEFINES_MODULE = NO;
DYLIB_CURRENT_VERSION = 9.0.2;
DYLIB_COMPATIBILITY_VERSION = 9.1.0;
DYLIB_CURRENT_VERSION = 9.1.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)";
MARKETING_VERSION = 9.0.2;
MARKETING_VERSION = 9.1.0;
MODULEMAP_FILE = "$(PROJECT_DIR)/Framework/module.modulemap";
PRODUCT_BUNDLE_IDENTIFIER = com.launchdarkly.Darkly;
PRODUCT_NAME = LaunchDarkly;
Expand All @@ -1817,12 +1822,13 @@
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES;
CODE_SIGN_IDENTITY = "";
DEFINES_MODULE = NO;
DYLIB_CURRENT_VERSION = 9.0.2;
DYLIB_COMPATIBILITY_VERSION = 9.1.0;
DYLIB_CURRENT_VERSION = 9.1.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)";
MARKETING_VERSION = 9.0.2;
MARKETING_VERSION = 9.1.0;
MODULEMAP_FILE = "$(PROJECT_DIR)/Framework/module.modulemap";
PRODUCT_BUNDLE_IDENTIFIER = com.launchdarkly.Darkly;
PRODUCT_NAME = LaunchDarkly;
Expand Down Expand Up @@ -1860,12 +1866,13 @@
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = NO;
DYLIB_CURRENT_VERSION = 9.0.2;
DYLIB_COMPATIBILITY_VERSION = 9.1.0;
DYLIB_CURRENT_VERSION = 9.1.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 9.0.2;
MARKETING_VERSION = 9.1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-watchOS";
PRODUCT_NAME = LaunchDarkly_watchOS;
SDKROOT = watchos;
Expand All @@ -1883,12 +1890,13 @@
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = NO;
DYLIB_CURRENT_VERSION = 9.0.2;
DYLIB_COMPATIBILITY_VERSION = 9.1.0;
DYLIB_CURRENT_VERSION = 9.1.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 9.0.2;
MARKETING_VERSION = 9.1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-watchOS";
PRODUCT_NAME = LaunchDarkly_watchOS;
SDKROOT = watchos;
Expand Down
15 changes: 15 additions & 0 deletions LaunchDarkly/LaunchDarkly/LDCommon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,25 @@ public enum LDValue: Codable,
self = .bool(booleanLiteral)
}

/// Create an LDValue representation from the provided Double value.
///
/// This method DOES NOT truncate the provided Double. As JSON numeric
/// values are always treated as double-precision, this method will
/// store the given Double as it.
@available(*, deprecated, message: "Use LDValue.init(integerLiteral: Int) or LDValue.init(floatLiteral: Double)")
public init(integerLiteral: Double) {
self = .number(integerLiteral)
}

/// Create an LDValue representation from the provided Int.
///
/// All JSON numeric types are represented as double-precision so the
/// provided Int will be cast to a Double.
public init(integerLiteral: Int) {
self = .number(Double(integerLiteral))
}

/// Create an LDValue representation from the provided Double.
public init(floatLiteral: Double) {
self = .number(floatLiteral)
}
Expand Down
4 changes: 2 additions & 2 deletions LaunchDarkly/LaunchDarkly/Models/Context/Modifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ class AutoEnvContextModifier {

private func applicationRecipe() -> ContextRecipe {
let keyCallable: () -> (String) = {
Util.sha256base64(
Util.sha256(
(self.environmentReporter.applicationInfo.applicationId ?? "") + ":" +
(self.environmentReporter.applicationInfo.applicationVersion ?? "")
)
).base64UrlEncodedString
}

var callables: [String : () -> LDValue] = [:]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

struct ReportingConsts {
static let sdkVersion = "9.0.2"
static let sdkVersion = "9.1.0"
static let sdkName = "ios-client-sdk"
}
6 changes: 5 additions & 1 deletion LaunchDarkly/LaunchDarkly/Util.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ class Util {
internal static let validTagCharacterSet = CharacterSet(charactersIn: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._-")

class func sha256base64(_ str: String) -> String {
sha256(str).base64EncodedString()
}

class func sha256(_ str: String) -> Data {
let data = Data(str.utf8)
var digest = [UInt8](repeating: 0, count: Int(CC_SHA256_DIGEST_LENGTH))
data.withUnsafeBytes {
_ = CC_SHA256($0.baseAddress, CC_LONG(data.count), &digest)
}
return Data(digest).base64EncodedString()
return Data(digest)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ final class ModifierSpec: XCTestCase {
let outputContext = underTest.modifyContext(input)
let outputKey = outputContext.contexts.first(where: { $0.kind == Kind("ld_application") })!.getValue(Reference("key"))
// expected key is the hash of the concatanation of id and version
let expectedKey = Util.sha256base64("idStub:versionStub").toLDValue()
let expectedKey = Util.sha256("idStub:versionStub").base64UrlEncodedString.toLDValue()
XCTAssertEqual(expectedKey, outputKey)
}

Expand All @@ -164,7 +164,7 @@ final class ModifierSpec: XCTestCase {
let outputContext = underTest.modifyContext(input)
let outputKey = outputContext.contexts.first(where: { $0.kind == Kind("ld_application") })!.getValue(Reference("key"))
// expect version to be dropped for hashing
let expectedKey = Util.sha256base64("myID:").toLDValue()
let expectedKey = Util.sha256("myID:").base64UrlEncodedString.toLDValue()
XCTAssertEqual(expectedKey, outputKey)
}
}
7 changes: 7 additions & 0 deletions LaunchDarkly/LaunchDarklyTests/UtilSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,11 @@ final class UtilSpec: XCTestCase {
let output = Util.sha256base64(input)
XCTAssertEqual(output, expectedOutput)
}

func testSha256base64UrlEncoding() throws {
let input = "OhYeah?HashThis!!!" // hash is KzDwVRpvTuf//jfMK27M4OMpIRTecNcJoaffvAEi+as= and it has a + and a /
let expectedOutput = "KzDwVRpvTuf__jfMK27M4OMpIRTecNcJoaffvAEi-as="
let output = Util.sha256(input).base64UrlEncodedString
XCTAssertEqual(output, expectedOutput)
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ To use the [CocoaPods](https://cocoapods.org) dependency manager to integrate La
```ruby
use_frameworks!
target 'YourTargetName' do
pod 'LaunchDarkly', '~> 9.0'
pod 'LaunchDarkly', '~> 9.1'
end
```

Expand All @@ -71,7 +71,7 @@ To use the [Carthage](https://github.com/Carthage/Carthage) dependency manager t
To integrate LaunchDarkly into your Xcode project using Carthage, specify it in your `Cartfile`:

```ogdl
github "launchdarkly/ios-client-sdk" ~> 9.0
github "launchdarkly/ios-client-sdk" ~> 9.1
```

### Manual installation
Expand Down

0 comments on commit e7e956c

Please sign in to comment.