Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/crittercism v5 0 7 #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 32 additions & 28 deletions iphone/CrittercismModule.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objectVersion = 46;
objects = {

/* Begin PBXAggregateTarget section */
Expand All @@ -26,12 +26,12 @@
24DD6CFA1134B3F500162E58 /* CrittercismModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 24DD6CF81134B3F500162E58 /* CrittercismModule.m */; };
24DE9E1111C5FE74003F90F6 /* CrittercismModuleAssets.h in Headers */ = {isa = PBXBuildFile; fileRef = 24DE9E0F11C5FE74003F90F6 /* CrittercismModuleAssets.h */; };
24DE9E1211C5FE74003F90F6 /* CrittercismModuleAssets.m in Sources */ = {isa = PBXBuildFile; fileRef = 24DE9E1011C5FE74003F90F6 /* CrittercismModuleAssets.m */; };
5D1B94B71A4619A600EF5232 /* CRFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D1B94B21A4619A600EF5232 /* CRFilter.h */; };
5D1B94B81A4619A600EF5232 /* Crittercism.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D1B94B31A4619A600EF5232 /* Crittercism.h */; };
5D1B94B91A4619A600EF5232 /* CrittercismDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D1B94B41A4619A600EF5232 /* CrittercismDelegate.h */; };
5D1B94BA1A4619A600EF5232 /* libCrittercism_v5_0_7.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D1B94B61A4619A600EF5232 /* libCrittercism_v5_0_7.a */; };
AA747D9F0F9514B9006C5449 /* Crittercism_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = AA747D9E0F9514B9006C5449 /* Crittercism_Prefix.pch */; };
AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; };
F7969BCD19828BA70040226E /* CRFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = F7969BC819828BA70040226E /* CRFilter.h */; };
F7969BCE19828BA70040226E /* Crittercism.h in Headers */ = {isa = PBXBuildFile; fileRef = F7969BC919828BA70040226E /* Crittercism.h */; };
F7969BCF19828BA70040226E /* CrittercismDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = F7969BCA19828BA70040226E /* CrittercismDelegate.h */; };
F7969BD019828BA70040226E /* libCrittercism_v4_3_4.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F7969BCC19828BA70040226E /* libCrittercism_v4_3_4.a */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -50,23 +50,23 @@
24DD6D1B1134B66800162E58 /* titanium.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = titanium.xcconfig; sourceTree = "<group>"; };
24DE9E0F11C5FE74003F90F6 /* CrittercismModuleAssets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CrittercismModuleAssets.h; path = Classes/CrittercismModuleAssets.h; sourceTree = "<group>"; };
24DE9E1011C5FE74003F90F6 /* CrittercismModuleAssets.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CrittercismModuleAssets.m; path = Classes/CrittercismModuleAssets.m; sourceTree = "<group>"; };
5D1B94B21A4619A600EF5232 /* CRFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRFilter.h; sourceTree = "<group>"; };
5D1B94B31A4619A600EF5232 /* Crittercism.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Crittercism.h; sourceTree = "<group>"; };
5D1B94B41A4619A600EF5232 /* CrittercismDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrittercismDelegate.h; sourceTree = "<group>"; };
5D1B94B51A4619A600EF5232 /* dsym_upload.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = dsym_upload.sh; sourceTree = "<group>"; };
5D1B94B61A4619A600EF5232 /* libCrittercism_v5_0_7.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libCrittercism_v5_0_7.a; sourceTree = "<group>"; };
AA747D9E0F9514B9006C5449 /* Crittercism_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Crittercism_Prefix.pch; sourceTree = SOURCE_ROOT; };
AACBBE490F95108600F1A2B1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
D2AAC07E0554694100DB518D /* libCrittercism.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCrittercism.a; sourceTree = BUILT_PRODUCTS_DIR; };
F7969BC819828BA70040226E /* CRFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRFilter.h; sourceTree = "<group>"; };
F7969BC919828BA70040226E /* Crittercism.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Crittercism.h; sourceTree = "<group>"; };
F7969BCA19828BA70040226E /* CrittercismDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrittercismDelegate.h; sourceTree = "<group>"; };
F7969BCB19828BA70040226E /* dsym_upload.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = dsym_upload.sh; sourceTree = "<group>"; };
F7969BCC19828BA70040226E /* libCrittercism_v4_3_4.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libCrittercism_v4_3_4.a; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
D2AAC07C0554694100DB518D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F7969BD019828BA70040226E /* libCrittercism_v4_3_4.a in Frameworks */,
AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */,
5D1B94BA1A4619A600EF5232 /* libCrittercism_v5_0_7.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -88,7 +88,7 @@
32C88DFF0371C24200C91783 /* Other Sources */,
0867D69AFE84028FC02AAC07 /* Frameworks */,
034768DFFF38A50411DB9C8B /* Products */,
F7969BC719828BA70040226E /* CrittercismSDK */,
5D1B94B11A4619A600EF5232 /* CrittercismSDK */,
);
name = CrittercismModule;
sourceTree = "<group>";
Expand Down Expand Up @@ -121,17 +121,16 @@
name = "Other Sources";
sourceTree = "<group>";
};
F7969BC719828BA70040226E /* CrittercismSDK */ = {
5D1B94B11A4619A600EF5232 /* CrittercismSDK */ = {
isa = PBXGroup;
children = (
F7969BC819828BA70040226E /* CRFilter.h */,
F7969BC919828BA70040226E /* Crittercism.h */,
F7969BCA19828BA70040226E /* CrittercismDelegate.h */,
F7969BCB19828BA70040226E /* dsym_upload.sh */,
F7969BCC19828BA70040226E /* libCrittercism_v4_3_4.a */,
5D1B94B21A4619A600EF5232 /* CRFilter.h */,
5D1B94B31A4619A600EF5232 /* Crittercism.h */,
5D1B94B41A4619A600EF5232 /* CrittercismDelegate.h */,
5D1B94B51A4619A600EF5232 /* dsym_upload.sh */,
5D1B94B61A4619A600EF5232 /* libCrittercism_v5_0_7.a */,
);
name = CrittercismSDK;
path = ../../../Downloads/Crittercism_v4_3_4/CrittercismSDK;
path = CrittercismSDK;
sourceTree = "<group>";
};
/* End PBXGroup section */
Expand All @@ -142,11 +141,11 @@
buildActionMask = 2147483647;
files = (
AA747D9F0F9514B9006C5449 /* Crittercism_Prefix.pch in Headers */,
F7969BCF19828BA70040226E /* CrittercismDelegate.h in Headers */,
F7969BCE19828BA70040226E /* Crittercism.h in Headers */,
5D1B94B91A4619A600EF5232 /* CrittercismDelegate.h in Headers */,
5D1B94B81A4619A600EF5232 /* Crittercism.h in Headers */,
24DD6CF91134B3F500162E58 /* CrittercismModule.h in Headers */,
24DE9E1111C5FE74003F90F6 /* CrittercismModuleAssets.h in Headers */,
F7969BCD19828BA70040226E /* CRFilter.h in Headers */,
5D1B94B71A4619A600EF5232 /* CRFilter.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -176,9 +175,10 @@
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0610;
};
buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "CrittercismModule" */;
compatibilityVersion = "Xcode 3.1";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
Expand Down Expand Up @@ -258,7 +258,7 @@
GCC_WARN_UNUSED_VALUE = NO;
GCC_WARN_UNUSED_VARIABLE = NO;
INSTALL_PATH = /usr/local/lib;
LIBRARY_SEARCH_PATHS = /Users/mfogg/Downloads/Crittercism_v4_3_4/CrittercismSDK;
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/CrittercismSDK";
OTHER_CFLAGS = (
"-DDEBUG",
"-DTI_POST_1_2",
Expand Down Expand Up @@ -295,8 +295,8 @@
GCC_WARN_UNUSED_VALUE = NO;
GCC_WARN_UNUSED_VARIABLE = NO;
INSTALL_PATH = /usr/local/lib;
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
LIBRARY_SEARCH_PATHS = /Users/mfogg/Downloads/Crittercism_v4_3_4/CrittercismSDK;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/CrittercismSDK";
OTHER_CFLAGS = "-DTI_POST_1_2";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = Crittercism;
Expand Down Expand Up @@ -330,6 +330,8 @@
GCC_WARN_UNUSED_VALUE = NO;
GCC_WARN_UNUSED_VARIABLE = NO;
INSTALL_PATH = /usr/local/lib;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-DDEBUG",
"-DTI_POST_1_2",
Expand All @@ -341,6 +343,7 @@
RUN_CLANG_STATIC_ANALYZER = NO;
SDKROOT = iphoneos;
USER_HEADER_SEARCH_PATHS = "";
"VALID_ARCHS[sdk=*]" = "arm64 armv7 armv7s";
};
name = Debug;
};
Expand All @@ -367,7 +370,8 @@
GCC_WARN_UNUSED_VALUE = NO;
GCC_WARN_UNUSED_VARIABLE = NO;
INSTALL_PATH = /usr/local/lib;
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = "-DTI_POST_1_2";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = Crittercism;
Expand Down
138 changes: 138 additions & 0 deletions iphone/CrittercismSDK/CRFilter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
//
// CRFilter.h
// Crittercism iOS Library
//
// Created by Sean Hermany on 7/16/13.
// Copyright (c) 2013 Crittercism, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

// Filters can be supplied to Crittercism to adjust the behavior of how URLs are
// captured and reported on for performance monitoring purposes.
//
// By default, all URLs captured by Crittercism will be reported on when
// performance monitoring is enabled.
//
// The query portion of URLs will be stripped by default. That is, a request
// for the URL:
//
// https://store.acmecorp.com/purchase?user=wcoyote&ccnum=4444555566667777
//
// will be reported as:
//
// https://store.acmecorp.com/purchase
//
// This behavior can be altered with two types of filters:
//
// * Blacklist filters
//
// Blacklist filters cause Crittercism to discard data pertaining to any
// matching URLs.
//
// * Query preserving filters
//
// If you wish to report the full requested URL for certain endpoints, including
// the query portion, you can create and supply a query preserving filter to the
// library.
//
// Examples:
//
// Filters can either be supplied when Crittercism is enabled, as an array of
// CRFilter objects, or added dynamically at any time.
//
// The preferred method for creating filters is with the supplied convenience
// constructors, although the normal initializers, as well as the filtering
// function +[CRFillter applyFilter:ToURL] are left public so that developers
// can test the filtering behavior.
//
// * Creating a blacklist filter:
//
// [CRFilter filterWithString:@"purchase.php"]
//
// * Creating a query preserving filter:
//
// [CRFilter queryPreservingFilterWithString:@"lookupMovie"]
//
// * Initializing Crittercism with the above filters:
//
// [Crittercism enableWithAppID:@"YOURAPPID"
// andURLFilters:@[[CRFilter filterWithString:@"purchase.php"],
// [CRFilter queryPreservingFilterWithString:@"lookupMovie"]]];
//
// Notes:
//
// * Filters match URLs via CASE SENSITIVE substring matching
// * Blacklist filters always take precedence. If a captured URL matches both a
// blacklist filter, and a query preserving filter, it will NOT be reported
// on.
// * Older versions of the agent did not scrub query parameters by default, and
// so a "queryOnlyFilter" existed. To avoid compile time errors for existing
// Crittercism users, this filter type can still be created, but it will be
// ignored by the library. This filter type is deprecated, and will be removed
// in a future version of the agent.


// Support NS_ENUM macro if building against iOS SDK < 6.0

#ifndef NS_ENUM

#if (__cplusplus && __cplusplus >= 201103L && (__has_extension(cxx_strong_enums) || __has_feature(objc_fixed_enum))) || (!__cplusplus && __has_feature(objc_fixed_enum))
#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
#if (__cplusplus)
#define NS_OPTIONS(_type, _name) _type _name; enum : _type
#else
#define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type
#endif
#else
#define NS_ENUM(_type, _name) _type _name; enum
#define NS_OPTIONS(_type, _name) _type _name; enum
#endif

#endif

typedef NS_ENUM(NSUInteger, CRFilterType) {
CRFilterTypeScrubQuery, // Default
CRFilterTypeBlacklist,
CRFilterTypePreserveQuery
};

@interface CRFilter : NSObject

@property (readonly, assign) CRFilterType filterType;

#pragma mark - Class Methods

// Convenience method to create a blacklisting filter
+ (CRFilter *)filterWithString:(NSString *)matchToken;

// Convenience method to create a filter which preserves the query portion of
// URLs (as opposed to the default of scrubbing the query)
+ (CRFilter *)queryPreservingFilterWithString:(NSString *)matchToken;

// Filter a URL, specifying which type of filter to use.
// Returns nil when a blacklist filter is specified.
+ (NSString *)applyFilter:(CRFilterType)filterType ToURL:(NSString *)url;

#pragma mark - Instance Methods

// Initialize a filter that blacklists all URLs that match the specified token
- (id)initWithString:(NSString *)matchToken;

// (designated initializer)
- (id)initWithString:(NSString *)matchToken
andFilterType:(CRFilterType)filterType;

// Does specified URL match this filter?
- (BOOL)doesMatch:(NSString *)url;

#pragma mark - Deprecated

// Convenience method to create a filter which only scrubs the query portion
// of URLs
//
// Note - This is now a no-op, as query strings will be scrubbed by default.
+ (CRFilter *)queryOnlyFilterWithString:(NSString *)matchToken
__attribute__((deprecated));

@end
Loading