-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for the AuthenticationServices framework
- Loading branch information
Showing
68 changed files
with
2,641 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ | |
#if TARGET_OS_OSX | ||
#import <AppKit/AppKit.h> | ||
#endif | ||
|
||
#import <AuthenticationServices/AuthenticationServices.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use crate::Foundation::NSObject; | ||
|
||
// TODO: UIViewController on iOS, NSViewController on macOS | ||
pub type ASViewController = NSObject; | ||
// TODO: UIWindow on iOS, NSWindow on macOS | ||
pub type ASPresentationAnchor = NSObject; | ||
// TODO: UIImage on iOS, NSImage on macOS | ||
pub type ASImage = NSObject; | ||
|
||
// TODO: UIControl on iOS, NSControl on macOS | ||
pub(crate) type ASControl = NSObject; |
83 changes: 83 additions & 0 deletions
83
...ate/src/AuthenticationServices/generated/ASAccountAuthenticationModificationController.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
//! This file has been automatically generated by `objc2`'s `header-translator`. | ||
//! DO NOT EDIT | ||
use crate::common::*; | ||
use crate::AuthenticationServices::*; | ||
use crate::Foundation::*; | ||
|
||
extern_protocol!( | ||
pub struct ASAccountAuthenticationModificationControllerDelegate; | ||
|
||
unsafe impl ASAccountAuthenticationModificationControllerDelegate { | ||
#[optional] | ||
#[method(accountAuthenticationModificationController:didSuccessfullyCompleteRequest:withUserInfo:)] | ||
pub unsafe fn accountAuthenticationModificationController_didSuccessfullyCompleteRequest_withUserInfo( | ||
&self, | ||
controller: &ASAccountAuthenticationModificationController, | ||
request: &ASAccountAuthenticationModificationRequest, | ||
userInfo: Option<&NSDictionary>, | ||
); | ||
|
||
#[optional] | ||
#[method(accountAuthenticationModificationController:didFailRequest:withError:)] | ||
pub unsafe fn accountAuthenticationModificationController_didFailRequest_withError( | ||
&self, | ||
controller: &ASAccountAuthenticationModificationController, | ||
request: &ASAccountAuthenticationModificationRequest, | ||
error: &NSError, | ||
); | ||
} | ||
); | ||
|
||
extern_protocol!( | ||
pub struct ASAccountAuthenticationModificationControllerPresentationContextProviding; | ||
|
||
unsafe impl ASAccountAuthenticationModificationControllerPresentationContextProviding { | ||
#[method_id(@__retain_semantics Other presentationAnchorForAccountAuthenticationModificationController:)] | ||
pub unsafe fn presentationAnchorForAccountAuthenticationModificationController( | ||
&self, | ||
controller: &ASAccountAuthenticationModificationController, | ||
) -> Id<ASPresentationAnchor, Shared>; | ||
} | ||
); | ||
|
||
extern_class!( | ||
#[derive(Debug)] | ||
pub struct ASAccountAuthenticationModificationController; | ||
|
||
unsafe impl ClassType for ASAccountAuthenticationModificationController { | ||
type Super = NSObject; | ||
} | ||
); | ||
|
||
extern_methods!( | ||
unsafe impl ASAccountAuthenticationModificationController { | ||
#[method_id(@__retain_semantics Other delegate)] | ||
pub unsafe fn delegate( | ||
&self, | ||
) -> Option<Id<ASAccountAuthenticationModificationControllerDelegate, Shared>>; | ||
|
||
#[method(setDelegate:)] | ||
pub unsafe fn setDelegate( | ||
&self, | ||
delegate: Option<&ASAccountAuthenticationModificationControllerDelegate>, | ||
); | ||
|
||
#[method_id(@__retain_semantics Other presentationContextProvider)] | ||
pub unsafe fn presentationContextProvider( | ||
&self, | ||
) -> Option< | ||
Id<ASAccountAuthenticationModificationControllerPresentationContextProviding, Shared>, | ||
>; | ||
|
||
#[method(setPresentationContextProvider:)] | ||
pub unsafe fn setPresentationContextProvider( | ||
&self, | ||
presentationContextProvider: Option< | ||
&ASAccountAuthenticationModificationControllerPresentationContextProviding, | ||
>, | ||
); | ||
|
||
#[method(performRequest:)] | ||
pub unsafe fn performRequest(&self, request: &ASAccountAuthenticationModificationRequest); | ||
} | ||
); |
42 changes: 42 additions & 0 deletions
42
...c/AuthenticationServices/generated/ASAccountAuthenticationModificationExtensionContext.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
//! This file has been automatically generated by `objc2`'s `header-translator`. | ||
//! DO NOT EDIT | ||
use crate::common::*; | ||
use crate::AuthenticationServices::*; | ||
use crate::Foundation::*; | ||
|
||
extern_class!( | ||
#[derive(Debug)] | ||
pub struct ASAccountAuthenticationModificationExtensionContext; | ||
|
||
unsafe impl ClassType for ASAccountAuthenticationModificationExtensionContext { | ||
type Super = NSExtensionContext; | ||
} | ||
); | ||
|
||
extern_methods!( | ||
unsafe impl ASAccountAuthenticationModificationExtensionContext { | ||
#[method(getSignInWithAppleUpgradeAuthorizationWithState:nonce:completionHandler:)] | ||
pub unsafe fn getSignInWithAppleUpgradeAuthorizationWithState_nonce_completionHandler( | ||
&self, | ||
state: Option<&NSString>, | ||
nonce: Option<&NSString>, | ||
completionHandler: &Block<(*mut ASAuthorizationAppleIDCredential, *mut NSError), ()>, | ||
); | ||
|
||
#[method(completeUpgradeToSignInWithAppleWithUserInfo:)] | ||
pub unsafe fn completeUpgradeToSignInWithAppleWithUserInfo( | ||
&self, | ||
userInfo: Option<&NSDictionary>, | ||
); | ||
|
||
#[method(completeChangePasswordRequestWithUpdatedCredential:userInfo:)] | ||
pub unsafe fn completeChangePasswordRequestWithUpdatedCredential_userInfo( | ||
&self, | ||
updatedCredential: &ASPasswordCredential, | ||
userInfo: Option<&NSDictionary>, | ||
); | ||
|
||
#[method(cancelRequestWithError:)] | ||
pub unsafe fn cancelRequestWithError(&self, error: &NSError); | ||
} | ||
); |
37 changes: 37 additions & 0 deletions
37
...generated/ASAccountAuthenticationModificationReplacePasswordWithSignInWithAppleRequest.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//! This file has been automatically generated by `objc2`'s `header-translator`. | ||
//! DO NOT EDIT | ||
use crate::common::*; | ||
use crate::AuthenticationServices::*; | ||
use crate::Foundation::*; | ||
|
||
extern_class!( | ||
#[derive(Debug)] | ||
pub struct ASAccountAuthenticationModificationReplacePasswordWithSignInWithAppleRequest; | ||
|
||
unsafe impl ClassType | ||
for ASAccountAuthenticationModificationReplacePasswordWithSignInWithAppleRequest | ||
{ | ||
type Super = ASAccountAuthenticationModificationRequest; | ||
} | ||
); | ||
|
||
extern_methods!( | ||
unsafe impl ASAccountAuthenticationModificationReplacePasswordWithSignInWithAppleRequest { | ||
#[method_id(@__retain_semantics Init initWithUser:serviceIdentifier:userInfo:)] | ||
pub unsafe fn initWithUser_serviceIdentifier_userInfo( | ||
this: Option<Allocated<Self>>, | ||
user: &NSString, | ||
serviceIdentifier: &ASCredentialServiceIdentifier, | ||
userInfo: Option<&NSDictionary>, | ||
) -> Id<Self, Shared>; | ||
|
||
#[method_id(@__retain_semantics Other user)] | ||
pub unsafe fn user(&self) -> Id<NSString, Shared>; | ||
|
||
#[method_id(@__retain_semantics Other serviceIdentifier)] | ||
pub unsafe fn serviceIdentifier(&self) -> Id<ASCredentialServiceIdentifier, Shared>; | ||
|
||
#[method_id(@__retain_semantics Other userInfo)] | ||
pub unsafe fn userInfo(&self) -> Option<Id<NSDictionary, Shared>>; | ||
} | ||
); |
18 changes: 18 additions & 0 deletions
18
...icrate/src/AuthenticationServices/generated/ASAccountAuthenticationModificationRequest.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//! This file has been automatically generated by `objc2`'s `header-translator`. | ||
//! DO NOT EDIT | ||
use crate::common::*; | ||
use crate::AuthenticationServices::*; | ||
use crate::Foundation::*; | ||
|
||
extern_class!( | ||
#[derive(Debug)] | ||
pub struct ASAccountAuthenticationModificationRequest; | ||
|
||
unsafe impl ClassType for ASAccountAuthenticationModificationRequest { | ||
type Super = NSObject; | ||
} | ||
); | ||
|
||
extern_methods!( | ||
unsafe impl ASAccountAuthenticationModificationRequest {} | ||
); |
37 changes: 37 additions & 0 deletions
37
...es/generated/ASAccountAuthenticationModificationUpgradePasswordToStrongPasswordRequest.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//! This file has been automatically generated by `objc2`'s `header-translator`. | ||
//! DO NOT EDIT | ||
use crate::common::*; | ||
use crate::AuthenticationServices::*; | ||
use crate::Foundation::*; | ||
|
||
extern_class!( | ||
#[derive(Debug)] | ||
pub struct ASAccountAuthenticationModificationUpgradePasswordToStrongPasswordRequest; | ||
|
||
unsafe impl ClassType | ||
for ASAccountAuthenticationModificationUpgradePasswordToStrongPasswordRequest | ||
{ | ||
type Super = ASAccountAuthenticationModificationRequest; | ||
} | ||
); | ||
|
||
extern_methods!( | ||
unsafe impl ASAccountAuthenticationModificationUpgradePasswordToStrongPasswordRequest { | ||
#[method_id(@__retain_semantics Init initWithUser:serviceIdentifier:userInfo:)] | ||
pub unsafe fn initWithUser_serviceIdentifier_userInfo( | ||
this: Option<Allocated<Self>>, | ||
user: &NSString, | ||
serviceIdentifier: &ASCredentialServiceIdentifier, | ||
userInfo: Option<&NSDictionary>, | ||
) -> Id<Self, Shared>; | ||
|
||
#[method_id(@__retain_semantics Other user)] | ||
pub unsafe fn user(&self) -> Id<NSString, Shared>; | ||
|
||
#[method_id(@__retain_semantics Other serviceIdentifier)] | ||
pub unsafe fn serviceIdentifier(&self) -> Id<ASCredentialServiceIdentifier, Shared>; | ||
|
||
#[method_id(@__retain_semantics Other userInfo)] | ||
pub unsafe fn userInfo(&self) -> Option<Id<NSDictionary, Shared>>; | ||
} | ||
); |
60 changes: 60 additions & 0 deletions
60
...src/AuthenticationServices/generated/ASAccountAuthenticationModificationViewController.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
//! This file has been automatically generated by `objc2`'s `header-translator`. | ||
//! DO NOT EDIT | ||
use crate::common::*; | ||
use crate::AuthenticationServices::*; | ||
use crate::Foundation::*; | ||
|
||
extern_class!( | ||
#[derive(Debug)] | ||
pub struct ASAccountAuthenticationModificationViewController; | ||
|
||
unsafe impl ClassType for ASAccountAuthenticationModificationViewController { | ||
type Super = ASViewController; | ||
} | ||
); | ||
|
||
extern_methods!( | ||
unsafe impl ASAccountAuthenticationModificationViewController { | ||
#[method_id(@__retain_semantics Other extensionContext)] | ||
pub unsafe fn extensionContext( | ||
&self, | ||
) -> Id<ASAccountAuthenticationModificationExtensionContext, Shared>; | ||
|
||
#[method(convertAccountToSignInWithAppleWithoutUserInteractionForServiceIdentifier:existingCredential:userInfo:)] | ||
pub unsafe fn convertAccountToSignInWithAppleWithoutUserInteractionForServiceIdentifier_existingCredential_userInfo( | ||
&self, | ||
serviceIdentifier: &ASCredentialServiceIdentifier, | ||
existingCredential: &ASPasswordCredential, | ||
userInfo: Option<&NSDictionary>, | ||
); | ||
|
||
#[method(prepareInterfaceToConvertAccountToSignInWithAppleForServiceIdentifier:existingCredential:userInfo:)] | ||
pub unsafe fn prepareInterfaceToConvertAccountToSignInWithAppleForServiceIdentifier_existingCredential_userInfo( | ||
&self, | ||
serviceIdentifier: &ASCredentialServiceIdentifier, | ||
existingCredential: &ASPasswordCredential, | ||
userInfo: Option<&NSDictionary>, | ||
); | ||
|
||
#[method(changePasswordWithoutUserInteractionForServiceIdentifier:existingCredential:newPassword:userInfo:)] | ||
pub unsafe fn changePasswordWithoutUserInteractionForServiceIdentifier_existingCredential_newPassword_userInfo( | ||
&self, | ||
serviceIdentifier: &ASCredentialServiceIdentifier, | ||
existingCredential: &ASPasswordCredential, | ||
newPassword: &NSString, | ||
userInfo: Option<&NSDictionary>, | ||
); | ||
|
||
#[method(prepareInterfaceToChangePasswordForServiceIdentifier:existingCredential:newPassword:userInfo:)] | ||
pub unsafe fn prepareInterfaceToChangePasswordForServiceIdentifier_existingCredential_newPassword_userInfo( | ||
&self, | ||
serviceIdentifier: &ASCredentialServiceIdentifier, | ||
existingCredential: &ASPasswordCredential, | ||
newPassword: &NSString, | ||
userInfo: Option<&NSDictionary>, | ||
); | ||
|
||
#[method(cancelRequest)] | ||
pub unsafe fn cancelRequest(&self); | ||
} | ||
); |
36 changes: 36 additions & 0 deletions
36
crates/icrate/src/AuthenticationServices/generated/ASAuthorization.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
//! This file has been automatically generated by `objc2`'s `header-translator`. | ||
//! DO NOT EDIT | ||
use crate::common::*; | ||
use crate::AuthenticationServices::*; | ||
use crate::Foundation::*; | ||
|
||
pub type ASAuthorizationScope = NSString; | ||
|
||
extern_static!(ASAuthorizationScopeFullName: &'static ASAuthorizationScope); | ||
|
||
extern_static!(ASAuthorizationScopeEmail: &'static ASAuthorizationScope); | ||
|
||
extern_class!( | ||
#[derive(Debug)] | ||
pub struct ASAuthorization; | ||
|
||
unsafe impl ClassType for ASAuthorization { | ||
type Super = NSObject; | ||
} | ||
); | ||
|
||
extern_methods!( | ||
unsafe impl ASAuthorization { | ||
#[method_id(@__retain_semantics Other provider)] | ||
pub unsafe fn provider(&self) -> Id<ASAuthorizationProvider, Shared>; | ||
|
||
#[method_id(@__retain_semantics Other credential)] | ||
pub unsafe fn credential(&self) -> Id<ASAuthorizationCredential, Shared>; | ||
|
||
#[method_id(@__retain_semantics New new)] | ||
pub unsafe fn new() -> Id<Self, Shared>; | ||
|
||
#[method_id(@__retain_semantics Init init)] | ||
pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>; | ||
} | ||
); |
Oops, something went wrong.