Skip to content

Update AppAuth to 1.7.6 and keep our existing changes#1

Merged
zackcmartin merged 87 commits intomasterfrom
zm/update-to-1.7.6
Feb 24, 2025
Merged

Update AppAuth to 1.7.6 and keep our existing changes#1
zackcmartin merged 87 commits intomasterfrom
zm/update-to-1.7.6

Conversation

@zackcmartin
Copy link

We want to maintain this and this change while updating to the most recent version
I merged in the most up to date version of the AppAuth repo

julienbodet and others added 30 commits June 2, 2020 21:15
Make ExternalUserAgent subspec depend on Core.
Use deployment_target instead of platform.
Created the EntepriseUserAgent subspec, and AppAuthEnterpriseUserAgent framework target to house this and future external user agents aimed at enterprises.
- Add beginnings of 'AppAuthTV' Pod subspec
- Remove dependency on `GTMAppAuthFetcherAuthorization`
- Remove GTMAPPAUTH_USER_IMPORTS code
- Verified with `pod lib lint`
* Rename OID to GTM, remove extra header
* Remove TVConfigurationForGoogle, update copyright headers
* Return OIDAuthState instead of GTMAppAuthFetcherAuthorization
* Add AppAuthTV to Xcode targets, fix NSObject description method bug
* Add files to AppAuthTV target
* Remove property synthesize
* Add AppAuthTVTests target, pointing to UnitTests/UnitTestsInfo.plist and included in AppAuthTV scheme. Reorder imports
* Update min tvOS version and identifier for AppAuthTV target
* Correct capitalization in AppAuthTV identifier
* Update reference URLs, references to Google removed
* Remove non-functioning AppAuthTVTests target (tests coming in future PR)
* Fix indent spacing in OIDTVServiceConfiguration
* OIDTVAuthorizationRequest tests
* Add tests to AppAuthTVScheme
* add AppAuthTV to .travis.yml
Adds OIDTVTokenRequest class, which is a subclass of OIDTokenRequest, to better adhere to the [RFC for TV authentication](https://tools.ietf.org/html/rfc8628#section-3.4). This adds the required `device_code` property which is sent in the request body, which differs from the `code` property for the authorization code in the parent class. Additionally, the grant type for TV authorization is hard-coded in, and several unused fields are dropped from the initializer and body request code.
Update the example project to support discovery
- Create a tvOS example README
- Document tvOS support in main README
- Link to tvOS example from the example README
- Add Google IdP tvOS details
AppleTV test file was included in a source target which did not have XCTest dependencies and was causing builds to fail.
* Add GitHub Actions CI workflow.

* Skip conformance tests until we migrate to new backend.
Copy link
Author

@zackcmartin zackcmartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were only these 2 conflicts

@interface OIDExternalUserAgentIOS : NSObject<OIDExternalUserAgent>

- (nonnull instancetype)init API_AVAILABLE(ios(11))
- (null_unspecified instancetype)init API_AVAILABLE(ios(11))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kydonnelly you updated this from nullable to nonnull but it has since been updated to null_unspecified
0ea3ac2

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is probably fine, nonnull may have been a shortcut/hack back before I knew how to better swiftify things

Comment on lines +58 to 59
- (null_unspecified instancetype)init {
#pragma clang diagnostic push
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@kydonnelly kydonnelly changed the title Update to 1.7.6 and keep our existing changes Update AppAuth to 1.7.6 and keep our existing changes Feb 24, 2025
Comment on lines -194 to +219
NSDictionary *dictionary = [[NSDictionary alloc] initWithCoder:aDecoder];
NSDictionary *dictionary;
if ([aDecoder containsValueForKey:kDiscoveryDictionaryKey]) {
// We're decoding a collection type (NSDictionary) from NSJSONSerialization's
// +JSONObjectWithData, so we need to include all classes that could potentially be contained
// within.
NSSet<Class> *allowedClasses = [NSSet setWithArray:@[[NSDictionary class],
[NSArray class],
[NSString class],
[NSNumber class],
[NSNull class]]];
dictionary = [aDecoder decodeObjectOfClasses:allowedClasses
forKey:kDiscoveryDictionaryKey];
} else {
// Decode using the old encoding which delegated to NSDictionary's encodeWithCoder:
// implementation:
//
// - (void)encodeWithCoder:(NSCoder *)aCoder {
// [_discoveryDictionary encodeWithCoder:aCoder];
// }
dictionary = [[NSDictionary alloc] initWithCoder:aDecoder];
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reminder to self: put a breakpoint here during Dev QA

Comment on lines -188 to +198
OIDServiceDiscovery *discoveryDocument = [aDecoder decodeObjectOfClass:[OIDServiceDiscovery class]
forKey:kDiscoveryDocumentKey];
NSSet<Class> *allowedClasses = [NSSet setWithArray:@[[OIDServiceDiscovery class],
// The following classes are required in
// order to support secure decoding of the
// old OIDServiceDiscovery encoding.
[NSDictionary class],
[NSArray class],
[NSString class],
[NSNumber class],
[NSNull class]]];
OIDServiceDiscovery *discoveryDocument = [aDecoder decodeObjectOfClasses:allowedClasses
forKey:kDiscoveryDocumentKey];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there are any unusual bug reports from users, this internal change might be something to double-check

Copy link

@kydonnelly kydonnelly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for handling this! I'll do Dev QA on the PR that updates this inside Notability

Copy link

@drewbratcher drewbratcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻

@zackcmartin zackcmartin merged commit 1cd4366 into master Feb 24, 2025
3 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.