GeezerVison is showing github.com — feat: :tada: ssl pinning [CS-36095] · contentstack/contentstack-ios@0c1e234
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
File treeExpand file treeCollapse file tree Open diff view settings ThirdPartyExtension/Networking
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: CHANGELOG.md +6Lines changed: 6 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +### Version: 3.11.0 | | 2 | +#### Date: Apr-04-2023 | | 3 | + | | 4 | +##### Enahancement: | | 5 | +- SSL pinning for CSURLSession using CSURLSessionDelegate | | 6 | + | 1 | 7 | ### Version: 3.10.1 | 2 | 8 | #### Date: Nov-11-2022 | 3 | 9 |
| |
Collapse file Copy file name to clipboardExpand all lines: Contentstack.podspec +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | Pod::Spec.new do |s| | 2 | 2 | s.name = 'Contentstack' | 3 | | -s.version = '3.10.1' | | 3 | +s.version = '3.11.0' | 4 | 4 | s.summary = 'Contentstack is a headless CMS with an API-first approach that puts content at the centre.' | 5 | 5 |
| 6 | 6 | s.description = <<-DESC | @@ -12,7 +12,7 @@ s.homepage = 'https://www.contentstack.com/' | 12 | 12 | s.license = { :type => 'Commercial',:text => 'See https://www.contentstack.com/'} | 13 | 13 | | 14 | 14 |
| 15 | | -s.source = { :git => 'https://github.com/contentstack/contentstack-ios.git', :tag => 'v3.10.1' } | | 15 | +s.source = { :git => 'https://github.com/contentstack/contentstack-ios.git', :tag => 'v3.11.0' } | 16 | 16 | s.social_media_url = 'https://twitter.com/Contentstack' | 17 | 17 |
| 18 | 18 | s.ios.deployment_target = '8.0' | |
Collapse file Copy file name to clipboardExpand all lines: Contentstack.xcodeproj/project.pbxproj +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 48 | 48 | 0F9C0FC6221ADAC90091205A /* SyncStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9C0FAD221ADAC90091205A /* SyncStack.h */; settings = {ATTRIBUTES = (Public, ); }; }; | 49 | 49 | 0F9C0FC7221ADAC90091205A /* Entry.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9C0FAE221ADAC90091205A /* Entry.h */; settings = {ATTRIBUTES = (Public, ); }; }; | 50 | 50 | 0F9C0FC8221ADAC90091205A /* NamespacedDependencies.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9C0FB0221ADAC90091205A /* NamespacedDependencies.h */; }; | | 51 | + 0FD6BAEF29CD6E73001A0930 /* CSURLSessionDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD6BAEE29CD6E73001A0930 /* CSURLSessionDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; | 51 | 52 | 0FEAEF282361A18600985FF9 /* CSNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEAEF232361A18600985FF9 /* CSNetworking.h */; }; | 52 | 53 | 0FEAEF292361A18600985FF9 /* CSError.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEAEF242361A18600985FF9 /* CSError.h */; settings = {ATTRIBUTES = (Public, ); }; }; | 53 | 54 | 0FEAEF2A2361A18600985FF9 /* CSURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0FEAEF252361A18600985FF9 /* CSURLSessionManager.m */; }; | | 166 | 167 | 0F9C0FAD221ADAC90091205A /* SyncStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SyncStack.h; sourceTree = "<group>"; }; | 167 | 168 | 0F9C0FAE221ADAC90091205A /* Entry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Entry.h; sourceTree = "<group>"; }; | 168 | 169 | 0F9C0FB0221ADAC90091205A /* NamespacedDependencies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NamespacedDependencies.h; sourceTree = "<group>"; }; | | 170 | + 0FD6BAEE29CD6E73001A0930 /* CSURLSessionDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSURLSessionDelegate.h; sourceTree = "<group>"; }; | 169 | 171 | 0FDC02D1254A9CFA005EDDE3 /* libContentstackUtils.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libContentstackUtils.a; sourceTree = BUILT_PRODUCTS_DIR; }; | 170 | 172 | 0FEAEF232361A18600985FF9 /* CSNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSNetworking.h; sourceTree = "<group>"; }; | 171 | 173 | 0FEAEF242361A18600985FF9 /* CSError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSError.h; sourceTree = "<group>"; }; | | 307 | 309 | 0F9C0FA7221ADAC80091205A /* Stack.m */, | 308 | 310 | 0F9C0FAD221ADAC90091205A /* SyncStack.h */, | 309 | 311 | 0F9C0FA0221ADAC80091205A /* SyncStack.m */, | | 312 | + 0FD6BAEE29CD6E73001A0930 /* CSURLSessionDelegate.h */, | 310 | 313 | 0F9C0FAF221ADAC90091205A /* ThirdPartyNamespaceHeader */, | 311 | 314 | 230B38C41C16E98B00444A14 /* Info.plist */, | 312 | 315 | ); | | 507 | 510 | 230B39011C16EB8D00444A14 /* ISO8601DateFormatter.h in Headers */, | 508 | 511 | 23A53F401E276C83001DBE35 /* CSIOInternalHeaders.h in Headers */, | 509 | 512 | 0F9C0FB1221ADAC90091205A /* AssetLibrary.h in Headers */, | | 513 | + 0FD6BAEF29CD6E73001A0930 /* CSURLSessionDelegate.h in Headers */, | 510 | 514 | 0F9C0FB6221ADAC90091205A /* Config.h in Headers */, | 511 | 515 | 0F9C0FC2221ADAC90091205A /* Query.h in Headers */, | 512 | 516 | 0FEAEF292361A18600985FF9 /* CSError.h in Headers */, | |
Collapse file Copy file name to clipboard +28Lines changed: 28 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +// | | 2 | +// CSURLSessionDelegate.h | | 3 | +// Contentstack | | 4 | +// | | 5 | +// Created by Uttam Ukkoji on 24/03/23. | | 6 | +// Copyright © 2023 Contentstack. All rights reserved. | | 7 | +// | | 8 | + | | 9 | +#ifndef CSURLSessionDelegate_h | | 10 | +#define CSURLSessionDelegate_h | | 11 | +#import <Foundation/NSURLRequest.h> | | 12 | + | | 13 | +@class NSURLSession; | | 14 | +@class NSURLAuthenticationChallenge; | | 15 | + | | 16 | +API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)) | | 17 | +@protocol CSURLSessionDelegate <NSObject> | | 18 | +@optional | | 19 | + | | 20 | +- (void)URLSession:(NSURLSession *_Nonnull)session didReceiveChallenge:(NSURLAuthenticationChallenge *_Nonnull)challenge | | 21 | + completionHandler:(void (NS_SWIFT_SENDABLE ^_Nonnull)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler; | | 22 | + | | 23 | +- (void)URLSession:(NSURLSession *_Nonnull)session task:(NSURLSessionTask *_Nonnull)task | | 24 | + didReceiveChallenge:(NSURLAuthenticationChallenge *_Nonnull)challenge | | 25 | + completionHandler:(void (NS_SWIFT_SENDABLE ^_Nonnull)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler; | | 26 | + | | 27 | +@end | | 28 | +#endif /* CSURLSessionDelegate_h */ |
Collapse file Copy file name to clipboardExpand all lines: Contentstack/Config.h +16Lines changed: 16 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 8 | 8 |
| 9 | 9 | #import <Foundation/Foundation.h> | 10 | 10 | #import "ContentstackDefinitions.h" | | 11 | +#import "CSURLSessionDelegate.h" | 11 | 12 | @interface Config : NSObject | 12 | 13 |
| 13 | 14 | /**---------------------------------------------------------------------------------------- | | 72 | 73 | */ | 73 | 74 | @property (nonatomic, copy) NSString *branch; | 74 | 75 |
| | 76 | + | | 77 | +/** | | 78 | + Branch id for the | | 79 | + | | 80 | + //Obj-C | | 81 | + Config *config = [[Config alloc] init]; | | 82 | + config.delegate = [[CSDelegate alloc] init]; | | 83 | + | | 84 | + //Swift | | 85 | + var config:Config = Config() | | 86 | + config.delegate = CSDelegate() | | 87 | + | | 88 | + */ | | 89 | +@property (nullable, retain) id<CSURLSessionDelegate> delegate; | | 90 | + | 75 | 91 | @end |
Collapse file Copy file name to clipboardExpand all lines: Contentstack/Contentstack.h +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 19 | 19 | #import <Contentstack/QueryResult.h> | 20 | 20 | #import <Contentstack/Group.h> | 21 | 21 | #import <Contentstack/SyncStack.h> | | 22 | +#import <Contentstack/CSURLSessionDelegate.h> | 22 | 23 |
| 23 | 24 | @class Stack; | 24 | 25 |
| |
Collapse file Copy file name to clipboardExpand all lines: Contentstack/ContentstackDefinitions.h +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 78 | 78 | typedef NS_ENUM(NSUInteger, ContentstackRegion){ | 79 | 79 | US = 0, | 80 | 80 | EU, | 81 | | - AZURE_NA | | 81 | + AZURE_NA, | | 82 | + AZURE_EU | 82 | 83 | }; | 83 | 84 |
| 84 | 85 | typedef NS_ENUM(NSUInteger, Language) { | |
Collapse file Copy file name to clipboardExpand all lines: Contentstack/Stack.m +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -39,7 +39,7 @@ - (instancetype)initWithAPIKey:(NSString*)apiKey andaccessToken:(NSString *)acce | 39 | 39 | _apiKey = apiKey; | 40 | 40 | _accessToken = accessToken; | 41 | 41 |
| 42 | | - _network = [[CSIOCoreHTTPNetworking alloc] init]; | | 42 | + _network = [[CSIOCoreHTTPNetworking alloc] initWithDelegate:_config.delegate]; | 43 | 43 | _stackHeaders = [NSMutableDictionary dictionary]; | 44 | 44 | ISO8601DateFormatter *formatter = [[ISO8601DateFormatter alloc]init]; | 45 | 45 | _commonDateFormatter = formatter; | |
Collapse file Copy file name to clipboardExpand all lines: ContentstackInternal/CSIOCoreHTTPNetworking.h +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 7 | 7 | // | 8 | 8 |
| 9 | 9 | #import <Foundation/Foundation.h> | | 10 | +#import <Contentstack/CSURLSessionDelegate.h> | 10 | 11 | #import "CSIOCoreNetworkingProtocol.h" | 11 | 12 |
| 12 | | -@interface CSIOCoreHTTPNetworking : NSObject <CSIOCoreNetworkingProtocol> | 13 | 13 |
| | 14 | +@interface CSIOCoreHTTPNetworking : NSObject <CSIOCoreNetworkingProtocol> | | 15 | +-(instancetype)initWithDelegate: (id<CSURLSessionDelegate>) delegate; | 14 | 16 | @end |
Collapse file Copy file name to clipboardExpand all lines: ContentstackInternal/CSIOCoreHTTPNetworking.m +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -140,10 +140,10 @@ - (NSString *)URLEncodedStringValue { | 140 | 140 | } | 141 | 141 | @implementation CSIOCoreHTTPNetworking | 142 | 142 |
| 143 | | --(instancetype)init { | | 143 | +-(instancetype)initWithDelegate: (id<CSURLSessionDelegate>) delegate { | 144 | 144 | if (self=[super init]) { | 145 | 145 | // _httpSessionManager = [AFHTTPSessionManager manager]; | 146 | | - _urlSessionManager = [CSURLSessionManager manager:[self configuration]]; | | 146 | + _urlSessionManager = [CSURLSessionManager manager:[self configuration] delegate:delegate]; | 147 | 147 | [NSURLCache setSharedURLCache:[CSIOURLCache standardURLCache]]; | 148 | 148 | // [self sessionManagerQueryStringSerialization]; | 149 | 149 | } | |
|