1 /* 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OS_ACCOUNT_SERVICES_ACCOUNTMGR_INCLUDE_APPACCOUNT_APP_ACCOUNT_CONSTANTS_H 17 #define OS_ACCOUNT_SERVICES_ACCOUNTMGR_INCLUDE_APPACCOUNT_APP_ACCOUNT_CONSTANTS_H 18 19 #include "account_error_no.h" 20 #include "iaccount_info.h" 21 #include "parcel.h" 22 23 namespace OHOS { 24 namespace AccountSA { 25 namespace Constants { 26 const std::string SYSTEM_ACTION_APP_ACCOUNT_AUTH = "ohos.appAccount.action.auth"; 27 const std::string SYSTEM_ACTION_APP_ACCOUNT_OAUTH = "ohos.account.appAccount.action.oauth"; 28 const std::string OAUTH_ACTION_ADD_ACCOUNT_IMPLICITLY = "addAccountImplicitly"; 29 const std::string OAUTH_ACTION_AUTHENTICATE = "authenticate"; 30 const std::string ACTION_CREATE_ACCOUNT_IMPLICITLY = "createAccountImplicitly"; 31 const std::string ACTION_AUTH = "auth"; 32 const std::string ACTION_VERIFY_CREDENTIAL = "verifyCredential"; 33 const std::string ACTION_SET_AUTHENTICATOR_PROPERTIES = "setAuthenticatorProperties"; 34 const std::string APP_ACCOUNT_APP_ID = "app_account_manager_service"; 35 const std::string KEY_NAME = "name"; 36 const std::string KEY_OWNER = "owner"; 37 const std::string KEY_TOKEN = "token"; 38 const std::string KEY_ACTION = "action"; 39 const std::string KEY_AUTH_TYPE = "authType"; 40 const std::string KEY_SESSION_ID = "sessionId"; 41 const std::string KEY_CALLER_BUNDLE_NAME = "callerBundleName"; 42 const std::string KEY_CALLER_ABILITY_NAME = "callerAbilityName"; 43 const std::string KEY_CALLER_PID = "callerPid"; 44 const std::string KEY_CALLER_UID = "callerUid"; 45 const std::string KEY_REQUIRED_LABELS = "requiredLabels"; 46 const std::string KEY_BOOLEAN_RESULT = "booleanResult"; 47 const std::string KEY_ACCOUNT_NAMES = "accountNames"; 48 const std::string KEY_ACCOUNT_OWNERS = "accountOwners"; 49 const std::string SPECIAL_CHARACTERS = " "; 50 const std::string HYPHEN = "#"; 51 const std::string API_V9 = "apiV9"; 52 53 constexpr std::size_t APP_ACCOUNT_SUBSCRIBER_MAX_SIZE = 200; 54 constexpr std::size_t NAME_MAX_SIZE = 512; 55 constexpr std::size_t EXTRA_INFO_MAX_SIZE = 1024; 56 constexpr std::size_t BUNDLE_NAME_MAX_SIZE = 512; 57 constexpr std::size_t ASSOCIATED_KEY_MAX_SIZE = 1024; 58 constexpr std::size_t ASSOCIATED_VALUE_MAX_SIZE = 1024; 59 constexpr std::size_t CREDENTIAL_TYPE_MAX_SIZE = 1024; 60 constexpr std::size_t CREDENTIAL_MAX_SIZE = 1024; 61 constexpr std::size_t TOKEN_MAX_SIZE = 1024; 62 constexpr std::size_t OWNER_MAX_SIZE = 1024; 63 constexpr std::size_t AUTH_TYPE_MAX_SIZE = 1024; 64 constexpr std::size_t ABILITY_NAME_MAX_SIZE = 512; 65 constexpr std::size_t SESSION_ID_MAX_SIZE = 1024; 66 constexpr std::size_t MAX_ALLOWED_ARRAY_SIZE_INPUT = 1024; 67 constexpr std::size_t MAX_CUSTOM_DATA_SIZE = 1024; 68 constexpr uint32_t API_VERSION7 = 7; 69 constexpr uint32_t API_VERSION8 = 8; 70 constexpr uint32_t API_VERSION9 = 9; 71 }; // namespace Constants 72 } // namespace AccountSA 73 } // namespace OHOS 74 75 #endif // OS_ACCOUNT_SERVICES_ACCOUNTMGR_INCLUDE_APPACCOUNT_APP_ACCOUNT_CONSTANTS_H 76