From d503825e70d08ee961bbc2f61095b18d89bdaa58 Mon Sep 17 00:00:00 2001 From: jidong Date: Wed, 4 Jan 2023 21:50:28 +0800 Subject: [PATCH] fixed df5836b from https://gitee.com/JiDong-CS/interface_sdk-js/pulls/3923 remove app account permission and add domain account interface Signed-off-by: jidong Change-Id: I7e50cee31946311dc44e2ab5d392b0c1d653b9ba --- api/@ohos.account.appAccount.d.ts | 4 --- api/@ohos.account.osAccount.d.ts | 56 +++++++++++++++++++++++++++++-- 2 files changed, 54 insertions(+), 6 deletions(-) diff --git a/api/@ohos.account.appAccount.d.ts b/api/@ohos.account.appAccount.d.ts index 10268954de..c1946230f1 100644 --- a/api/@ohos.account.appAccount.d.ts +++ b/api/@ohos.account.appAccount.d.ts @@ -384,9 +384,7 @@ declare namespace appAccount { *
  • Accounts of third-party applications. To obtain such information, * your application must have gained authorization from the third-party applications.
  • * - * @permission ohos.permission.GET_ALL_APP_ACCOUNTS * @returns Returns a list of application accounts. - * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @since 9 @@ -422,10 +420,8 @@ declare namespace appAccount { *
  • Accounts of third-party applications. To obtain such information, * your application must have gained authorization from the third-party applications.
  • * - * @permission ohos.permission.GET_ALL_APP_ACCOUNTS * @param owner Indicates the account owner of your application or third-party applications. * @returns Returns a list of application accounts. - * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid owner. diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts index 1e59ae03f7..4127cccd1d 100644 --- a/api/@ohos.account.osAccount.d.ts +++ b/api/@ohos.account.osAccount.d.ts @@ -1032,6 +1032,7 @@ declare namespace osAccount { /** * Register credential inputer by authentication type. * @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL or ohos.permission.MANAGE_USER_IDM + * @static * @param authType Indicates the authentication type. * @param inputer Indicates the credential input box callback. * @throws {BusinessError} 201 - permission denied. @@ -1044,11 +1045,12 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 9 */ - registerInputer(authType: AuthType, inputer: IInputer): void; + static registerInputer(authType: AuthType, inputer: IInputer): void; /** * Unregister credential inputer by authentication type. * @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL or ohos.permission.MANAGE_USER_IDM + * @static * @param authType Indicates the authentication type. * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 202 - not system application. @@ -1057,7 +1059,57 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 9 */ - unregisterInputer(authType: AuthType): void; + static unregisterInputer(authType: AuthType): void; + } + + /** + * Provides the definition of domain plugin. + * @interface DomainPlugin + * @syscap SystemCapability.Account.OsAccount + * @since 9 + */ + interface DomainPlugin { + /** + * Authenticates the specified domain account. + * @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information for authentication. + * @param { Uint8Array } credential - Indicates the credential for authentication. + * @param { IUserAuthCallback } callback - Indicates the authentication callback. + * @systemapi Hide this for inner system use. + * @since 9 + */ + auth(domainAccountInfo: DomainAccountInfo, credential: Uint8Array, callback: IUserAuthCallback): void; + } + + /** + * Provides abilities for the management of domain account. + * @syscap SystemCapability.Account.OsAccount + * @since 9 + */ + class DomainAccountManager { + /** + * Registers the domain plugin, which provides the capabilities for domain authentication. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS + * @static + * @param { DomainPlugin } plugin - Indicates the domain plugin. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - not system application. + * @throws { BusinessError } 401 - the parameter check failed. + * @throws { BusinessError } 12300201 - the domain plugin has been registered. + * @systemapi Hide this for inner system use. + * @since 9 + */ + static registerPlugin(plugin: DomainPlugin): void; + + /** + * Unregisters domain plugin. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS + * @static + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - not system application. + * @systemapi Hide this for inner system use. + * @since 9 + */ + static unregisterPlugin(): void; } /** -- Gitee