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

[AuthenticationServices] Update bindings for Xcode 14 beta 1 and 2 #15427

261 changes: 246 additions & 15 deletions src/authenticationservices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public enum ASCredentialServiceIdentifierType : long {
Url,
}

[NoTV]
[TV (16,0)]
[Watch (6,2)]
[Mac (10,15)]
[iOS (12,0)]
Expand Down Expand Up @@ -252,9 +252,11 @@ interface ASPasswordCredential : NSCopying, NSSecureCoding, ASAuthorizationCrede
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface ASWebAuthenticationSession {
[TV (16,0)]
Copy link
Member

Choose a reason for hiding this comment

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

The type is still NoTV, so that needs to be fixed too.

Copy link
Member

Choose a reason for hiding this comment

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

The type has NoTV already.

[Export ("initWithURL:callbackURLScheme:completionHandler:")]
NativeHandle Constructor (NSUrl url, [NullAllowed] string callbackUrlScheme, ASWebAuthenticationSessionCompletionHandler completionHandler);

[TV (16,0)]
Copy link
Member

Choose a reason for hiding this comment

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

Same.

[Export ("start")]
bool Start ();

Expand All @@ -269,7 +271,7 @@ interface ASWebAuthenticationSession {
[Export ("prefersEphemeralWebBrowserSession")]
bool PrefersEphemeralWebBrowserSession { get; set; }

[Mac (10,15,4), iOS (13,4)]
[Mac (10,15,4), iOS (13,4), TV (16,0)]
Copy link
Member

Choose a reason for hiding this comment

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

Same.

[Export ("canStart")]
bool CanStart { get; }
}
Expand Down Expand Up @@ -437,6 +439,18 @@ interface ASAuthorizationController {
[TV (15,0), NoWatch, NoMac, NoiOS, NoMacCatalyst]
[Export ("customAuthorizationMethods", ArgumentSemantic.Copy)]
NSString[] CustomAuthorizationMethods { get; set; }

[NoWatch, NoTV, NoMacCatalyst, NoMac, iOS (16,0)]
[Export ("performAutoFillAssistedRequests")]
void PerformAutoFillAssistedRequests ();

[NoWatch, NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
[Export ("performRequestsWithOptions:")]
void PerformRequests (ASAuthorizationControllerRequestOptions options);

[NoWatch, NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)]
[Export ("cancel")]
void Cancel ();
}

interface IASAuthorizationCredential { }
Expand Down Expand Up @@ -614,6 +628,10 @@ interface ASAuthorizationProviderExtensionAuthorizationRequest {
[Mac (12,3), iOS (15,4), MacCatalyst (15,4)]
[Export ("userInterfaceEnabled")]
bool UserInterfaceEnabled { [Bind ("isUserInterfaceEnabled")] get; }

[NoWatch, NoTV, NoiOS, NoMacCatalyst, Mac (13, 0)]
[Export ("loginManager", ArgumentSemantic.Strong)]
ASAuthorizationProviderExtensionLoginManager LoginManager { get; }
}

[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
Expand Down Expand Up @@ -994,7 +1012,7 @@ interface ASAuthorizationPublicKeyCredentialAttestationKind
NSString Enterprise { get; }
}

[iOS (15,0), Mac (12,0), MacCatalyst (15,0), NoWatch, NoTV]
[iOS (15,0), Mac (12,0), MacCatalyst (15,0), NoWatch, TV (16,0)]
[Static]
interface ASAuthorizationPublicKeyCredentialUserVerificationPreference
{
Expand Down Expand Up @@ -1043,7 +1061,7 @@ enum ASCoseAlgorithmIdentifier : long {

interface IASAuthorizationPublicKeyCredentialAssertion { }

[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0), NoTV]
[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0), TV (16,0)]
[Protocol]
interface ASAuthorizationPublicKeyCredentialAssertion : ASPublicKeyCredential
{
Expand All @@ -1060,7 +1078,7 @@ interface ASAuthorizationPublicKeyCredentialAssertion : ASPublicKeyCredential
NSData Signature { get; }
}

[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0), NoTV]
[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0), TV (16,0)]
[BaseType (typeof (ASAuthorizationRequest))]
[DisableDefaultCtor]
interface ASAuthorizationPlatformPublicKeyCredentialAssertionRequest : ASAuthorizationPublicKeyCredentialAssertionRequest
Expand All @@ -1084,7 +1102,7 @@ interface ASAuthorizationSecurityKeyPublicKeyCredentialAssertionRequest : ASAuth

interface IASAuthorizationPublicKeyCredentialAssertionRequest { }

[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0), NoTV]
[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0), TV (16,0)]
[Protocol]
interface ASAuthorizationPublicKeyCredentialAssertionRequest : NSSecureCoding, NSCopying
{
Expand All @@ -1107,7 +1125,7 @@ interface ASAuthorizationPublicKeyCredentialAssertionRequest : NSSecureCoding, N

interface IASAuthorizationPublicKeyCredentialDescriptor { }

[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0), NoTV]
[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0), TV (16,0)]
[Protocol]
interface ASAuthorizationPublicKeyCredentialDescriptor : NSSecureCoding, NSCopying
{
Expand All @@ -1116,7 +1134,7 @@ interface ASAuthorizationPublicKeyCredentialDescriptor : NSSecureCoding, NSCopyi
NSData CredentialId { get; set; }
}

[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0), NoTV]
[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0), TV (16,0)]
[Protocol]
interface ASAuthorizationPublicKeyCredentialRegistration : ASPublicKeyCredential
{
Expand All @@ -1125,7 +1143,7 @@ interface ASAuthorizationPublicKeyCredentialRegistration : ASPublicKeyCredential
NSData RawAttestationObject { get; }
}

[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0), NoTV]
[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0), TV (16,0)]
[Protocol]
interface ASAuthorizationPublicKeyCredentialRegistrationRequest : NSSecureCoding, NSCopying
{
Expand Down Expand Up @@ -1158,7 +1176,7 @@ interface ASAuthorizationPublicKeyCredentialRegistrationRequest : NSSecureCoding
NSString AttestationPreference { get; set; }
}

[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0), NoTV]
[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0), TV (16,0)]
[Protocol]
interface ASPublicKeyCredential : ASAuthorizationCredential
{
Expand All @@ -1171,7 +1189,7 @@ interface ASPublicKeyCredential : ASAuthorizationCredential
NSData CredentialId { get; }
}

[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0), NoTV]
[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0), TV (16,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface ASAuthorizationPlatformPublicKeyCredentialDescriptor : ASAuthorizationPublicKeyCredentialDescriptor
Expand All @@ -1181,7 +1199,7 @@ interface ASAuthorizationPlatformPublicKeyCredentialDescriptor : ASAuthorization
NativeHandle Constructor (NSData credentialId);
}

[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0), NoTV]
[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0), TV (16,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface ASAuthorizationPlatformPublicKeyCredentialProvider : ASAuthorizationProvider
Expand Down Expand Up @@ -1299,13 +1317,13 @@ interface ASAuthorizationCustomMethod
NSString Other { get; }
}

[NoWatch, NoTV, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[NoWatch, TV (16,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof (NSObject))]
interface ASAuthorizationPlatformPublicKeyCredentialAssertion : ASAuthorizationPublicKeyCredentialAssertion
{
}

[NoWatch, NoTV, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[NoWatch, TV (16,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof (ASAuthorizationRequest))]
[DisableDefaultCtor]
interface ASAuthorizationPlatformPublicKeyCredentialRegistrationRequest : ASAuthorizationPublicKeyCredentialRegistrationRequest
Expand All @@ -1325,9 +1343,222 @@ interface ASAuthorizationSecurityKeyPublicKeyCredentialRegistration : ASAuthoriz
{
}

[NoWatch, NoTV, Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[NoWatch, TV (16,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[BaseType (typeof (NSObject))]
interface ASAuthorizationPlatformPublicKeyCredentialRegistration : ASAuthorizationPublicKeyCredentialRegistration
{
}

[NoWatch, NoTV, NoMacCatalyst, Mac (13,0), iOS (16,0)]
[Flags, Native]
public enum ASAuthorizationControllerRequestOptions : ulong
{
PreferImmediatelyAvailableCredentials = 1uL << 0,
}

[NoWatch, NoTV, NoiOS, NoMacCatalyst, Mac (13,0)]
[Native]
public enum ASAuthorizationProviderExtensionAuthenticationMethod : long
{
Password = 1,
UserSecureEnclaveKey = 2,
}

[NoWatch, NoTV, NoiOS, NoMacCatalyst, Mac (13,0)]
[Native]
public enum ASAuthorizationProviderExtensionKeyType : long
{
DeviceSigning = 1,
DeviceEncryption = 2,
SecureEnclaveKey = 3,
}

[NoWatch, NoTV, NoiOS, NoMacCatalyst, Mac (13,0)]
[Native]
public enum ASAuthorizationProviderExtensionRegistrationResult : long
{
Success = 0,
Failed = 1,
UserInterfaceRequired = 2,
FailedNoRetry = 3,
}

[NoWatch, NoTV, NoiOS, NoMacCatalyst, Mac (13,0)]
[Flags]
[Native]
public enum ASAuthorizationProviderExtensionRequestOptions : ulong
{
None = 0x0,
UserInteractionEnabled = 1uL << 0,
RegistrationRepair = 1uL << 1,
}

[NoWatch, NoTV, NoiOS, NoMacCatalyst, Mac (13,0)]
[Protocol]
[BaseType (typeof (NSObject))]
interface ASAuthorizationProviderExtensionRegistrationHandler
{
[Abstract]
[Export ("beginDeviceRegistrationUsingLoginManager:options:completion:")]
void BeginDeviceRegistration (ASAuthorizationProviderExtensionLoginManager loginManager, ASAuthorizationProviderExtensionRequestOptions options, Action<ASAuthorizationProviderExtensionRegistrationResult> completion);

[Abstract]
[Export ("beginUserRegistrationUsingLoginManager:userName:authenticationMethod:options:completion:")]
void BeginUserRegistration (ASAuthorizationProviderExtensionLoginManager loginManager, [NullAllowed] string userName, ASAuthorizationProviderExtensionAuthenticationMethod authenticationMethod, ASAuthorizationProviderExtensionRequestOptions options, Action<ASAuthorizationProviderExtensionRegistrationResult> completion);

[Export ("registrationDidComplete")]
void RegistrationDidComplete ();
}

[NoWatch, NoTV, NoiOS, NoMacCatalyst, Mac (13,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface ASAuthorizationProviderExtensionLoginConfiguration
{
[Export ("initWithClientID:issuer:tokenEndpointURL:jwksEndpointURL:audience:")]
NativeHandle Constructor (string clientID, string issuer, NSUrl tokenEndpointUrl, NSUrl jwksEndpointUrl, [NullAllowed] string audience);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
NativeHandle Constructor (string clientID, string issuer, NSUrl tokenEndpointUrl, NSUrl jwksEndpointUrl, [NullAllowed] string audience);
NativeHandle Constructor (string clientId, string issuer, NSUrl tokenEndpointUrl, NSUrl jwksEndpointUrl, [NullAllowed] string audience);


[Static]
[Export ("configurationWithOpenIDConfigurationURL:clientID:issuer:completion:")]
void CreateConfiguration (NSUrl openIDConfigurationUrl, string clientID, [NullAllowed] string issuer, Action<ASAuthorizationProviderExtensionLoginConfiguration, NSError> completion);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
void CreateConfiguration (NSUrl openIDConfigurationUrl, string clientID, [NullAllowed] string issuer, Action<ASAuthorizationProviderExtensionLoginConfiguration, NSError> completion);
void CreateConfiguration (NSUrl openIdConfigurationUrl, string clientId, [NullAllowed] string issuer, Action<ASAuthorizationProviderExtensionLoginConfiguration, NSError> completion);


[NullAllowed, Export ("invalidCredentialPredicate")]
string InvalidCredentialPredicate { get; set; }

[NullAllowed, Export ("accountDisplayName")]
string AccountDisplayName { get; set; }

[Export ("clientID")]
string ClientID { get; }
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
string ClientID { get; }
string ClientId { get; }


[Export ("issuer")]
string Issuer { get; }

[Export ("audience")]
string Audience { get; set; }

[Export ("tokenEndpointURL", ArgumentSemantic.Copy)]
NSUrl TokenEndpointUrl { get; set; }

[Export ("jwksEndpointURL", ArgumentSemantic.Copy)]
NSUrl JwksEndpointUrl { get; set; }

[Export ("nonceEndpointURL", ArgumentSemantic.Copy)]
NSUrl NonceEndpointUrl { get; set; }

[Export ("nonceResponseKeypath")]
string NonceResponseKeypath { get; set; }

[Export ("serverNonceClaimName")]
string ServerNonceClaimName { get; set; }

[Export ("customNonceRequestValues", ArgumentSemantic.Copy)]
NSUrlQueryItem[] CustomNonceRequestValues { get; set; }

[Export ("setCustomAssertionRequestHeaderClaims:returningError:")]
bool SetCustomAssertionRequestHeaderClaims (NSDictionary<NSString, NSObject> claims, [NullAllowed] out NSError error);

[Export ("setCustomAssertionRequestBodyClaims:returningError:")]
bool SetCustomAssertionRequestBodyClaims (NSDictionary<NSString, NSObject> claims, [NullAllowed] out NSError error);

[Export ("additionalScopes")]
string AdditionalScopes { get; set; }

[Export ("includePreviousRefreshTokenInLoginRequest")]
bool IncludePreviousRefreshTokenInLoginRequest { get; set; }

[Export ("previousRefreshTokenClaimName")]
string PreviousRefreshTokenClaimName { get; set; }

[Export ("customLoginRequestValues", ArgumentSemantic.Copy)]
NSUrlQueryItem[] CustomLoginRequestValues { get; set; }

[Export ("setCustomLoginRequestHeaderClaims:returningError:")]
bool SetCustomLoginRequestHeaderClaims (NSDictionary<NSString, NSObject> claims, [NullAllowed] out NSError error);

[Export ("setCustomLoginRequestBodyClaims:returningError:")]
bool SetCustomLoginRequestBodyClaims (NSDictionary<NSString, NSObject> claims, [NullAllowed] out NSError error);

[Export ("kerberosTicketMappings", ArgumentSemantic.Copy)]
ASAuthorizationProviderExtensionKerberosMapping[] KerberosTicketMappings { get; set; }
}

[NoWatch, NoTV, NoiOS, NoMacCatalyst, Mac (13,0)]
[BaseType (typeof (NSObject))]
interface ASAuthorizationProviderExtensionKerberosMapping
{
[NullAllowed, Export ("ticketKeyPath")]
string TicketKeyPath { get; set; }

[NullAllowed, Export ("messageBufferKeyName")]
string MessageBufferKeyName { get; set; }

[NullAllowed, Export ("realmKeyName")]
string RealmKeyName { get; set; }

[NullAllowed, Export ("serviceNameKeyName")]
string ServiceNameKeyName { get; set; }

[NullAllowed, Export ("clientNameKeyName")]
string ClientNameKeyName { get; set; }

[NullAllowed, Export ("encryptionKeyTypeKeyName")]
string EncryptionKeyTypeKeyName { get; set; }

[NullAllowed, Export ("sessionKeyKeyName")]
string SessionKeyKeyName { get; set; }
}

[NoWatch, NoTV, NoiOS, Mac (13,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface ASAuthorizationProviderExtensionLoginManager
{
[Export ("deviceRegistered")]
bool DeviceRegistered { [Bind ("isDeviceRegistered")] get; }

[Export ("userRegistered")]
bool UserRegistered { [Bind ("isUserRegistered")] get; }

[NullAllowed, Export ("registrationToken")]
string RegistrationToken { get; }

[NullAllowed, Export ("loginUserName")]
string LoginUserName { get; set; }

[NullAllowed, Export ("ssoTokens", ArgumentSemantic.Copy)]
NSDictionary SsoTokens { get; set; }

[NullAllowed, Export ("loginConfiguration", ArgumentSemantic.Copy)]
ASAuthorizationProviderExtensionLoginConfiguration LoginConfiguration { get; }

[Export ("saveLoginConfiguration:error:")]
bool SaveLoginConfiguration (ASAuthorizationProviderExtensionLoginConfiguration loginConfiguration, [NullAllowed] out NSError error);

[Export ("saveCertificate:keyType:")]
void SaveCertificate (SecCertificate certificate, ASAuthorizationProviderExtensionKeyType keyType);

[Export ("copyKeyForKeyType:")]
[return: NullAllowed]
SecKey CopyKey (ASAuthorizationProviderExtensionKeyType keyType);

[Export ("copyIdentityForKeyType:")]
[return: NullAllowed]
SecIdentity CopyIdentity (ASAuthorizationProviderExtensionKeyType keyType);

[Export ("userNeedsReauthenticationWithCompletion:")]
void ReauthenticateUser (Action<NSError> completion);
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this could be an async candidate: [Async]


[Export ("deviceRegistrationsNeedsRepair")]
void RepairDeviceRegistrations ();

[Export ("userRegistrationsNeedsRepair")]
void RepairUserRegistrations ();

[Export ("resetKeys")]
void ResetKeys ();

[Export ("presentRegistrationViewControllerWithCompletion:")]
void PresentRegistrationViewController (Action<NSError> completion);
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this could be an async candidate: [Async]

}
}

This file was deleted.

Loading