Skip to content

Commit

Permalink
Remove all deprecated APIs
Browse files Browse the repository at this point in the history
AppAuth 1.0 gets a clean start.
  • Loading branch information
WilliamDenniss committed Jul 13, 2018
1 parent fadb76d commit b8c893f
Show file tree
Hide file tree
Showing 23 changed files with 38 additions and 224 deletions.
10 changes: 0 additions & 10 deletions AppAuth.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,6 @@
A5EEF29A20D821960044F470 /* OIDTokenUtilitiesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A5EEF1FD20CF07760044F470 /* OIDTokenUtilitiesTests.m */; };
A5EEF29B20D821970044F470 /* OIDTokenUtilitiesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A5EEF1FD20CF07760044F470 /* OIDTokenUtilitiesTests.m */; };
A5EEF29C20D821970044F470 /* OIDTokenUtilitiesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A5EEF1FD20CF07760044F470 /* OIDTokenUtilitiesTests.m */; };
A6339DAA20321ADD0043D1C9 /* OIDAuthorizationFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6339DA3203211320043D1C9 /* OIDAuthorizationFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; };
A6339DAB20321AE50043D1C9 /* OIDAuthorizationFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6339DA3203211320043D1C9 /* OIDAuthorizationFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; };
A6339DAC20321AE70043D1C9 /* OIDAuthorizationFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6339DA3203211320043D1C9 /* OIDAuthorizationFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; };
A6339DAD20321AEB0043D1C9 /* OIDAuthorizationFlowSession.h in Headers */ = {isa = PBXBuildFile; fileRef = A6339DA3203211320043D1C9 /* OIDAuthorizationFlowSession.h */; settings = {ATTRIBUTES = (Public, ); }; };
A6DEAB9B2018E4AD0022AC32 /* OIDExternalUserAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB982018E4A20022AC32 /* OIDExternalUserAgent.h */; settings = {ATTRIBUTES = (Public, ); }; };
A6DEAB9C2018E4AD0022AC32 /* OIDExternalUserAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB982018E4A20022AC32 /* OIDExternalUserAgent.h */; settings = {ATTRIBUTES = (Public, ); }; };
A6DEAB9D2018E4AD0022AC32 /* OIDExternalUserAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A6DEAB982018E4A20022AC32 /* OIDExternalUserAgent.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -607,7 +603,6 @@
60140F841DE43C8C00DA0DC3 /* OIDRegistrationResponseTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OIDRegistrationResponseTests.h; sourceTree = "<group>"; };
60140F851DE43CC700DA0DC3 /* OIDRegistrationResponseTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OIDRegistrationResponseTests.m; sourceTree = "<group>"; };
A5EEF1FD20CF07760044F470 /* OIDTokenUtilitiesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OIDTokenUtilitiesTests.m; sourceTree = "<group>"; };
A6339DA3203211320043D1C9 /* OIDAuthorizationFlowSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDAuthorizationFlowSession.h; sourceTree = "<group>"; };
A6DEAB982018E4A20022AC32 /* OIDExternalUserAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDExternalUserAgent.h; sourceTree = "<group>"; };
A6DEAB992018E4A20022AC32 /* OIDExternalUserAgentSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDExternalUserAgentSession.h; sourceTree = "<group>"; };
A6DEAB9A2018E4A20022AC32 /* OIDExternalUserAgentRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OIDExternalUserAgentRequest.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -783,7 +778,6 @@
340DAE241D581FE700EC285B /* macOS */,
F6F60FAF1D2BFEF000325CB3 /* iOS */,
341741AF1C5D8243000EF209 /* AppAuth.h */,
A6339DA3203211320043D1C9 /* OIDAuthorizationFlowSession.h */,
341741B41C5D8243000EF209 /* OIDAuthorizationRequest.h */,
341741B51C5D8243000EF209 /* OIDAuthorizationRequest.m */,
341741B61C5D8243000EF209 /* OIDAuthorizationResponse.h */,
Expand Down Expand Up @@ -963,7 +957,6 @@
343AAAF91E83499000F9D36E /* OIDTokenUtilities.h in Headers */,
343AAAEC1E83499000F9D36E /* OIDError.h in Headers */,
A6DEABAB2018E5C50022AC32 /* OIDExternalUserAgentIOS.h in Headers */,
A6339DAA20321ADD0043D1C9 /* OIDAuthorizationFlowSession.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -993,7 +986,6 @@
343AAAFC1E83499100F9D36E /* OIDAuthorizationResponse.h in Headers */,
343AAB0C1E83499100F9D36E /* OIDScopeUtilities.h in Headers */,
55A094D020DFBB11000045D1 /* OIDURLSessionProvider.h in Headers */,
A6339DAB20321AE50043D1C9 /* OIDAuthorizationFlowSession.h in Headers */,
343AAB011E83499100F9D36E /* OIDAuthStateErrorDelegate.h in Headers */,
343AAAFB1E83499100F9D36E /* OIDAuthorizationRequest.h in Headers */,
343AAB051E83499100F9D36E /* OIDErrorUtilities.h in Headers */,
Expand Down Expand Up @@ -1026,7 +1018,6 @@
343AAB141E83499200F9D36E /* OIDAuthorizationResponse.h in Headers */,
343AAB241E83499200F9D36E /* OIDScopeUtilities.h in Headers */,
55A094D120DFBB12000045D1 /* OIDURLSessionProvider.h in Headers */,
A6339DAC20321AE70043D1C9 /* OIDAuthorizationFlowSession.h in Headers */,
343AAB191E83499200F9D36E /* OIDAuthStateErrorDelegate.h in Headers */,
343AAB131E83499200F9D36E /* OIDAuthorizationRequest.h in Headers */,
343AAB1D1E83499200F9D36E /* OIDErrorUtilities.h in Headers */,
Expand Down Expand Up @@ -1060,7 +1051,6 @@
343AAAE11E83494A00F9D36E /* OIDLoopbackHTTPServer.h in Headers */,
343AAB311E83499200F9D36E /* OIDAuthStateErrorDelegate.h in Headers */,
343AAB2F1E83499200F9D36E /* OIDAuthState.h in Headers */,
A6339DAD20321AEB0043D1C9 /* OIDAuthorizationFlowSession.h in Headers */,
343AAB3E1E83499200F9D36E /* OIDServiceDiscovery.h in Headers */,
A6DEAB9E2018E4AE0022AC32 /* OIDExternalUserAgent.h in Headers */,
34A6632C1E871DD40060B664 /* OIDIDToken.h in Headers */,
Expand Down
1 change: 0 additions & 1 deletion Source/AppAuth.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#import "OIDAuthState.h"
#import "OIDAuthStateChangeDelegate.h"
#import "OIDAuthStateErrorDelegate.h"
#import "OIDAuthorizationFlowSession.h"
#import "OIDAuthorizationRequest.h"
#import "OIDAuthorizationResponse.h"
#import "OIDAuthorizationService.h"
Expand Down
1 change: 0 additions & 1 deletion Source/Framework/AppAuth.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ FOUNDATION_EXPORT const unsigned char AppAuthVersionString[];
#import <AppAuth/OIDAuthState.h>
#import <AppAuth/OIDAuthStateChangeDelegate.h>
#import <AppAuth/OIDAuthStateErrorDelegate.h>
#import <AppAuth/OIDAuthorizationFlowSession.h>
#import <AppAuth/OIDAuthorizationRequest.h>
#import <AppAuth/OIDAuthorizationResponse.h>
#import <AppAuth/OIDAuthorizationService.h>
Expand Down
13 changes: 1 addition & 12 deletions Source/OIDAuthState.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
@class OIDRegistrationResponse;
@class OIDTokenResponse;
@class OIDTokenRequest;
@protocol OIDAuthorizationFlowSession;
@protocol OIDAuthStateChangeDelegate;
@protocol OIDAuthStateErrorDelegate;
@protocol OIDExternalUserAgent;
Expand Down Expand Up @@ -149,7 +148,7 @@ typedef void (^OIDAuthStateAuthorizationCallback)(OIDAuthState *_Nullable authSt
receives a @c OIDExternalUserAgentSession.cancel message, or after processing a
@c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message.
*/
+ (id<OIDExternalUserAgentSession, OIDAuthorizationFlowSession>)
+ (id<OIDExternalUserAgentSession>)
authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest
externalUserAgent:(id<OIDExternalUserAgent>)externalUserAgent
callback:(OIDAuthStateAuthorizationCallback)callback;
Expand Down Expand Up @@ -274,16 +273,6 @@ typedef void (^OIDAuthStateAuthorizationCallback)(OIDAuthState *_Nullable authSt
- (nullable OIDTokenRequest *)tokenRefreshRequestWithAdditionalParameters:
(nullable NSDictionary<NSString *, NSString *> *)additionalParameters;

/*! @brief Deprecated, use @c OIDAuthState.performActionWithFreshTokens:.
@discussion Calls the block with a valid access token (refreshing it first, if needed), or if a
refresh was needed and failed, with the error that caused it to fail.
@param action The block to execute with a fresh token. This block will be executed on the main
thread.
@deprecated Use @c OIDAuthState.performActionWithFreshTokens: which is equivalent.
*/
- (void)withFreshTokensPerformAction:(OIDAuthStateAction)action
__deprecated_msg("Use OIDAuthState.performActionWithFreshTokens:");

@end

NS_ASSUME_NONNULL_END
10 changes: 2 additions & 8 deletions Source/OIDAuthState.m
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ @implementation OIDAuthState

#pragma mark - Convenience initializers

+ (id<OIDExternalUserAgentSession, OIDAuthorizationFlowSession>)
+ (id<OIDExternalUserAgentSession>)
authStateByPresentingAuthorizationRequest:(OIDAuthorizationRequest *)authorizationRequest
externalUserAgent:(id<OIDExternalUserAgent>)externalUserAgent
callback:(OIDAuthStateAuthorizationCallback)callback {
// presents the authorization request
id<OIDExternalUserAgentSession, OIDAuthorizationFlowSession> authFlowSession = [OIDAuthorizationService
id<OIDExternalUserAgentSession> authFlowSession = [OIDAuthorizationService
presentAuthorizationRequest:authorizationRequest
externalUserAgent:externalUserAgent
callback:^(OIDAuthorizationResponse *_Nullable authorizationResponse,
Expand Down Expand Up @@ -507,12 +507,6 @@ - (void)performActionWithFreshTokens:(OIDAuthStateAction)action
}];
}

#pragma mark - Deprecated

- (void)withFreshTokensPerformAction:(OIDAuthStateAction)action {
[self performActionWithFreshTokens:action additionalRefreshParameters:nil];
}

#pragma mark -

/*! @fn isTokenFresh
Expand Down
44 changes: 0 additions & 44 deletions Source/OIDAuthorizationFlowSession.h

This file was deleted.

35 changes: 3 additions & 32 deletions Source/OIDAuthorizationRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,37 +193,6 @@ extern NSString *const OIDOAuthorizationRequestCodeChallengeMethodS256;
responseType:(NSString *)responseType
additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters;

/*! @brief Deprecated, replaced with @c OIDAuthState.initWithConfiguration:clientId:clientSecret:scope:redirectURL:responseType:state:nonce:codeVerifier:codeChallenge:codeChallengeMethod:additionalParameters:.
@param configuration The service's configuration.
@param clientID The client identifier.
@param scope A scope string per the OAuth2 spec (a space-delimited set of scopes).
@param redirectURL The client's redirect URI.
@param responseType The expected response type.
@param state An opaque value used by the client to maintain state between the request and
callback.
@param codeVerifier The PKCE code verifier. See @c OIDAuthorizationRequest.generateCodeVerifier.
@param codeChallenge The PKCE code challenge, calculated from the code verifier such as with
@c OIDAuthorizationRequest.codeChallengeS256ForVerifier:.
@param codeChallengeMethod The PKCE code challenge method.
::OIDOAuthorizationRequestCodeChallengeMethodS256 when
@c OIDAuthorizationRequest.codeChallengeS256ForVerifier: is used to create the code
challenge.
@param additionalParameters The client's additional authorization parameters.
*/
- (instancetype)
initWithConfiguration:(OIDServiceConfiguration *)configuration
clientId:(NSString *)clientID
clientSecret:(nullable NSString *)clientSecret
scope:(nullable NSString *)scope
redirectURL:(nullable NSURL *)redirectURL
responseType:(NSString *)responseType
state:(nullable NSString *)state
codeVerifier:(nullable NSString *)codeVerifier
codeChallenge:(nullable NSString *)codeChallenge
codeChallengeMethod:(nullable NSString *)codeChallengeMethod
additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters
__deprecated_msg("Replaced with OIDAuthState.initWithConfiguration:clientId:clientSecret:scope:redirectURL:responseType:state:nonce:codeVerifier:codeChallenge:codeChallengeMethod:additionalParameters:");

/*! @brief Designated initializer.
@param configuration The service's configuration.
@param clientID The client identifier.
Expand All @@ -232,7 +201,9 @@ __deprecated_msg("Replaced with OIDAuthState.initWithConfiguration:clientId:clie
@param responseType The expected response type.
@param state An opaque value used by the client to maintain state between the request and
callback.
@param nonce String value used to associate a Client session with an ID Token.
@param nonce String value used to associate a Client session with an ID Token. Can be set to nil
if not using OpenID Connect, although pure OAuth servers should ignore params they don't
understand anyway.
@param codeVerifier The PKCE code verifier. See @c OIDAuthorizationRequest.generateCodeVerifier.
@param codeChallenge The PKCE code challenge, calculated from the code verifier such as with
@c OIDAuthorizationRequest.codeChallengeS256ForVerifier:.
Expand Down
26 changes: 0 additions & 26 deletions Source/OIDAuthorizationRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -159,32 +159,6 @@ - (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration
return self;
}

// Deprecated
- (instancetype)initWithConfiguration:(OIDServiceConfiguration *)configuration
clientId:(NSString *)clientID
clientSecret:(nullable NSString *)clientSecret
scope:(nullable NSString *)scope
redirectURL:(NSURL *)redirectURL
responseType:(NSString *)responseType
state:(nullable NSString *)state
codeVerifier:(nullable NSString *)codeVerifier
codeChallenge:(nullable NSString *)codeChallenge
codeChallengeMethod:(nullable NSString *)codeChallengeMethod
additionalParameters:(nullable NSDictionary<NSString *, NSString *> *)additionalParameters {
return [self initWithConfiguration:configuration
clientId:clientID
clientSecret:clientSecret
scope:scope
redirectURL:redirectURL
responseType:responseType
state:state
nonce:nil
codeVerifier:codeVerifier
codeChallenge:codeChallenge
codeChallengeMethod:OIDOAuthorizationRequestCodeChallengeMethodS256
additionalParameters:additionalParameters];
}

- (instancetype)
initWithConfiguration:(OIDServiceConfiguration *)configuration
clientId:(NSString *)clientID
Expand Down
13 changes: 3 additions & 10 deletions Source/OIDAuthorizationService.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
@class OIDServiceConfiguration;
@class OIDTokenRequest;
@class OIDTokenResponse;
@protocol OIDAuthorizationFlowSession;
@protocol OIDExternalUserAgent;
@protocol OIDExternalUserAgentSession;

Expand Down Expand Up @@ -111,9 +110,6 @@ typedef void (^OIDRegistrationCompletion)(OIDRegistrationResponse *_Nullable reg
+ (void)discoverServiceConfigurationForDiscoveryURL:(NSURL *)discoveryURL
completion:(OIDDiscoveryCallback)completion;

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"

/*! @brief Perform an authorization flow using a generic flow shim.
@param request The authorization request.
@param externalUserAgent Generic external user-agent that can present an authorization
Expand All @@ -123,12 +119,9 @@ typedef void (^OIDRegistrationCompletion)(OIDRegistrationResponse *_Nullable reg
receives a @c OIDExternalUserAgentSession.cancel message, or after processing a
@c OIDExternalUserAgentSession.resumeExternalUserAgentFlowWithURL: message.
*/
+ (id<OIDExternalUserAgentSession, OIDAuthorizationFlowSession>)
presentAuthorizationRequest:(OIDAuthorizationRequest *)request
externalUserAgent:(id<OIDExternalUserAgent>)externalUserAgent
callback:(OIDAuthorizationCallback)callback;

#pragma GCC diagnostic pop
+ (id<OIDExternalUserAgentSession>) presentAuthorizationRequest:(OIDAuthorizationRequest *)request
externalUserAgent:(id<OIDExternalUserAgent>)externalUserAgent
callback:(OIDAuthorizationCallback)callback;

/*! @brief Performs a token request.
@param request The token request.
Expand Down
Loading

0 comments on commit b8c893f

Please sign in to comment.