From ebeb601846f5d4640b48e80313453fdd026ceb47 Mon Sep 17 00:00:00 2001 From: yujiale Date: Tue, 14 Mar 2023 15:03:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=E7=94=9F=E6=88=90=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E7=89=88=E7=9A=84=20authing=20server=20java=20sdk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sdk/java/client/AuthenticationClient.java | 3605 +++---- .../sdk/java/client/ManagementClient.java | 8384 ++++++++++------- .../dto/AddTenantDepartmentMembersReqDto.java | 106 + .../sdk/java/dto/AddTenantUsersDto.java | 35 + .../sdk/java/dto/AppQRCodeLoginDto.java | 59 + .../authing/sdk/java/dto/ApplicationDto.java | 3 + .../dto/ApplicationEnabledExtIdpConnDto.java | 42 + .../java/dto/ApplicationSimpleInfoDto.java | 3 + .../java/dto/AuthenticationCredentialDto.java | 60 + .../java/dto/AuthenticationOptionsDto.java | 36 + .../AuthenticatorAssertionResponseDto.java | 59 + .../AuthenticatorAttestationResponseDto.java | 35 + .../sdk/java/dto/BindByAccountIdInputApi.java | 47 + .../sdk/java/dto/BindByAccountInputApi.java | 59 + .../sdk/java/dto/BindByAccountsInputApi.java | 47 + .../sdk/java/dto/BindByEmailCodeInputApi.java | 59 + .../sdk/java/dto/BindByPhoneCodeInputApi.java | 71 + .../sdk/java/dto/BindByRegiserInputApi.java | 35 + .../sdk/java/dto/ChangePushCodeStatusDto.java | 64 + .../java/dto/CheckDeviceCredentialIdDto.java | 11 + .../java/dto/CheckPushCodeStatusDataDto.java | 68 + .../java/dto/CheckPushCodeStatusRespDto.java | 72 + .../sdk/java/dto/CheckPushcodeStatusDto.java | 23 + .../dto/CheckResourcePermissionsRespDto.java | 12 + .../sdk/java/dto/CreateApplicationDto.java | 3 + .../dto/CreateApplicationRespDataDto.java | 3 + .../sdk/java/dto/CreateDepartmentReqDto.java | 12 + .../sdk/java/dto/CreateEventAppDto.java | 47 + .../sdk/java/dto/CreateExtIdpConnDto.java | 30 + .../authing/sdk/java/dto/CreateExtIdpDto.java | 12 + .../sdk/java/dto/CreateIdentityDto.java | 12 + .../dto/CreateMultipleTenantAdminDto.java | 71 + .../java/dto/CreateOrganizationReqDto.java | 12 + .../authing/sdk/java/dto/CreatePostDto.java | 59 + .../sdk/java/dto/CreatePostRespDto.java | 72 + .../java/dto/CreateTenantCooperatorDto.java | 71 + .../authing/sdk/java/dto/CreateTenantDto.java | 83 + .../sdk/java/dto/CreateTenantRespDto.java | 72 + .../java/dto/CreateTenantUserOptionsDto.java | 93 + .../sdk/java/dto/CreateTenantUserReqDto.java | 322 + .../authing/sdk/java/dto/DefineEventDto.java | 35 + .../authing/sdk/java/dto/DeleteTenantDto.java | 23 + .../authing/sdk/java/dto/DepartmentDto.java | 12 + .../cn/authing/sdk/java/dto/EventAppDto.java | 47 + .../java/dto/EventAppPaginatedRespDto.java | 72 + .../sdk/java/dto/EventAppPagingDto.java | 36 + .../sdk/java/dto/ExtIdpConnDetail.java | 30 + .../authing/sdk/java/dto/ExtIdpInfoDto.java | 12 + .../dto/FastpassQRCodeRelationAppDto.java | 47 + .../sdk/java/dto/FastpassUserInfoDto.java | 47 + .../java/dto/GeneFastpassQRCodeInfoDto.java | 84 + .../java/dto/GeneFastpassQRCodeRespDto.java | 72 + .../sdk/java/dto/GenePushCodeDataDto.java | 35 + .../sdk/java/dto/GenePushCodeRespDto.java | 72 + .../dto/GenerateInviteTenantUserLink.java | 59 + .../java/dto/GetAppLoginQrcodeStatusDto.java | 23 + .../dto/GetAuthenticationOptionsRespDto.java | 72 + .../java/dto/GetFastpassClientAppsDto.java | 29 + .../dto/GetFastpassQRCodeRelationAppsDto.java | 24 + .../GetFastpassQRCodeRelationAppsRespDto.java | 72 + .../java/dto/GetMultipleTenantAdminDto.java | 23 + .../sdk/java/dto/GetPostByIdListDto.java | 23 + .../cn/authing/sdk/java/dto/GetPostDto.java | 23 + .../dto/GetPushCodeRelationAppsDataDto.java | 23 + .../java/dto/GetPushCodeRelationAppsDto.java | 35 + .../dto/GetPushCodeRelationAppsRespDto.java | 72 + .../dto/GetRegistrationOptionsRespDto.java | 72 + .../sdk/java/dto/GetTenantCooperatorDto.java | 23 + .../java/dto/GetTenantCooperatorMenuDto.java | 23 + .../cn/authing/sdk/java/dto/GetTenantDto.java | 71 + .../sdk/java/dto/GetTenantUserDto.java | 47 + .../dto/GetUserAuthResourceListRespDto.java | 12 + .../GetUserAuthResourcePermissionList.java | 81 +- ...UserAuthResourcePermissionListDataDto.java | 28 +- .../GetUserAuthResourcePermissionListDto.java | 29 +- ...UserAuthResourcePermissionListRespDto.java | 117 +- .../dto/GetUserAuthResourceStructDataDto.java | 213 +- .../dto/GetUserAuthResourceStructDto.java | 28 +- .../dto/GetUserAuthResourceStructRespDto.java | 117 +- .../authing/sdk/java/dto/GetUserPostDto.java | 23 + .../cn/authing/sdk/java/dto/IdentityDto.java | 12 + .../authing/sdk/java/dto/ImportTenantDto.java | 23 + .../sdk/java/dto/ImportTenantHistoryDto.java | 35 + .../java/dto/ImportTenantNotifyUserDto.java | 47 + .../sdk/java/dto/InviteTenantUserRecord.java | 83 + .../dto/InviteTenantUserRecordListDto.java | 36 + .../InviteTenantUserRecordListRespDto.java | 72 + .../sdk/java/dto/InviteTenantUsersDto.java | 37 + .../java/dto/InviteTenantUsersRespDto.java | 72 + .../sdk/java/dto/ListDeviceCredentialDto.java | 11 + .../authing/sdk/java/dto/ListEventsDto.java | 47 + .../dto/ListInviteTenantUserRecordsDto.java | 47 + .../java/dto/ListMultipleTenantAdminsDto.java | 47 + .../cn/authing/sdk/java/dto/ListPostDto.java | 59 + .../sdk/java/dto/ListTenantAdminDto.java | 59 + .../java/dto/ListTenantCooperatorsDto.java | 59 + .../sdk/java/dto/ListTenantUserDto.java | 48 + .../java/dto/ListTenantUsersOptionsDto.java | 24 + .../authing/sdk/java/dto/ListTenantsDto.java | 95 + .../dto/ListUsersAdvancedFilterItemDto.java | 2 +- .../sdk/java/dto/MultipleTenantAdminDto.java | 83 + .../dto/MultipleTenantAdminListPagingDto.java | 36 + .../MultipleTenantAdminPaginatedRespDto.java | 72 + .../cn/authing/sdk/java/dto/OpenEventDto.java | 71 + .../java/dto/OpenEventPaginatedRespDto.java | 72 + .../sdk/java/dto/OpenEventPagingDto.java | 36 + .../authing/sdk/java/dto/OrganizationDto.java | 12 + .../java/cn/authing/sdk/java/dto/PostDto.java | 47 + .../cn/authing/sdk/java/dto/PostInfoDto.java | 59 + .../cn/authing/sdk/java/dto/PostItemDto.java | 71 + .../sdk/java/dto/PostPaginatedRespDto.java | 72 + .../authing/sdk/java/dto/PostPagingDto.java | 36 + .../cn/authing/sdk/java/dto/PostRespDto.java | 72 + .../cn/authing/sdk/java/dto/PubEventDto.java | 35 + .../sdk/java/dto/PubEventRespDataDto.java | 35 + .../authing/sdk/java/dto/PubEventRespDto.java | 72 + ...PublicKeyCredentialCreationOptionsDto.java | 87 + .../dto/PublicKeyCredentialDescriptorDto.java | 52 + .../dto/PublicKeyCredentialParametersDto.java | 35 + .../PublicKeyCredentialRequestOptionsDto.java | 60 + .../dto/PublicKeyCredentialRpEntityDto.java | 35 + .../dto/PublicKeyCredentialUserEntityDto.java | 47 + .../java/dto/RegistrationCredentialDto.java | 77 + .../sdk/java/dto/RegistrationOptionsDto.java | 36 + .../java/dto/RemoveDeviceCredentialDto.java | 11 + .../authing/sdk/java/dto/RemovePostDto.java | 23 + .../RemoveTenantDepartmentMembersReqDto.java | 106 + .../sdk/java/dto/RemoveTenantUsersDto.java | 47 + .../sdk/java/dto/SendManyTenantEmailDto.java | 48 + .../sdk/java/dto/SendManyTenantSmsDto.java | 48 + .../sdk/java/dto/SendTenantEmailDto.java | 83 + .../sdk/java/dto/SendTenantSmsDto.java | 95 + .../sdk/java/dto/SignInByBaiduPayloadDto.java | 35 + .../java/dto/SignInByDingTalkPayloadDto.java | 35 + .../java/dto/SignInByFacebookPayloadDto.java | 23 + .../java/dto/SignInByLinkedInPayloadDto.java | 23 + .../authing/sdk/java/dto/SignInByPushDto.java | 36 + .../sdk/java/dto/SignInByPushOptionsDto.java | 58 + .../sdk/java/dto/SignInByQQPayloadDto.java | 23 + .../java/dto/SignInByWebAuthnOptionsDto.java | 58 + ...chatMiniProgramCodeAndPhonePayloadDto.java | 37 + ...yWechatMiniProgramPhoneInfoPayloadDto.java | 23 + .../sdk/java/dto/SignInByWeiboPayloadDto.java | 23 + .../sdk/java/dto/SignInFastpassDto.java | 24 + .../java/dto/SignInFastpassOptionsDto.java | 58 + .../sdk/java/dto/SigninByMobileDto.java | 126 + .../sdk/java/dto/TenantCooperatorDto.java | 73 + .../dto/TenantCooperatorListPagingDto.java | 36 + .../dto/TenantCooperatorPaginatedRespDto.java | 72 + .../java/dto/TenantCooperatorSingleDto.java | 35 + .../dto/TenantCooperatorSingleRespDto.java | 72 + .../cn/authing/sdk/java/dto/TenantDto.java | 119 + .../java/dto/TenantListPaginatedRespDto.java | 72 + .../sdk/java/dto/TenantListPagingDto.java | 36 + .../authing/sdk/java/dto/TenantRespDto.java | 143 + .../sdk/java/dto/TenantSingleRespDto.java | 72 + .../authing/sdk/java/dto/TenantUserDto.java | 393 + .../dto/TenantUserListPaginatedRespDto.java | 72 + .../sdk/java/dto/TenantUserListPagingDto.java | 36 + .../sdk/java/dto/TenantUserSingleRespDto.java | 72 + .../sdk/java/dto/UpdateDepartmentReqDto.java | 12 + .../dto/UpdateMultipleTenantAdminDto.java | 35 + .../java/dto/UpdateOrganizationReqDto.java | 12 + .../java/dto/UpdateTenantCooperatorDto.java | 35 + .../authing/sdk/java/dto/UpdateTenantDto.java | 95 + .../sdk/java/dto/UpdateTenantUserDto.java | 59 + .../sdk/java/dto/UserConnectionPostDto.java | 35 + .../java/cn/authing/sdk/java/dto/UserDto.java | 12 + .../sdk/java/dto/VerifyAuthenticationDto.java | 49 + .../dto/VerifyAuthenticationResultDto.java | 36 + .../VerifyAuthenticationResultRespDto.java | 72 + .../sdk/java/dto/VerifyRegistrationDto.java | 80 + .../java/dto/VerifyRegistrationResultDto.java | 23 + .../dto/VerifyRegistrationResultRespDto.java | 72 + .../dto/WechatIdentityResolveRespDataDto.java | 47 + .../dto/WechatIdentityResolveRespDto.java | 84 + .../sdk/java/dto/WechatLoginTokenRespDto.java | 83 + .../WechatMobileAuthByCodeIdentityInput.java | 60 + .../java/dto/WechatMobileAuthByCodeInput.java | 47 + .../authing/sdk/java/dto/errorEmailMsg.java | 35 + .../dto/sendInviteTenantUserEmailDto.java | 11 + 181 files changed, 16003 insertions(+), 5517 deletions(-) create mode 100644 src/main/java/cn/authing/sdk/java/dto/AddTenantDepartmentMembersReqDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/AddTenantUsersDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/AppQRCodeLoginDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/AuthenticationCredentialDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/AuthenticationOptionsDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/AuthenticatorAssertionResponseDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/AuthenticatorAttestationResponseDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/BindByAccountIdInputApi.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/BindByAccountInputApi.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/BindByAccountsInputApi.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/BindByEmailCodeInputApi.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/BindByPhoneCodeInputApi.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/BindByRegiserInputApi.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/ChangePushCodeStatusDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/CheckDeviceCredentialIdDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/CheckPushCodeStatusDataDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/CheckPushCodeStatusRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/CheckPushcodeStatusDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/CreateEventAppDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/CreateMultipleTenantAdminDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/CreatePostDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/CreatePostRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/CreateTenantCooperatorDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/CreateTenantDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/CreateTenantRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/CreateTenantUserOptionsDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/CreateTenantUserReqDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/DefineEventDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/DeleteTenantDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/EventAppDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/EventAppPaginatedRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/EventAppPagingDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/FastpassQRCodeRelationAppDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/FastpassUserInfoDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GeneFastpassQRCodeInfoDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GeneFastpassQRCodeRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GenePushCodeDataDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GenePushCodeRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GenerateInviteTenantUserLink.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GetAppLoginQrcodeStatusDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GetAuthenticationOptionsRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GetFastpassClientAppsDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GetFastpassQRCodeRelationAppsDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GetFastpassQRCodeRelationAppsRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GetMultipleTenantAdminDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GetPostByIdListDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GetPostDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GetPushCodeRelationAppsDataDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GetPushCodeRelationAppsDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GetPushCodeRelationAppsRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GetRegistrationOptionsRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GetTenantCooperatorDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GetTenantCooperatorMenuDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GetTenantDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GetTenantUserDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/GetUserPostDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/ImportTenantDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/ImportTenantHistoryDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/ImportTenantNotifyUserDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/InviteTenantUserRecord.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/InviteTenantUserRecordListDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/InviteTenantUserRecordListRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/InviteTenantUsersDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/InviteTenantUsersRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/ListDeviceCredentialDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/ListEventsDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/ListInviteTenantUserRecordsDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/ListMultipleTenantAdminsDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/ListPostDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/ListTenantAdminDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/ListTenantCooperatorsDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/ListTenantUserDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/ListTenantUsersOptionsDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/ListTenantsDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/MultipleTenantAdminDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/MultipleTenantAdminListPagingDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/MultipleTenantAdminPaginatedRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/OpenEventDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/OpenEventPaginatedRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/OpenEventPagingDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/PostDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/PostInfoDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/PostItemDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/PostPaginatedRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/PostPagingDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/PostRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/PubEventDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/PubEventRespDataDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/PubEventRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialCreationOptionsDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialDescriptorDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialParametersDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialRequestOptionsDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialRpEntityDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialUserEntityDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/RegistrationCredentialDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/RegistrationOptionsDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/RemoveDeviceCredentialDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/RemovePostDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/RemoveTenantDepartmentMembersReqDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/RemoveTenantUsersDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/SendManyTenantEmailDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/SendManyTenantSmsDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/SendTenantEmailDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/SendTenantSmsDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/SignInByBaiduPayloadDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/SignInByDingTalkPayloadDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/SignInByFacebookPayloadDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/SignInByLinkedInPayloadDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/SignInByPushDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/SignInByPushOptionsDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/SignInByQQPayloadDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/SignInByWebAuthnOptionsDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/SignInByWechatMiniProgramCodeAndPhonePayloadDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/SignInByWechatMiniProgramPhoneInfoPayloadDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/SignInByWeiboPayloadDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/SignInFastpassDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/SignInFastpassOptionsDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/TenantCooperatorDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/TenantCooperatorListPagingDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/TenantCooperatorPaginatedRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/TenantCooperatorSingleDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/TenantCooperatorSingleRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/TenantDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/TenantListPaginatedRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/TenantListPagingDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/TenantRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/TenantSingleRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/TenantUserDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/TenantUserListPaginatedRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/TenantUserListPagingDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/TenantUserSingleRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/UpdateMultipleTenantAdminDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/UpdateTenantCooperatorDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/UpdateTenantDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/UpdateTenantUserDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/UserConnectionPostDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/VerifyAuthenticationDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/VerifyAuthenticationResultDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/VerifyAuthenticationResultRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/VerifyRegistrationDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/VerifyRegistrationResultDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/VerifyRegistrationResultRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/WechatIdentityResolveRespDataDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/WechatIdentityResolveRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/WechatLoginTokenRespDto.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/WechatMobileAuthByCodeIdentityInput.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/WechatMobileAuthByCodeInput.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/errorEmailMsg.java create mode 100644 src/main/java/cn/authing/sdk/java/dto/sendInviteTenantUserEmailDto.java diff --git a/src/main/java/cn/authing/sdk/java/client/AuthenticationClient.java b/src/main/java/cn/authing/sdk/java/client/AuthenticationClient.java index 7871f63e..19afbe9a 100644 --- a/src/main/java/cn/authing/sdk/java/client/AuthenticationClient.java +++ b/src/main/java/cn/authing/sdk/java/client/AuthenticationClient.java @@ -37,1966 +37,2379 @@ @SuppressWarnings("all") public class AuthenticationClient extends BaseClient { - private final AuthenticationClientOptions options; - private final String appId; - private JWKSet jwks; - - public AuthenticationClient(AuthenticationClientOptions options) throws IOException, ParseException { - super(options); - // 必要参数校验 - this.options = options; - appId = options.getAppId(); - - if (!(options.getScope().contains("openid"))) { - throw new IllegalArgumentException("scope 中必须包含 openid"); - } + private final AuthenticationClientOptions options; + private final String appId; + private JWKSet jwks; + + public AuthenticationClient(AuthenticationClientOptions options) + throws IOException, ParseException { + super(options); + // 必要参数校验 + this.options = options; + appId = options.getAppId(); + + if (!(options.getScope().contains("openid"))) { + throw new IllegalArgumentException("scope 中必须包含 openid"); } - - public void setAccessToken(String accessToken) { - this.options.setAccessToken(accessToken); + } + + public void setAccessToken(String accessToken) { + this.options.setAccessToken(accessToken); + } + + private JWKSet fetchJwks() throws IOException, ParseException { + if (this.jwks != null) { + return this.jwks; + } else { + JWKSet jwks = JWKSet.load(new URL(this.options.getAppHost() + "/oidc/.well-known/jwks.json")); + this.jwks = jwks; + return jwks; } - - private JWKSet fetchJwks() throws IOException, ParseException { - if (this.jwks != null) { - return this.jwks; - } else { - JWKSet jwks = JWKSet.load(new URL(this.options.getAppHost() + "/oidc/.well-known/jwks.json")); - this.jwks = jwks; - return jwks; - } + } + + private IDToken parseIDToken(String token) throws Exception { + JWSObject jwsObject = JWSObject.parse(token); + String payload; + + if (jwsObject.getHeader().getAlgorithm() == JWSAlgorithm.HS256) { + JWSVerifier jwsVerifier = new MACVerifier(this.options.getAppSecret()); + if (!jwsObject.verify(jwsVerifier)) { + throw new Exception("token 签名不合法"); + } + } else { + RSAKey rsaKey = this.fetchJwks().getKeys().get(0).toRSAKey(); + RSASSAVerifier verifier = new RSASSAVerifier(rsaKey); + if (!jwsObject.verify(verifier)) { + throw new Exception("校验不通过"); + } } - private IDToken parseIDToken(String token) throws Exception { - JWSObject jwsObject = JWSObject.parse(token); - String payload; - - if (jwsObject.getHeader().getAlgorithm() == JWSAlgorithm.HS256) { - JWSVerifier jwsVerifier = new MACVerifier(this.options.getAppSecret()); - if (!jwsObject.verify(jwsVerifier)) { - throw new Exception("token 签名不合法"); - } - } else { - RSAKey rsaKey = this.fetchJwks().getKeys().get(0).toRSAKey(); - RSASSAVerifier verifier = new RSASSAVerifier(rsaKey); - if (!jwsObject.verify(verifier)) { - throw new Exception("校验不通过"); - } - } - - payload = jwsObject.getPayload().toString(); - - return deserialize(payload, IDToken.class); - } + payload = jwsObject.getPayload().toString(); - public AccessToken introspectAccessTokenOffline(String token) throws Exception { - JWSObject jwsObject = JWSObject.parse(token); - String payload; - RSAKey rsaKey = this.fetchJwks().getKeys().get(0).toRSAKey(); - RSASSAVerifier verifier = new RSASSAVerifier(rsaKey); - if (!jwsObject.verify(verifier)) { - throw new Exception("校验不通过"); - } - payload = jwsObject.getPayload().toString(); - return deserialize(payload, AccessToken.class); - } + return deserialize(payload, IDToken.class); + } - public OIDCTokenResponse getAccessTokenByCode(String code) throws Exception { - if ((StrUtil.isBlank(this.options.getAppId()) || StrUtil.isBlank(this.options.getAppSecret())) - && this.options.getTokenEndPointAuthMethod() != AuthMethodEnum.NONE.getValue()) { - throw new Exception("请在初始化 AuthenticationClient 时传入 appId 和 secret 参数"); - } - - String url = ""; - if (this.options.getProtocol() == ProtocolEnum.OAUTH.getValue()) { - url += "/oauth/token"; - } else { - url += "/oidc/token"; - } + public AccessToken introspectAccessTokenOffline(String token) throws Exception { + JWSObject jwsObject = JWSObject.parse(token); + String payload; + RSAKey rsaKey = this.fetchJwks().getKeys().get(0).toRSAKey(); + RSASSAVerifier verifier = new RSASSAVerifier(rsaKey); + if (!jwsObject.verify(verifier)) { + throw new Exception("校验不通过"); + } + payload = jwsObject.getPayload().toString(); + return deserialize(payload, AccessToken.class); + } + + public OIDCTokenResponse getAccessTokenByCode(String code) throws Exception { + if ((StrUtil.isBlank(this.options.getAppId()) || StrUtil.isBlank(this.options.getAppSecret())) + && this.options.getTokenEndPointAuthMethod() != AuthMethodEnum.NONE.getValue()) { + throw new Exception("请在初始化 AuthenticationClient 时传入 appId 和 secret 参数"); + } - CodeToTokenParams tokenParam = new CodeToTokenParams(); - tokenParam.setRedirectUri(this.options.getRedirectUri()); - tokenParam.setCode(code); - tokenParam.setGrantType("authorization_code"); + String url = ""; + if (this.options.getProtocol() == ProtocolEnum.OAUTH.getValue()) { + url += "/oauth/token"; + } else { + url += "/oidc/token"; + } - AuthingRequestConfig config = new AuthingRequestConfig(); + CodeToTokenParams tokenParam = new CodeToTokenParams(); + tokenParam.setRedirectUri(this.options.getRedirectUri()); + tokenParam.setCode(code); + tokenParam.setGrantType("authorization_code"); - config.setUrl(url); - config.setMethod("UrlencodedPOST"); + AuthingRequestConfig config = new AuthingRequestConfig(); - HashMap headerMap = new HashMap<>(); - headerMap.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); + config.setUrl(url); + config.setMethod("UrlencodedPOST"); + + HashMap headerMap = new HashMap<>(); + headerMap.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); + + if (this.options.getTokenEndPointAuthMethod() == AuthMethodEnum.CLIENT_SECRET_POST.getValue()) { + tokenParam.setClientId(this.options.getAppId()); + tokenParam.setClientSecret(this.options.getAppSecret()); + } else if (this.options.getTokenEndPointAuthMethod() + == AuthMethodEnum.CLIENT_SECRET_BASIC.getValue()) { + String basic64Str = "Basic " + Base64.getEncoder() + .encodeToString((this.options.getAppId() + ":" + this.options.getAppSecret()).getBytes()); + headerMap.put("Authorization", basic64Str); + } else { + // AuthMethodEnum.NONE + tokenParam.setClientId(this.options.getAppId()); + } - if (this.options.getTokenEndPointAuthMethod() == AuthMethodEnum.CLIENT_SECRET_POST.getValue()) { - tokenParam.setClientId(this.options.getAppId()); - tokenParam.setClientSecret(this.options.getAppSecret()); - } else if (this.options.getTokenEndPointAuthMethod() == AuthMethodEnum.CLIENT_SECRET_BASIC.getValue()) { - String basic64Str = "Basic " + Base64.getEncoder().encodeToString((this.options.getAppId() + ":" + this.options.getAppSecret()).getBytes()); - headerMap.put("Authorization", basic64Str); - } else { - // AuthMethodEnum.NONE - tokenParam.setClientId(this.options.getAppId()); - } + config.setHeaders(headerMap); + config.setBody(tokenParam); - config.setHeaders(headerMap); - config.setBody(tokenParam); + String response = request(config); - String response = request(config); + OIDCTokenResponse deserializeOIDCResponse = deserialize(response, OIDCTokenResponse.class); - OIDCTokenResponse deserializeOIDCResponse = deserialize(response, OIDCTokenResponse.class); + return deserializeOIDCResponse; + } - return deserializeOIDCResponse; - } + /** + * 检验 CAS 1.0 Ticket 合法性 + */ + public ValidateTicketV1Response validateTicketV1(String ticket, String service) { + String url = this.options.getAppHost() + "/cas-idp/" + this.options.getAppId() + "/validate"; - /** - * 检验 CAS 1.0 Ticket 合法性 - */ - public ValidateTicketV1Response validateTicketV1(String ticket, String service) { - String url = this.options.getAppHost() + "/cas-idp/" + this.options.getAppId() + "/validate"; + Map paramsMap = new HashMap<>(); + paramsMap.put("ticket", ticket); + paramsMap.put("service", service); - Map paramsMap = new HashMap<>(); - paramsMap.put("ticket", ticket); - paramsMap.put("service", service); + url = HttpUtils.buildUrlWithQueryParams(url, paramsMap); - url = HttpUtils.buildUrlWithQueryParams(url, paramsMap); + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl(url); - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl(url); + String response = request(config); - String response = request(config); + ValidateTicketV1Response validateTicketV1Response = deserialize(response, + ValidateTicketV1Response.class); - ValidateTicketV1Response validateTicketV1Response = deserialize(response, ValidateTicketV1Response.class); + System.out.println("ValidateTicketV1Response:" + validateTicketV1Response.toString()); - System.out.println("ValidateTicketV1Response:" + validateTicketV1Response.toString()); + return validateTicketV1Response; - return validateTicketV1Response; + } + /** + * 通过远端服务验证票据合法性 + */ + public String validateTicketV2(String ticket, String service, String format) throws Exception { + if (format != "XML" && format != "JSON") { + throw new Exception("format 参数可选值为 XML、JSON,请检查输入"); } + String url = + this.options.getAppHost() + "/cas-idp/" + this.options.getAppId() + "/serviceValidate"; - /** - * 通过远端服务验证票据合法性 - */ - public String validateTicketV2(String ticket, String service, String format) throws Exception { - if (format != "XML" && format != "JSON") { - throw new Exception("format 参数可选值为 XML、JSON,请检查输入"); - } - String url = this.options.getAppHost() + "/cas-idp/" + this.options.getAppId() + "/serviceValidate"; + Map paramsMap = new HashMap<>(); + paramsMap.put("ticket", ticket); + paramsMap.put("service", service); + paramsMap.put("format", format); - Map paramsMap = new HashMap<>(); - paramsMap.put("ticket", ticket); - paramsMap.put("service", service); - paramsMap.put("format", format); + url = HttpUtils.buildUrlWithQueryParams(url, paramsMap); - url = HttpUtils.buildUrlWithQueryParams(url, paramsMap); + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl(url); - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl(url); + String response = request(config); - String response = request(config); + return response; + } - return response; - } + /** + * 生成 PKCE 校验码摘要值 + */ + public String getCodeChallengeDigest(CodeChallengeDigestParam options) throws Exception { + String codeChallenge = options.getCodeChallenge(); + String method = options.getMethod(); - /** - * 生成 PKCE 校验码摘要值 - */ - public String getCodeChallengeDigest(CodeChallengeDigestParam options) throws Exception { - String codeChallenge = options.getCodeChallenge(); - String method = options.getMethod(); - - if (StrUtil.isBlank(codeChallenge)) { - throw new Exception("请提供 options.codeChallenge,值为一个长度大于等于 43 的字符串"); - } - - if (method == "S256" || method == "") { - MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); - messageDigest.update(codeChallenge.getBytes("UTF-8")); - byte[] encode = Base64.getEncoder().encode(messageDigest.digest()); - return new String(encode, Charset.forName("UTF-8")).replace("+", "-") - .replace("/", "_").replace("=", ""); - } else if (method == "plain") { - return codeChallenge; - } else { - throw new Exception("不支持的 options.method,可选值为 S256、plain"); - } + if (StrUtil.isBlank(codeChallenge)) { + throw new Exception("请提供 options.codeChallenge,值为一个长度大于等于 43 的字符串"); } - /** - * 之前版本 buildLogoutUrl 的补充,由于 buildLogoutUrl 函数名已经被占用,故命名为 buildLogoutUrlNew - * - * @param params - * @return - * @throws Exception - */ - public String buildLogoutUrl(BuildLogoutUrlParams params) throws Exception { - if (this.options.getProtocol() == ProtocolEnum.OAUTH.getValue()) - return this.buildCasLogoutUrl(params); - - if (this.options.getProtocol() == ProtocolEnum.OIDC.getValue()) - return this.buildOidcLogoutUrl(params); - - return buildEasyLogoutUrl(params); + if (method == "S256" || method == "") { + MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); + messageDigest.update(codeChallenge.getBytes("UTF-8")); + byte[] encode = Base64.getEncoder().encode(messageDigest.digest()); + return new String(encode, Charset.forName("UTF-8")).replace("+", "-") + .replace("/", "_").replace("=", ""); + } else if (method == "plain") { + return codeChallenge; + } else { + throw new Exception("不支持的 options.method,可选值为 S256、plain"); } - - private String buildCasLogoutUrl(BuildLogoutUrlParams params) { - String url = ""; - if (StrUtil.isNotBlank(params.getPostLogoutRedirectUri())) { - url = this.options.getAppHost() + "/cas-idp/logout?url=" + params.getPostLogoutRedirectUri(); - } else { - url = this.options.getAppHost() + "/cas-idp/logout"; - } - return url; + } + + /** + * 之前版本 buildLogoutUrl 的补充,由于 buildLogoutUrl 函数名已经被占用,故命名为 buildLogoutUrlNew + * + * @param params + * @return + * @throws Exception + */ + public String buildLogoutUrl(BuildLogoutUrlParams params) throws Exception { + if (this.options.getProtocol() == ProtocolEnum.OAUTH.getValue()) { + return this.buildCasLogoutUrl(params); + } + + if (this.options.getProtocol() == ProtocolEnum.OIDC.getValue()) { + return this.buildOidcLogoutUrl(params); + } + + return buildEasyLogoutUrl(params); + } + + private String buildCasLogoutUrl(BuildLogoutUrlParams params) { + String url = ""; + if (StrUtil.isNotBlank(params.getPostLogoutRedirectUri())) { + url = this.options.getAppHost() + "/cas-idp/logout?url=" + params.getPostLogoutRedirectUri(); + } else { + url = this.options.getAppHost() + "/cas-idp/logout"; } + return url; + } - private String buildOidcLogoutUrl(BuildLogoutUrlParams params) throws Exception { - if ((params.getPostLogoutRedirectUri() != null && params.getIdTokenHint() == null) || - (params.getPostLogoutRedirectUri() == null && params.getIdTokenHint() != null)) { - throw new Exception("必须同时传入 idToken 和 redirectUri 参数,或者同时都不传入"); - } - String url = ""; - if (StrUtil.isNotBlank(params.getPostLogoutRedirectUri())) { - url = this.options.getAppHost() + "/oidc/session/end?id_token_hint=" + params.getIdTokenHint() - + "&post_logout_redirect_uri=" + params.getPostLogoutRedirectUri(); - } else { - url = this.options.getAppHost() + "/oidc/session/end"; - } - return url; + private String buildOidcLogoutUrl(BuildLogoutUrlParams params) throws Exception { + if ((params.getPostLogoutRedirectUri() != null && params.getIdTokenHint() == null) || + (params.getPostLogoutRedirectUri() == null && params.getIdTokenHint() != null)) { + throw new Exception("必须同时传入 idToken 和 redirectUri 参数,或者同时都不传入"); } - - private String buildEasyLogoutUrl(BuildLogoutUrlParams params) throws Exception { - String url = ""; - if (StrUtil.isNotBlank(params.getPostLogoutRedirectUri())) { - url = this.options.getAppHost() + "/login/profile/logout?redirect_uri=" + params.getPostLogoutRedirectUri(); - } else { - url = this.options.getAppHost() + "/login/profile/logout"; - } - return url; + String url = ""; + if (StrUtil.isNotBlank(params.getPostLogoutRedirectUri())) { + url = this.options.getAppHost() + "/oidc/session/end?id_token_hint=" + params.getIdTokenHint() + + "&post_logout_redirect_uri=" + params.getPostLogoutRedirectUri(); + } else { + url = this.options.getAppHost() + "/oidc/session/end"; + } + return url; + } + + private String buildEasyLogoutUrl(BuildLogoutUrlParams params) throws Exception { + String url = ""; + if (StrUtil.isNotBlank(params.getPostLogoutRedirectUri())) { + url = this.options.getAppHost() + "/login/profile/logout?redirect_uri=" + + params.getPostLogoutRedirectUri(); + } else { + url = this.options.getAppHost() + "/login/profile/logout"; + } + return url; + } + + /** + * Client Credentials 模式获取 Access Token + */ + public GetAccessTokenByClientCredentialsRespDto getAccessTokenByClientCredentials(String scope, + ClientCredentialInput options) throws Exception { + if (StrUtil.isEmpty(scope)) { + throw new InvalidParameterException( + "请传入 scope 参数,请看文档:https://docs.authing.cn/v2/guides/authorization/m2m-authz.html"); } - /** - * Client Credentials 模式获取 Access Token - */ - public GetAccessTokenByClientCredentialsRespDto getAccessTokenByClientCredentials(String scope, ClientCredentialInput options) throws Exception { - if (StrUtil.isEmpty(scope)) { - throw new InvalidParameterException("请传入 scope 参数,请看文档:https://docs.authing.cn/v2/guides/authorization/m2m-authz.html"); - } - - if (options == null) { - throw new InvalidParameterException("请在调用本方法时传入 { accessKey: string, accessSecret: string },请看文档:https://docs.authing.cn/v2/guides/authorization/m2m-authz.html"); - } - - GetAccessTokenByClientCredentialsDto reqDto = new GetAccessTokenByClientCredentialsDto(); - reqDto.setScope(scope); - reqDto.setClientId(options.getAccessKey()); - reqDto.setClientSecret(options.getAccessSecret()); - reqDto.setGrantType(TokenEndPointParams.Grant_type.CLIENT_CREDENTIALS.getValue()); - - Map headers = new HashMap<>(); - headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); - - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/oidc/token"); - config.setBody(reqDto); - config.setMethod("UrlencodedPOST"); - config.setHeaders(headers); - - String response = request(config); - return deserialize(response, GetAccessTokenByClientCredentialsRespDto.class); + if (options == null) { + throw new InvalidParameterException( + "请在调用本方法时传入 { accessKey: string, accessSecret: string },请看文档:https://docs.authing.cn/v2/guides/authorization/m2m-authz.html"); } - /** - * accessToken 换取用户信息 - */ - public UserInfo getUserInfoByAccessToken(String accessToken) { - AuthingRequestConfig config = new AuthingRequestConfig(); + GetAccessTokenByClientCredentialsDto reqDto = new GetAccessTokenByClientCredentialsDto(); + reqDto.setScope(scope); + reqDto.setClientId(options.getAccessKey()); + reqDto.setClientSecret(options.getAccessSecret()); + reqDto.setGrantType(TokenEndPointParams.Grant_type.CLIENT_CREDENTIALS.getValue()); + + Map headers = new HashMap<>(); + headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); + + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/oidc/token"); + config.setBody(reqDto); + config.setMethod("UrlencodedPOST"); + config.setHeaders(headers); - if (ProtocolEnum.OAUTH.getValue().equals(options.getProtocol())) { - config.setMethod("POST"); - config.setBody(new Object()); - } else { - config.setMethod("GET"); - } + String response = request(config); + return deserialize(response, GetAccessTokenByClientCredentialsRespDto.class); + } - config.setUrl("/oidc/me/?access_token=" + accessToken); + /** + * accessToken 换取用户信息 + */ + public UserInfo getUserInfoByAccessToken(String accessToken) { + AuthingRequestConfig config = new AuthingRequestConfig(); - String response = request(config); - return deserialize(response, UserInfo.class); + if (ProtocolEnum.OAUTH.getValue().equals(options.getProtocol())) { + config.setMethod("POST"); + config.setBody(new Object()); + } else { + config.setMethod("GET"); } - /** - * accessToken 换取用户信息,用户可以自取自定义的扩展字段 - */ - public Map getUserInfoMapByAccessToken(String accessToken) { - AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/oidc/me/?access_token=" + accessToken); - if (ProtocolEnum.OAUTH.getValue().equals(options.getProtocol())) { - config.setMethod("POST"); - config.setBody(new Object()); - } else { - config.setMethod("GET"); - } + String response = request(config); + return deserialize(response, UserInfo.class); + } - config.setUrl("/oidc/me/?access_token=" + accessToken); + /** + * accessToken 换取用户信息,用户可以自取自定义的扩展字段 + */ + public Map getUserInfoMapByAccessToken(String accessToken) { + AuthingRequestConfig config = new AuthingRequestConfig(); - String response = request(config); - return deserialize(response, Map.class); + if (ProtocolEnum.OAUTH.getValue().equals(options.getProtocol())) { + config.setMethod("POST"); + config.setBody(new Object()); + } else { + config.setMethod("GET"); } - /** - * 拼接 OIDC、OAuth 2.0、SAML、CAS 协议授权链接 - */ - public String buildAuthorizeUrl(IOidcParams params) { - if (options.getAppId() == null) { - throw new InvalidParameterException("请在初始化 AuthenticationClient 时传入 appId"); - } - - if (!ProtocolEnum.OIDC.getValue().equals(options.getProtocol())) { - throw new InvalidParameterException("初始化 AuthenticationClient 传入的 protocol 应为 ProtocolEnum.OIDC 不应该为"+options.getProtocol()); - } - - if (StrUtil.isEmpty(options.getRedirectUri()) && StrUtil.isEmpty(params.getRedirectUri())) { - throw new InvalidParameterException("redirectUri 不应该为空 解决方法:请在 AuthenticationClient 初始化时传入 redirectUri,或者调用 buildAuthorizeUrl 时传入 redirectUri"); - } - - Map map = new HashMap<>(); - map.put("client_id", options.getAppId()); - map.put("scope", Optional.ofNullable(params.getScope()).orElse("openid profile email phone address")); - map.put("state", Optional.ofNullable(params.getState()).orElse(CommonUtils.createRandomString(12))); - map.put("nonce", Optional.ofNullable(params.getNonce()).orElse(CommonUtils.createRandomString(12))); - map.put("response_mode", Optional.ofNullable(params.getResponseMode()).orElse(null)); - map.put("response_type", Optional.ofNullable(params.getResponseType()).orElse("code")); - map.put("redirect_uri", Optional.ofNullable(params.getRedirectUri()).orElse(options.getRedirectUri())); - map.put("prompt", params.getScope() != null && params.getScope().contains("offline_access") ? "consent" : null); - - return HttpUtils.buildUrlWithQueryParams(options.getAppHost() + "/oidc/auth", map); + config.setUrl("/oidc/me/?access_token=" + accessToken); + + String response = request(config); + return deserialize(response, Map.class); + } + + /** + * 拼接 OIDC、OAuth 2.0、SAML、CAS 协议授权链接 + */ + public String buildAuthorizeUrl(IOidcParams params) { + if (options.getAppId() == null) { + throw new InvalidParameterException("请在初始化 AuthenticationClient 时传入 appId"); } - /** - * 拼接 CAS 协议授权链接 - */ - public String buildAuthorizeUrl(ICasParams params) { - if (options.getAppId() == null) { - throw new InvalidParameterException("请在初始化 AuthenticationClient 时传入 appId"); - } - - if (!ProtocolEnum.CAS.getValue().equals(options.getProtocol())) { - throw new InvalidParameterException("初始化 AuthenticationClient 传入的 protocol 应为 ProtocolEnum.CAS 不应该为"+options.getProtocol()); - } - - if(StrUtil.isNotBlank(params.getService())){ - return options.getAppHost() + "/cas-idp/" + options.getAppId() + "?service=" + params.getService(); - }else { - return options.getAppHost() + "/cas-idp/" + options.getAppId(); - } + if (!ProtocolEnum.OIDC.getValue().equals(options.getProtocol())) { + throw new InvalidParameterException( + "初始化 AuthenticationClient 传入的 protocol 应为 ProtocolEnum.OIDC 不应该为" + + options.getProtocol()); } - /** - * 拼接 SAML 协议授权链接 - */ - public String buildAuthorizeUrl() { - if (options.getAppId() == null) { - throw new InvalidParameterException("请在初始化 AuthenticationClient 时传入 appId"); - } + if (StrUtil.isEmpty(options.getRedirectUri()) && StrUtil.isEmpty(params.getRedirectUri())) { + throw new InvalidParameterException( + "redirectUri 不应该为空 解决方法:请在 AuthenticationClient 初始化时传入 redirectUri,或者调用 buildAuthorizeUrl 时传入 redirectUri"); + } - if (!ProtocolEnum.SAML.getValue().equals(options.getProtocol())) { - throw new InvalidParameterException("初始化 AuthenticationClient 传入的 protocol 应为 ProtocolEnum.SAML 不应该为"+options.getProtocol()); - } + Map map = new HashMap<>(); + map.put("client_id", options.getAppId()); + map.put("scope", + Optional.ofNullable(params.getScope()).orElse("openid profile email phone address")); + map.put("state", + Optional.ofNullable(params.getState()).orElse(CommonUtils.createRandomString(12))); + map.put("nonce", + Optional.ofNullable(params.getNonce()).orElse(CommonUtils.createRandomString(12))); + map.put("response_mode", Optional.ofNullable(params.getResponseMode()).orElse(null)); + map.put("response_type", Optional.ofNullable(params.getResponseType()).orElse("code")); + map.put("redirect_uri", + Optional.ofNullable(params.getRedirectUri()).orElse(options.getRedirectUri())); + map.put("prompt", + params.getScope() != null && params.getScope().contains("offline_access") ? "consent" + : null); + + return HttpUtils.buildUrlWithQueryParams(options.getAppHost() + "/oidc/auth", map); + } + + /** + * 拼接 CAS 协议授权链接 + */ + public String buildAuthorizeUrl(ICasParams params) { + if (options.getAppId() == null) { + throw new InvalidParameterException("请在初始化 AuthenticationClient 时传入 appId"); + } - return options.getAppHost() + "/api/v2/saml-idp/" + options.getAppId(); + if (!ProtocolEnum.CAS.getValue().equals(options.getProtocol())) { + throw new InvalidParameterException( + "初始化 AuthenticationClient 传入的 protocol 应为 ProtocolEnum.CAS 不应该为" + + options.getProtocol()); } - /** - * 拼接 OAUTH 2.0 协议授权链接 - */ - public String buildAuthorizeUrl(IOauthParams params) { - if (options.getAppId() == null) { - throw new InvalidParameterException("请在初始化 AuthenticationClient 时传入 appId"); - } - - if (!ProtocolEnum.OAUTH.getValue().equals(options.getProtocol())) { - throw new InvalidParameterException("初始化 AuthenticationClient 传入的 protocol 应为 ProtocolEnum.OAUTH 不应该为"+options.getProtocol()); - } - - if (StrUtil.isEmpty(options.getRedirectUri()) && StrUtil.isEmpty(params.getRedirectUri())) { - throw new InvalidParameterException("redirectUri 不应该为空 解决方法:请在 AuthenticationClient 初始化时传入 redirectUri,或者调用 buildAuthorizeUrl 时传入 redirectUri"); - } - - Map map = new HashMap<>(); - map.put("client_id", options.getAppId()); - map.put("scope", Optional.ofNullable(params.getScope()).orElse("user")); - map.put("state", Optional.ofNullable(params.getState()).orElse(CommonUtils.createRandomString(12))); - map.put("response_type", Optional.ofNullable(params.getResponseType()).orElse("code")); - map.put("redirect_uri", Optional.ofNullable(params.getRedirectUri()).orElse(options.getRedirectUri())); - map.put("prompt", params.getScope() != null && params.getScope().contains("offline_access") ? "consent" : null); - - return HttpUtils.buildUrlWithQueryParams(options.getAppHost() + "/oidc/auth", map); + if (StrUtil.isNotBlank(params.getService())) { + return options.getAppHost() + "/cas-idp/" + options.getAppId() + "?service=" + + params.getService(); + } else { + return options.getAppHost() + "/cas-idp/" + options.getAppId(); + } + } + + /** + * 拼接 SAML 协议授权链接 + */ + public String buildAuthorizeUrl() { + if (options.getAppId() == null) { + throw new InvalidParameterException("请在初始化 AuthenticationClient 时传入 appId"); } - /** - * 使用 Refresh token 获取新的 Access token - */ - public GetNewAccessTokenByRefreshTokenRespDto getNewAccessTokenByRefreshToken(String refreshToken) { - verificationProtocol(); - - String tokenEndPointAuthMethod = options.getTokenEndPointAuthMethod(); - if (AuthMethodEnum.CLIENT_SECRET_POST.getValue().equals(tokenEndPointAuthMethod)) { - return getNewAccessTokenByRefreshTokenWithClientSecretPost(refreshToken); - } else if (AuthMethodEnum.CLIENT_SECRET_BASIC.getValue().equals(tokenEndPointAuthMethod)) { - return getNewAccessTokenByRefreshTokenWithClientSecretBasic(refreshToken); - } else { - return getNewAccessTokenByRefreshTokenWithNone(refreshToken); - } + if (!ProtocolEnum.SAML.getValue().equals(options.getProtocol())) { + throw new InvalidParameterException( + "初始化 AuthenticationClient 传入的 protocol 应为 ProtocolEnum.SAML 不应该为" + + options.getProtocol()); } - private void verificationProtocol() { - if (!(ProtocolEnum.OAUTH.getValue().equals(options.getProtocol()) || ProtocolEnum.OIDC.getValue().equals(options.getProtocol()))) { - throw new InvalidParameterException("初始化 AuthenticationClient 时传入的 protocol 参数必须为 ProtocolEnum.OAUTH 或 ProtocolEnum.OIDC,请检查参数"); - } - if (StrUtil.isEmpty(options.getAppSecret()) && !AuthMethodEnum.NONE.getValue().equals(options.getTokenEndPointAuthMethod())) { - throw new InvalidParameterException("请在初始化 AuthenticationClient 时传入 appId 和 secret 参数"); - } + return options.getAppHost() + "/api/v2/saml-idp/" + options.getAppId(); + } + + /** + * 拼接 OAUTH 2.0 协议授权链接 + */ + public String buildAuthorizeUrl(IOauthParams params) { + if (options.getAppId() == null) { + throw new InvalidParameterException("请在初始化 AuthenticationClient 时传入 appId"); } - private GetNewAccessTokenByRefreshTokenRespDto getNewAccessTokenByRefreshTokenWithClientSecretPost(String refreshToken) { - AuthingRequestConfig config = new AuthingRequestConfig(); + if (!ProtocolEnum.OAUTH.getValue().equals(options.getProtocol())) { + throw new InvalidParameterException( + "初始化 AuthenticationClient 传入的 protocol 应为 ProtocolEnum.OAUTH 不应该为" + + options.getProtocol()); + } - if (ProtocolEnum.OIDC.getValue().equals(options.getProtocol())) { - config.setUrl("/oidc/token"); - } else { - config.setUrl("/oauth/token"); - } + if (StrUtil.isEmpty(options.getRedirectUri()) && StrUtil.isEmpty(params.getRedirectUri())) { + throw new InvalidParameterException( + "redirectUri 不应该为空 解决方法:请在 AuthenticationClient 初始化时传入 redirectUri,或者调用 buildAuthorizeUrl 时传入 redirectUri"); + } - config.setMethod("UrlencodedPOST"); + Map map = new HashMap<>(); + map.put("client_id", options.getAppId()); + map.put("scope", Optional.ofNullable(params.getScope()).orElse("user")); + map.put("state", + Optional.ofNullable(params.getState()).orElse(CommonUtils.createRandomString(12))); + map.put("response_type", Optional.ofNullable(params.getResponseType()).orElse("code")); + map.put("redirect_uri", + Optional.ofNullable(params.getRedirectUri()).orElse(options.getRedirectUri())); + map.put("prompt", + params.getScope() != null && params.getScope().contains("offline_access") ? "consent" + : null); + + return HttpUtils.buildUrlWithQueryParams(options.getAppHost() + "/oidc/auth", map); + } + + /** + * 使用 Refresh token 获取新的 Access token + */ + public GetNewAccessTokenByRefreshTokenRespDto getNewAccessTokenByRefreshToken( + String refreshToken) { + verificationProtocol(); + + String tokenEndPointAuthMethod = options.getTokenEndPointAuthMethod(); + if (AuthMethodEnum.CLIENT_SECRET_POST.getValue().equals(tokenEndPointAuthMethod)) { + return getNewAccessTokenByRefreshTokenWithClientSecretPost(refreshToken); + } else if (AuthMethodEnum.CLIENT_SECRET_BASIC.getValue().equals(tokenEndPointAuthMethod)) { + return getNewAccessTokenByRefreshTokenWithClientSecretBasic(refreshToken); + } else { + return getNewAccessTokenByRefreshTokenWithNone(refreshToken); + } + } - Map headers = new HashMap<>(); - headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); - config.setHeaders(headers); + private void verificationProtocol() { + if (!(ProtocolEnum.OAUTH.getValue().equals(options.getProtocol()) + || ProtocolEnum.OIDC.getValue().equals(options.getProtocol()))) { + throw new InvalidParameterException( + "初始化 AuthenticationClient 时传入的 protocol 参数必须为 ProtocolEnum.OAUTH 或 ProtocolEnum.OIDC,请检查参数"); + } + if (StrUtil.isEmpty(options.getAppSecret()) && !AuthMethodEnum.NONE.getValue() + .equals(options.getTokenEndPointAuthMethod())) { + throw new InvalidParameterException( + "请在初始化 AuthenticationClient 时传入 appId 和 secret 参数"); + } + } - GetNewAccessTokenByRefreshTokenDto reqDto = new GetNewAccessTokenByRefreshTokenDto(); - reqDto.setClientId(options.getAppId()); - reqDto.setClientSecret(options.getAppSecret()); - reqDto.setGrantType(TokenEndPointParams.Grant_type.REFRESH_TOKEN.getValue()); - reqDto.setRefreshToken(refreshToken); - config.setBody(reqDto); + private GetNewAccessTokenByRefreshTokenRespDto getNewAccessTokenByRefreshTokenWithClientSecretPost( + String refreshToken) { + AuthingRequestConfig config = new AuthingRequestConfig(); - String response = request(config); - return deserialize(response, GetNewAccessTokenByRefreshTokenRespDto.class); + if (ProtocolEnum.OIDC.getValue().equals(options.getProtocol())) { + config.setUrl("/oidc/token"); + } else { + config.setUrl("/oauth/token"); } - private GetNewAccessTokenByRefreshTokenRespDto getNewAccessTokenByRefreshTokenWithClientSecretBasic(String refreshToken) { - String basic64Str = "Basic " + Base64Encoder.encode((options.getAppId() + ":" + options.getAppSecret()).getBytes()); + config.setMethod("UrlencodedPOST"); - AuthingRequestConfig config = new AuthingRequestConfig(); + Map headers = new HashMap<>(); + headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); + config.setHeaders(headers); - if (ProtocolEnum.OIDC.getValue().equals(options.getProtocol())) { - config.setUrl("/oidc/token"); - } else { - config.setUrl("/oauth/token"); - } + GetNewAccessTokenByRefreshTokenDto reqDto = new GetNewAccessTokenByRefreshTokenDto(); + reqDto.setClientId(options.getAppId()); + reqDto.setClientSecret(options.getAppSecret()); + reqDto.setGrantType(TokenEndPointParams.Grant_type.REFRESH_TOKEN.getValue()); + reqDto.setRefreshToken(refreshToken); + config.setBody(reqDto); - config.setMethod("UrlencodedPOST"); + String response = request(config); + return deserialize(response, GetNewAccessTokenByRefreshTokenRespDto.class); + } - Map headers = new HashMap<>(); - headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); - headers.put(Header.AUTHORIZATION.getValue(), basic64Str); - config.setHeaders(headers); + private GetNewAccessTokenByRefreshTokenRespDto getNewAccessTokenByRefreshTokenWithClientSecretBasic( + String refreshToken) { + String basic64Str = "Basic " + Base64Encoder.encode( + (options.getAppId() + ":" + options.getAppSecret()).getBytes()); - GetNewAccessTokenByRefreshTokenDto reqDto = new GetNewAccessTokenByRefreshTokenDto(); - reqDto.setGrantType(TokenEndPointParams.Grant_type.REFRESH_TOKEN.getValue()); - reqDto.setRefreshToken(refreshToken); - config.setBody(reqDto); + AuthingRequestConfig config = new AuthingRequestConfig(); - String resqonse = request(config); - return deserialize(resqonse, GetNewAccessTokenByRefreshTokenRespDto.class); + if (ProtocolEnum.OIDC.getValue().equals(options.getProtocol())) { + config.setUrl("/oidc/token"); + } else { + config.setUrl("/oauth/token"); } - private GetNewAccessTokenByRefreshTokenRespDto getNewAccessTokenByRefreshTokenWithNone(String refreshToken) { - AuthingRequestConfig config = new AuthingRequestConfig(); + config.setMethod("UrlencodedPOST"); - if (ProtocolEnum.OIDC.getValue().equals(options.getProtocol())) { - config.setUrl("/oidc/token"); - } else { - config.setUrl("/oauth/token"); - } + Map headers = new HashMap<>(); + headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); + headers.put(Header.AUTHORIZATION.getValue(), basic64Str); + config.setHeaders(headers); - config.setMethod("UrlencodedPOST"); - - Map headers = new HashMap<>(); - headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); - config.setHeaders(headers); + GetNewAccessTokenByRefreshTokenDto reqDto = new GetNewAccessTokenByRefreshTokenDto(); + reqDto.setGrantType(TokenEndPointParams.Grant_type.REFRESH_TOKEN.getValue()); + reqDto.setRefreshToken(refreshToken); + config.setBody(reqDto); - GetNewAccessTokenByRefreshTokenDto reqDto = new GetNewAccessTokenByRefreshTokenDto(); - reqDto.setClientId(options.getAppId()); - reqDto.setGrantType(TokenEndPointParams.Grant_type.REFRESH_TOKEN.getValue()); - reqDto.setRefreshToken(refreshToken); - config.setBody(reqDto); + String resqonse = request(config); + return deserialize(resqonse, GetNewAccessTokenByRefreshTokenRespDto.class); + } - String response = request(config); - return deserialize(response, GetNewAccessTokenByRefreshTokenRespDto.class); - } + private GetNewAccessTokenByRefreshTokenRespDto getNewAccessTokenByRefreshTokenWithNone( + String refreshToken) { + AuthingRequestConfig config = new AuthingRequestConfig(); - /** - * 检查 Access token 或 Refresh token 的状态 - */ - public IntrospectTokenRespDto introspectToken(String token) { - verificationProtocol(); - - String introspectionEndPointAuthMethod = options.getIntrospectionEndPointAuthMethod(); - if (AuthMethodEnum.CLIENT_SECRET_POST.getValue().equals(introspectionEndPointAuthMethod)) { - return introspectTokenWithClientSecretPost(token); - } else if (AuthMethodEnum.CLIENT_SECRET_BASIC.getValue().equals(introspectionEndPointAuthMethod)) { - return introspectTokenWithClientSecretBasic(token); - } else { - return introspectTokenWithNone(token); - } + if (ProtocolEnum.OIDC.getValue().equals(options.getProtocol())) { + config.setUrl("/oidc/token"); + } else { + config.setUrl("/oauth/token"); } - private IntrospectTokenRespDto introspectTokenWithClientSecretPost(String token) { - AuthingRequestConfig config = new AuthingRequestConfig(); + config.setMethod("UrlencodedPOST"); - if (ProtocolEnum.OIDC.getValue().equals(options.getProtocol())) { - config.setUrl("/oidc/token/introspection"); - } else { - config.setUrl("/oauth/token/introspection"); - } + Map headers = new HashMap<>(); + headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); + config.setHeaders(headers); - config.setMethod("UrlencodedPOST"); + GetNewAccessTokenByRefreshTokenDto reqDto = new GetNewAccessTokenByRefreshTokenDto(); + reqDto.setClientId(options.getAppId()); + reqDto.setGrantType(TokenEndPointParams.Grant_type.REFRESH_TOKEN.getValue()); + reqDto.setRefreshToken(refreshToken); + config.setBody(reqDto); - Map headers = new HashMap<>(); - headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); - config.setHeaders(headers); + String response = request(config); + return deserialize(response, GetNewAccessTokenByRefreshTokenRespDto.class); + } + + /** + * 检查 Access token 或 Refresh token 的状态 + */ + public IntrospectTokenRespDto introspectToken(String token) { + verificationProtocol(); + + String introspectionEndPointAuthMethod = options.getIntrospectionEndPointAuthMethod(); + if (AuthMethodEnum.CLIENT_SECRET_POST.getValue().equals(introspectionEndPointAuthMethod)) { + return introspectTokenWithClientSecretPost(token); + } else if (AuthMethodEnum.CLIENT_SECRET_BASIC.getValue() + .equals(introspectionEndPointAuthMethod)) { + return introspectTokenWithClientSecretBasic(token); + } else { + return introspectTokenWithNone(token); + } + } - IntrospectTokenDto reqDto = new IntrospectTokenDto(); - reqDto.setClientId(options.getAppId()); - reqDto.setClientSecret(options.getAppSecret()); - reqDto.setToken(token); - config.setBody(reqDto); + private IntrospectTokenRespDto introspectTokenWithClientSecretPost(String token) { + AuthingRequestConfig config = new AuthingRequestConfig(); - String response = request(config); - return deserialize(response, IntrospectTokenRespDto.class); + if (ProtocolEnum.OIDC.getValue().equals(options.getProtocol())) { + config.setUrl("/oidc/token/introspection"); + } else { + config.setUrl("/oauth/token/introspection"); } - private IntrospectTokenRespDto introspectTokenWithClientSecretBasic(String token) { - String basic64Str = "Basic " + Base64Encoder.encode((options.getAppId() + ":" + options.getAppSecret()).getBytes()); + config.setMethod("UrlencodedPOST"); - AuthingRequestConfig config = new AuthingRequestConfig(); + Map headers = new HashMap<>(); + headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); + config.setHeaders(headers); - if (ProtocolEnum.OIDC.getValue().equals(options.getProtocol())) { - config.setUrl("/oidc/token/introspection"); - } else { - config.setUrl("/oauth/token/introspection"); - } + IntrospectTokenDto reqDto = new IntrospectTokenDto(); + reqDto.setClientId(options.getAppId()); + reqDto.setClientSecret(options.getAppSecret()); + reqDto.setToken(token); + config.setBody(reqDto); - config.setMethod("UrlencodedPOST"); + String response = request(config); + return deserialize(response, IntrospectTokenRespDto.class); + } - Map headers = new HashMap<>(); - headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); - headers.put(Header.AUTHORIZATION.getValue(), basic64Str); - config.setHeaders(headers); + private IntrospectTokenRespDto introspectTokenWithClientSecretBasic(String token) { + String basic64Str = "Basic " + Base64Encoder.encode( + (options.getAppId() + ":" + options.getAppSecret()).getBytes()); - IntrospectTokenDto reqDto = new IntrospectTokenDto(); - reqDto.setToken(token); - config.setBody(reqDto); + AuthingRequestConfig config = new AuthingRequestConfig(); - String response = request(config); - return deserialize(response, IntrospectTokenRespDto.class); + if (ProtocolEnum.OIDC.getValue().equals(options.getProtocol())) { + config.setUrl("/oidc/token/introspection"); + } else { + config.setUrl("/oauth/token/introspection"); } - private IntrospectTokenRespDto introspectTokenWithNone(String token) { - AuthingRequestConfig config = new AuthingRequestConfig(); + config.setMethod("UrlencodedPOST"); - if (ProtocolEnum.OIDC.getValue().equals(options.getProtocol())) { - config.setUrl("/oidc/token/introspection"); - } else { - config.setUrl("/oauth/token/introspection"); - } + Map headers = new HashMap<>(); + headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); + headers.put(Header.AUTHORIZATION.getValue(), basic64Str); + config.setHeaders(headers); - config.setMethod("UrlencodedPOST"); + IntrospectTokenDto reqDto = new IntrospectTokenDto(); + reqDto.setToken(token); + config.setBody(reqDto); - Map headers = new HashMap<>(); - headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); - config.setHeaders(headers); + String response = request(config); + return deserialize(response, IntrospectTokenRespDto.class); + } - IntrospectTokenDto reqDto = new IntrospectTokenDto(); - reqDto.setClientId(options.getAppId()); - reqDto.setToken(token); - config.setBody(reqDto); + private IntrospectTokenRespDto introspectTokenWithNone(String token) { + AuthingRequestConfig config = new AuthingRequestConfig(); - String response = request(config); - return deserialize(response, IntrospectTokenRespDto.class); + if (ProtocolEnum.OIDC.getValue().equals(options.getProtocol())) { + config.setUrl("/oidc/token/introspection"); + } else { + config.setUrl("/oauth/token/introspection"); } - /** - * 效验Token合法性 - */ - public ValidateTokenRespDto validateToken(ValidateTokenParams params) { - String idToken = params.getIdToken(); - String accessToken = params.getAccessToken(); - if (idToken == null && accessToken == null) { - throw new InvalidParameterException("请在传入的参数对象中包含 accessToken 或 idToken 字段"); - } - if (accessToken != null && idToken != null) { - throw new InvalidParameterException("accessToken 和 idToken 只能传入一个,不能同时传入"); - } - - AuthingRequestConfig config = new AuthingRequestConfig(); - - if (accessToken != null) { - config.setUrl("/api/v2/oidc/validate_token?access_token=" + accessToken); - } else { - config.setUrl("/api/v2/oidc/validate_token?id_token=" + idToken); - } - - config.setMethod("GET"); - - Map headers = new HashMap<>(); - headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); - config.setHeaders(headers); - - String response = request(config); - return deserialize(response, ValidateTokenRespDto.class); - } + config.setMethod("UrlencodedPOST"); - /** - * 撤回 Access token 或 Refresh token - */ - public boolean revokeToken(String token) { - verificationProtocol(); - - String revocationEndPointAuthMethod = options.getRevocationEndPointAuthMethod(); - if (AuthMethodEnum.CLIENT_SECRET_POST.getValue().equals(revocationEndPointAuthMethod)) { - return revokeTokenWithClientSecretPost(token); - } else if (AuthMethodEnum.CLIENT_SECRET_BASIC.getValue().equals(revocationEndPointAuthMethod)) { - return revokeTokenWithClientSecretBasic(token); - } else { - return revokeTokenWithNone(token); - } - } + Map headers = new HashMap<>(); + headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); + config.setHeaders(headers); - private boolean revokeTokenWithClientSecretPost(String token) { - AuthingRequestConfig config = new AuthingRequestConfig(); + IntrospectTokenDto reqDto = new IntrospectTokenDto(); + reqDto.setClientId(options.getAppId()); + reqDto.setToken(token); + config.setBody(reqDto); - if (ProtocolEnum.OIDC.getValue().equals(options.getProtocol())) { - config.setUrl("/oidc/token/revocation"); - } else { - config.setUrl("/oauth/token/revocation"); - } + String response = request(config); + return deserialize(response, IntrospectTokenRespDto.class); + } + + /** + * 效验Token合法性 + */ + public ValidateTokenRespDto validateToken(ValidateTokenParams params) { + String idToken = params.getIdToken(); + String accessToken = params.getAccessToken(); + if (idToken == null && accessToken == null) { + throw new InvalidParameterException("请在传入的参数对象中包含 accessToken 或 idToken 字段"); + } + if (accessToken != null && idToken != null) { + throw new InvalidParameterException("accessToken 和 idToken 只能传入一个,不能同时传入"); + } + + AuthingRequestConfig config = new AuthingRequestConfig(); - config.setMethod("UrlencodedPOST"); + if (accessToken != null) { + config.setUrl("/api/v2/oidc/validate_token?access_token=" + accessToken); + } else { + config.setUrl("/api/v2/oidc/validate_token?id_token=" + idToken); + } - Map headers = new HashMap<>(); - headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); - config.setHeaders(headers); + config.setMethod("GET"); - RevokeTokenDto reqDto = new RevokeTokenDto(); - reqDto.setClientId(options.getAppId()); - reqDto.setClientSecret(options.getAppSecret()); - reqDto.setToken(token); - config.setBody(reqDto); + Map headers = new HashMap<>(); + headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); + config.setHeaders(headers); - // 暂时修改为恒 true - request(config); - return true; + String response = request(config); + return deserialize(response, ValidateTokenRespDto.class); + } + + /** + * 撤回 Access token 或 Refresh token + */ + public boolean revokeToken(String token) { + verificationProtocol(); + + String revocationEndPointAuthMethod = options.getRevocationEndPointAuthMethod(); + if (AuthMethodEnum.CLIENT_SECRET_POST.getValue().equals(revocationEndPointAuthMethod)) { + return revokeTokenWithClientSecretPost(token); + } else if (AuthMethodEnum.CLIENT_SECRET_BASIC.getValue().equals(revocationEndPointAuthMethod)) { + return revokeTokenWithClientSecretBasic(token); + } else { + return revokeTokenWithNone(token); } + } - private boolean revokeTokenWithClientSecretBasic(String token) { - if (ProtocolEnum.OAUTH.getValue().equals(options.getProtocol())) { - throw new InvalidParameterException("OAuth 2.0 暂不支持用 client_secret_basic 模式身份验证撤回 Token"); - } + private boolean revokeTokenWithClientSecretPost(String token) { + AuthingRequestConfig config = new AuthingRequestConfig(); + + if (ProtocolEnum.OIDC.getValue().equals(options.getProtocol())) { + config.setUrl("/oidc/token/revocation"); + } else { + config.setUrl("/oauth/token/revocation"); + } - String basic64Str = "Basic " + Base64Encoder.encode((options.getAppId() + ":" + options.getAppSecret()).getBytes()); + config.setMethod("UrlencodedPOST"); - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/oidc/token/revocation"); - config.setMethod("UrlencodedPOST"); + Map headers = new HashMap<>(); + headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); + config.setHeaders(headers); - Map headers = new HashMap<>(); - headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); - headers.put(Header.AUTHORIZATION.getValue(), basic64Str); - config.setHeaders(headers); + RevokeTokenDto reqDto = new RevokeTokenDto(); + reqDto.setClientId(options.getAppId()); + reqDto.setClientSecret(options.getAppSecret()); + reqDto.setToken(token); + config.setBody(reqDto); - RevokeTokenDto reqDto = new RevokeTokenDto(); - reqDto.setToken(token); - config.setBody(reqDto); + // 暂时修改为恒 true + request(config); + return true; + } - request(config); - return true; + private boolean revokeTokenWithClientSecretBasic(String token) { + if (ProtocolEnum.OAUTH.getValue().equals(options.getProtocol())) { + throw new InvalidParameterException( + "OAuth 2.0 暂不支持用 client_secret_basic 模式身份验证撤回 Token"); } - private boolean revokeTokenWithNone(String token) { - AuthingRequestConfig config = new AuthingRequestConfig(); - - if (ProtocolEnum.OIDC.getValue().equals(options.getProtocol())) { - config.setUrl("/oidc/token/revocation"); - } else { - config.setUrl("/oauth/token/revocation"); - } + String basic64Str = "Basic " + Base64Encoder.encode( + (options.getAppId() + ":" + options.getAppSecret()).getBytes()); - config.setMethod("UrlencodedPOST"); + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/oidc/token/revocation"); + config.setMethod("UrlencodedPOST"); - Map headers = new HashMap<>(); - headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); - config.setHeaders(headers); + Map headers = new HashMap<>(); + headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); + headers.put(Header.AUTHORIZATION.getValue(), basic64Str); + config.setHeaders(headers); - RevokeTokenDto reqDto = new RevokeTokenDto(); - reqDto.setToken(token); - reqDto.setClientId(options.getAppId()); - config.setBody(reqDto); + RevokeTokenDto reqDto = new RevokeTokenDto(); + reqDto.setToken(token); + config.setBody(reqDto); - request(config); - return true; - } + request(config); + return true; + } - /** - * 使用用户名 + 密码登录 - * - * @param username 用户名 - * @param password 用户密码,默认不加密。Authing 所有 API 均通过 HTTPS 协议对密码进行安全传输,可以在一定程度上保证安全性。如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。 - * @param options 认证可选参数 - * @return - */ - public LoginTokenRespDto signInByUsernamePassword(String username, String password, SignInOptionsDto options) { - SigninByCredentialsDto dto = new SigninByCredentialsDto(); - - // 设置认证方式 - dto.setConnection(SigninByCredentialsDto.Connection.PASSWORD); - - // 设置认证数据 - SignInByPasswordPayloadDto payload = new SignInByPasswordPayloadDto(); - payload.setUsername(username); - payload.setPassword(password); - dto.setPasswordPayload(payload); - - // 设置可选参数 - dto.setOptions(options); - - // 设置 client_id 和 client_secret - if (this.options.getTokenEndPointAuthMethod() == AuthMethodEnum.CLIENT_SECRET_POST.getValue()) { - dto.setClientId(this.options.getAppId()); - dto.setClientSecret(this.options.getAppSecret()); - } - - return this.signInByCredentials(dto); - } + private boolean revokeTokenWithNone(String token) { + AuthingRequestConfig config = new AuthingRequestConfig(); - /** - * 使用邮箱 + 密码登录 - * - * @param email 邮箱 - * @param password 用户密码,默认不加密。Authing 所有 API 均通过 HTTPS 协议对密码进行安全传输,可以在一定程度上保证安全性。如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。 - * @param options 认证可选参数 - * @return - */ - public LoginTokenRespDto signInByEmailPassword(String email, String password, SignInOptionsDto options) { - SigninByCredentialsDto dto = new SigninByCredentialsDto(); - - // 设置认证方式 - dto.setConnection(SigninByCredentialsDto.Connection.PASSWORD); - - // 设置认证数据 - SignInByPasswordPayloadDto payload = new SignInByPasswordPayloadDto(); - payload.setEmail(email); - payload.setPassword(password); - dto.setPasswordPayload(payload); - - // 设置可选参数 - dto.setOptions(options); - - // 设置 client_id 和 client_secret - if (this.options.getTokenEndPointAuthMethod() == AuthMethodEnum.CLIENT_SECRET_POST.getValue()) { - dto.setClientId(this.options.getAppId()); - dto.setClientSecret(this.options.getAppSecret()); - } - - return this.signInByCredentials(dto); + if (ProtocolEnum.OIDC.getValue().equals(options.getProtocol())) { + config.setUrl("/oidc/token/revocation"); + } else { + config.setUrl("/oauth/token/revocation"); } - /** - * 使用手机号 + 密码登录 - * - * @param phone 手机号 - * @param password 用户密码,默认不加密。Authing 所有 API 均通过 HTTPS 协议对密码进行安全传输,可以在一定程度上保证安全性。如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。 - * @param options 认证可选参数 - * @return - */ - public LoginTokenRespDto signInByPhonePassword(String phone, String password, SignInOptionsDto options) { - SigninByCredentialsDto dto = new SigninByCredentialsDto(); - - // 设置认证方式 - dto.setConnection(SigninByCredentialsDto.Connection.PASSWORD); - - // 设置认证数据 - SignInByPasswordPayloadDto payload = new SignInByPasswordPayloadDto(); - payload.setPhone(phone); - payload.setPassword(password); - dto.setPasswordPayload(payload); - - // 设置可选参数 - dto.setOptions(options); - - // 设置 client_id 和 client_secret - if (this.options.getTokenEndPointAuthMethod() == AuthMethodEnum.CLIENT_SECRET_POST.getValue()) { - dto.setClientId(this.options.getAppId()); - dto.setClientSecret(this.options.getAppSecret()); - } - - return this.signInByCredentials(dto); - } + config.setMethod("UrlencodedPOST"); - /** - * 使用账号(手机号/邮箱/用户名) + 密码登录 - * - * @param acconnt 账号(手机号/邮箱/用户名) - * @param password 用户密码,默认不加密。Authing 所有 API 均通过 HTTPS 协议对密码进行安全传输,可以在一定程度上保证安全性。如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。 - * @param options 认证可选参数 - * @return - */ - public LoginTokenRespDto signInByAccountPassword(String acconnt, String password, SignInOptionsDto options) { - SigninByCredentialsDto dto = new SigninByCredentialsDto(); - - // 设置认证方式 - dto.setConnection(SigninByCredentialsDto.Connection.PASSWORD); - - // 设置认证数据 - SignInByPasswordPayloadDto payload = new SignInByPasswordPayloadDto(); - payload.setAccount(acconnt); - payload.setPassword(password); - dto.setPasswordPayload(payload); - - // 设置可选参数 - dto.setOptions(options); - - // 设置 client_id 和 client_secret - if (this.options.getTokenEndPointAuthMethod() == AuthMethodEnum.CLIENT_SECRET_POST.getValue()) { - dto.setClientId(this.options.getAppId()); - dto.setClientSecret(this.options.getAppSecret()); - } - - return this.signInByCredentials(dto); - } + Map headers = new HashMap<>(); + headers.put(Header.CONTENT_TYPE.getValue(), "application/x-www-form-urlencoded"); + config.setHeaders(headers); + RevokeTokenDto reqDto = new RevokeTokenDto(); + reqDto.setToken(token); + reqDto.setClientId(options.getAppId()); + config.setBody(reqDto); - /** - * 使用手机号 + 验证码登录 - * - * @param phone 手机号 - * @param phoneCountryCode 手机区号 - * @param passCode 验证码 - * @param options 认证可选参数 - * @return - */ - public LoginTokenRespDto signInByPhonePassCode(String phone, String passCode, String phoneCountryCode, SignInOptionsDto options) { - SigninByCredentialsDto dto = new SigninByCredentialsDto(); - - // 设置认证方式 - dto.setConnection(SigninByCredentialsDto.Connection.PASSCODE); - - // 设置认证数据 - SignInByPassCodePayloadDto payload = new SignInByPassCodePayloadDto(); - payload.setPhone(phone); - payload.setPhoneCountryCode(phoneCountryCode); - payload.setPassCode(passCode); - dto.setPassCodePayload(payload); - - // 设置可选参数 - dto.setOptions(options); - - // 设置 client_id 和 client_secret - if (this.options.getTokenEndPointAuthMethod() == AuthMethodEnum.CLIENT_SECRET_POST.getValue()) { - dto.setClientId(this.options.getAppId()); - dto.setClientSecret(this.options.getAppSecret()); - } - - return this.signInByCredentials(dto); + request(config); + return true; + } + + /** + * 使用用户名 + 密码登录 + * + * @param username 用户名 + * @param password 用户密码,默认不加密。Authing 所有 API 均通过 HTTPS + * 协议对密码进行安全传输,可以在一定程度上保证安全性。如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` + * 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。 + * @param options 认证可选参数 + * @return + */ + public LoginTokenRespDto signInByUsernamePassword(String username, String password, + SignInOptionsDto options) { + SigninByCredentialsDto dto = new SigninByCredentialsDto(); + + // 设置认证方式 + dto.setConnection(SigninByCredentialsDto.Connection.PASSWORD); + + // 设置认证数据 + SignInByPasswordPayloadDto payload = new SignInByPasswordPayloadDto(); + payload.setUsername(username); + payload.setPassword(password); + dto.setPasswordPayload(payload); + + // 设置可选参数 + dto.setOptions(options); + + // 设置 client_id 和 client_secret + if (this.options.getTokenEndPointAuthMethod() == AuthMethodEnum.CLIENT_SECRET_POST.getValue()) { + dto.setClientId(this.options.getAppId()); + dto.setClientSecret(this.options.getAppSecret()); } - /** - * 使用邮箱 + 验证码登录 - * - * @param email 邮箱 - * @param passCode 验证码 - * @param options 认证可选参数 - * @return - */ - public LoginTokenRespDto signInByEmailPassCode(String email, String passCode, SignInOptionsDto options) { - SigninByCredentialsDto dto = new SigninByCredentialsDto(); - - // 设置认证方式 - dto.setConnection(SigninByCredentialsDto.Connection.PASSCODE); - - // 设置认证数据 - SignInByPassCodePayloadDto payload = new SignInByPassCodePayloadDto(); - payload.setEmail(email); - payload.setPassCode(passCode); - dto.setPassCodePayload(payload); - - // 设置可选参数 - dto.setOptions(options); - - // 设置 client_id 和 client_secret - if (this.options.getTokenEndPointAuthMethod() == AuthMethodEnum.CLIENT_SECRET_POST.getValue()) { - dto.setClientId(this.options.getAppId()); - dto.setClientSecret(this.options.getAppSecret()); - } - - return this.signInByCredentials(dto); + return this.signInByCredentials(dto); + } + + /** + * 使用邮箱 + 密码登录 + * + * @param email 邮箱 + * @param password 用户密码,默认不加密。Authing 所有 API 均通过 HTTPS + * 协议对密码进行安全传输,可以在一定程度上保证安全性。如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` + * 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。 + * @param options 认证可选参数 + * @return + */ + public LoginTokenRespDto signInByEmailPassword(String email, String password, + SignInOptionsDto options) { + SigninByCredentialsDto dto = new SigninByCredentialsDto(); + + // 设置认证方式 + dto.setConnection(SigninByCredentialsDto.Connection.PASSWORD); + + // 设置认证数据 + SignInByPasswordPayloadDto payload = new SignInByPasswordPayloadDto(); + payload.setEmail(email); + payload.setPassword(password); + dto.setPasswordPayload(payload); + + // 设置可选参数 + dto.setOptions(options); + + // 设置 client_id 和 client_secret + if (this.options.getTokenEndPointAuthMethod() == AuthMethodEnum.CLIENT_SECRET_POST.getValue()) { + dto.setClientId(this.options.getAppId()); + dto.setClientSecret(this.options.getAppSecret()); } - /** - * 使用 LDAP 账号密码登录 - * - * @param sAMAccountName LDAP 用户目录中账号的 sAMAccountName - * @param password 用户密码,默认不加密。Authing 所有 API 均通过 HTTPS 协议对密码进行安全传输,可以在一定程度上保证安全性。如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。 - * @param options 认证可选参数 - * @return - */ - public LoginTokenRespDto signInByLDAP(String sAMAccountName, String password, SignInOptionsDto options) { - SigninByCredentialsDto dto = new SigninByCredentialsDto(); - - // 设置认证方式 - dto.setConnection(SigninByCredentialsDto.Connection.LDAP); - - // 设置认证数据 - SignInByLdapPayloadDto payload = new SignInByLdapPayloadDto(); - payload.setPassword(password); - payload.setSAMAccountName(sAMAccountName); - dto.setLdapPayload(payload); - - // 设置可选参数 - dto.setOptions(options); - - // 设置 client_id 和 client_secret - if (this.options.getTokenEndPointAuthMethod() == AuthMethodEnum.CLIENT_SECRET_POST.getValue()) { - dto.setClientId(this.options.getAppId()); - dto.setClientSecret(this.options.getAppSecret()); - } - - return this.signInByCredentials(dto); + return this.signInByCredentials(dto); + } + + /** + * 使用手机号 + 密码登录 + * + * @param phone 手机号 + * @param password 用户密码,默认不加密。Authing 所有 API 均通过 HTTPS + * 协议对密码进行安全传输,可以在一定程度上保证安全性。如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` + * 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。 + * @param options 认证可选参数 + * @return + */ + public LoginTokenRespDto signInByPhonePassword(String phone, String password, + SignInOptionsDto options) { + SigninByCredentialsDto dto = new SigninByCredentialsDto(); + + // 设置认证方式 + dto.setConnection(SigninByCredentialsDto.Connection.PASSWORD); + + // 设置认证数据 + SignInByPasswordPayloadDto payload = new SignInByPasswordPayloadDto(); + payload.setPhone(phone); + payload.setPassword(password); + dto.setPasswordPayload(payload); + + // 设置可选参数 + dto.setOptions(options); + + // 设置 client_id 和 client_secret + if (this.options.getTokenEndPointAuthMethod() == AuthMethodEnum.CLIENT_SECRET_POST.getValue()) { + dto.setClientId(this.options.getAppId()); + dto.setClientSecret(this.options.getAppSecret()); } - /** - * 使用 AD 账号密码登录 - * - * @param sAMAccountName LDAP 用户目录中账号的 sAMAccountName - * @param password 用户密码,默认不加密。Authing 所有 API 均通过 HTTPS 协议对密码进行安全传输,可以在一定程度上保证安全性。如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。 - * @param options 认证可选参数 - * @return - */ - public LoginTokenRespDto signInByAD(String sAMAccountName, String password, SignInOptionsDto options) { - SigninByCredentialsDto dto = new SigninByCredentialsDto(); - - // 设置认证方式 - dto.setConnection(SigninByCredentialsDto.Connection.AD); - - // 设置认证数据 - SignInByAdPayloadDto payload = new SignInByAdPayloadDto(); - payload.setPassword(password); - payload.setSAMAccountName(sAMAccountName); - dto.setAdPayload(payload); - - // 设置可选参数 - dto.setOptions(options); - - // 设置 client_id 和 client_secret - if (this.options.getTokenEndPointAuthMethod() == AuthMethodEnum.CLIENT_SECRET_POST.getValue()) { - dto.setClientId(this.options.getAppId()); - dto.setClientSecret(this.options.getAppSecret()); - } - - return this.signInByCredentials(dto); + return this.signInByCredentials(dto); + } + + /** + * 使用账号(手机号/邮箱/用户名) + 密码登录 + * + * @param acconnt 账号(手机号/邮箱/用户名) + * @param password 用户密码,默认不加密。Authing 所有 API 均通过 HTTPS + * 协议对密码进行安全传输,可以在一定程度上保证安全性。如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` + * 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。 + * @param options 认证可选参数 + * @return + */ + public LoginTokenRespDto signInByAccountPassword(String acconnt, String password, + SignInOptionsDto options) { + SigninByCredentialsDto dto = new SigninByCredentialsDto(); + + // 设置认证方式 + dto.setConnection(SigninByCredentialsDto.Connection.PASSWORD); + + // 设置认证数据 + SignInByPasswordPayloadDto payload = new SignInByPasswordPayloadDto(); + payload.setAccount(acconnt); + payload.setPassword(password); + dto.setPasswordPayload(payload); + + // 设置可选参数 + dto.setOptions(options); + + // 设置 client_id 和 client_secret + if (this.options.getTokenEndPointAuthMethod() == AuthMethodEnum.CLIENT_SECRET_POST.getValue()) { + dto.setClientId(this.options.getAppId()); + dto.setClientSecret(this.options.getAppSecret()); } - - /** - * 使用用户名 + 密码注册 - * - * @param username 用户名 - * @param password 用户密码,默认不加密。Authing 所有 API 均通过 HTTPS 协议对密码进行安全传输,可以在一定程度上保证安全性。如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。 - * @param profile 注册时额外设置的用户资料,可选 - * @param options 注册可选参数 - * @return - */ - public UserSingleRespDto signUpByUsernamePassword(String username, String password, SignUpProfileDto profile, SignUpOptionsDto options) { - SignUpDto dto = new SignUpDto(); - - // 设置认证方式 - dto.setConnection(SignUpDto.Connection.PASSWORD); - - // 设置注册数据 - SignUpByPasswordDto payload = new SignUpByPasswordDto(); - payload.setPassword(password); - payload.setUsername(username); - dto.setPasswordPayload(payload); - - // 设置可选的个人资料 - dto.setProfile(profile); - - // 设置可选参数 - dto.setOptions(options); - - return this.signUp(dto); + return this.signInByCredentials(dto); + } + + + /** + * 使用手机号 + 验证码登录 + * + * @param phone 手机号 + * @param phoneCountryCode 手机区号 + * @param passCode 验证码 + * @param options 认证可选参数 + * @return + */ + public LoginTokenRespDto signInByPhonePassCode(String phone, String passCode, + String phoneCountryCode, SignInOptionsDto options) { + SigninByCredentialsDto dto = new SigninByCredentialsDto(); + + // 设置认证方式 + dto.setConnection(SigninByCredentialsDto.Connection.PASSCODE); + + // 设置认证数据 + SignInByPassCodePayloadDto payload = new SignInByPassCodePayloadDto(); + payload.setPhone(phone); + payload.setPhoneCountryCode(phoneCountryCode); + payload.setPassCode(passCode); + dto.setPassCodePayload(payload); + + // 设置可选参数 + dto.setOptions(options); + + // 设置 client_id 和 client_secret + if (this.options.getTokenEndPointAuthMethod() == AuthMethodEnum.CLIENT_SECRET_POST.getValue()) { + dto.setClientId(this.options.getAppId()); + dto.setClientSecret(this.options.getAppSecret()); } - /** - * 使用邮箱 + 密码注册 - * - * @param email 邮箱 - * @param password 用户密码,默认不加密。Authing 所有 API 均通过 HTTPS 协议对密码进行安全传输,可以在一定程度上保证安全性。如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。 - * @param profile 注册时额外设置的用户资料,可选 - * @param options 注册可选参数 - * @return - */ - public UserSingleRespDto signUpByEmailPassword(String email, String password, SignUpProfileDto profile, SignUpOptionsDto options) { - SignUpDto dto = new SignUpDto(); - - // 设置认证方式 - dto.setConnection(SignUpDto.Connection.PASSWORD); - - // 设置注册数据 - SignUpByPasswordDto payload = new SignUpByPasswordDto(); - payload.setPassword(password); - payload.setEmail(email); - dto.setPasswordPayload(payload); - - // 设置可选的个人资料 - dto.setProfile(profile); - - // 设置可选参数 - dto.setOptions(options); - - return this.signUp(dto); + return this.signInByCredentials(dto); + } + + /** + * 使用邮箱 + 验证码登录 + * + * @param email 邮箱 + * @param passCode 验证码 + * @param options 认证可选参数 + * @return + */ + public LoginTokenRespDto signInByEmailPassCode(String email, String passCode, + SignInOptionsDto options) { + SigninByCredentialsDto dto = new SigninByCredentialsDto(); + + // 设置认证方式 + dto.setConnection(SigninByCredentialsDto.Connection.PASSCODE); + + // 设置认证数据 + SignInByPassCodePayloadDto payload = new SignInByPassCodePayloadDto(); + payload.setEmail(email); + payload.setPassCode(passCode); + dto.setPassCodePayload(payload); + + // 设置可选参数 + dto.setOptions(options); + + // 设置 client_id 和 client_secret + if (this.options.getTokenEndPointAuthMethod() == AuthMethodEnum.CLIENT_SECRET_POST.getValue()) { + dto.setClientId(this.options.getAppId()); + dto.setClientSecret(this.options.getAppSecret()); } - /** - * 使用邮箱 + 验证码注册 - * - * @param email 邮箱 - * @param passCode 验证码 - * @param profile 注册时额外设置的用户资料,可选 - * @param options 注册可选参数 - * @return - */ - public UserSingleRespDto signUpByEmailPassCode(String email, String passCode, SignUpProfileDto profile, SignUpOptionsDto options) { - SignUpDto dto = new SignUpDto(); - - // 设置认证方式 - dto.setConnection(SignUpDto.Connection.PASSCODE); - - // 设置注册数据 - SignUpByPassCodeDto payload = new SignUpByPassCodeDto(); - payload.setPassCode(passCode); - payload.setEmail(email); - dto.setPassCodePayload(payload); - - // 设置可选的个人资料 - dto.setProfile(profile); - - // 设置可选参数 - dto.setOptions(options); - - return this.signUp(dto); + return this.signInByCredentials(dto); + } + + /** + * 使用 LDAP 账号密码登录 + * + * @param sAMAccountName LDAP 用户目录中账号的 sAMAccountName + * @param password 用户密码,默认不加密。Authing 所有 API 均通过 HTTPS + * 协议对密码进行安全传输,可以在一定程度上保证安全性。如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` + * 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。 + * @param options 认证可选参数 + * @return + */ + public LoginTokenRespDto signInByLDAP(String sAMAccountName, String password, + SignInOptionsDto options) { + SigninByCredentialsDto dto = new SigninByCredentialsDto(); + + // 设置认证方式 + dto.setConnection(SigninByCredentialsDto.Connection.LDAP); + + // 设置认证数据 + SignInByLdapPayloadDto payload = new SignInByLdapPayloadDto(); + payload.setPassword(password); + payload.setSAMAccountName(sAMAccountName); + dto.setLdapPayload(payload); + + // 设置可选参数 + dto.setOptions(options); + + // 设置 client_id 和 client_secret + if (this.options.getTokenEndPointAuthMethod() == AuthMethodEnum.CLIENT_SECRET_POST.getValue()) { + dto.setClientId(this.options.getAppId()); + dto.setClientSecret(this.options.getAppSecret()); } - /** - * 使用手机号 + 验证码注册 - * - * @param phone 手机号 - * @param phoneCountryCode 手机区号 - * @param passCode 验证码 - * @param profile 注册时额外设置的用户资料,可选 - * @param options 注册可选参数 - * @return - */ - public UserSingleRespDto signUpByPhonePassCode(String phone, String passCode, String phoneCountryCode, SignUpProfileDto profile, SignUpOptionsDto options) { - SignUpDto dto = new SignUpDto(); - - // 设置认证方式 - dto.setConnection(SignUpDto.Connection.PASSCODE); - - // 设置注册数据 - SignUpByPassCodeDto payload = new SignUpByPassCodeDto(); - payload.setPassCode(passCode); - payload.setPhone(phone); - payload.setPhoneCountryCode(phoneCountryCode); - dto.setPassCodePayload(payload); - - // 设置可选的个人资料 - dto.setProfile(profile); - - // 设置可选参数 - dto.setOptions(options); - - return this.signUp(dto); + return this.signInByCredentials(dto); + } + + /** + * 使用 AD 账号密码登录 + * + * @param sAMAccountName LDAP 用户目录中账号的 sAMAccountName + * @param password 用户密码,默认不加密。Authing 所有 API 均通过 HTTPS + * 协议对密码进行安全传输,可以在一定程度上保证安全性。如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` + * 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。 + * @param options 认证可选参数 + * @return + */ + public LoginTokenRespDto signInByAD(String sAMAccountName, String password, + SignInOptionsDto options) { + SigninByCredentialsDto dto = new SigninByCredentialsDto(); + + // 设置认证方式 + dto.setConnection(SigninByCredentialsDto.Connection.AD); + + // 设置认证数据 + SignInByAdPayloadDto payload = new SignInByAdPayloadDto(); + payload.setPassword(password); + payload.setSAMAccountName(sAMAccountName); + dto.setAdPayload(payload); + + // 设置可选参数 + dto.setOptions(options); + + // 设置 client_id 和 client_secret + if (this.options.getTokenEndPointAuthMethod() == AuthMethodEnum.CLIENT_SECRET_POST.getValue()) { + dto.setClientId(this.options.getAppId()); + dto.setClientSecret(this.options.getAppSecret()); } + return this.signInByCredentials(dto); + } + + + /** + * 使用用户名 + 密码注册 + * + * @param username 用户名 + * @param password 用户密码,默认不加密。Authing 所有 API 均通过 HTTPS + * 协议对密码进行安全传输,可以在一定程度上保证安全性。如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` + * 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。 + * @param profile 注册时额外设置的用户资料,可选 + * @param options 注册可选参数 + * @return + */ + public UserSingleRespDto signUpByUsernamePassword(String username, String password, + SignUpProfileDto profile, SignUpOptionsDto options) { + SignUpDto dto = new SignUpDto(); + + // 设置认证方式 + dto.setConnection(SignUpDto.Connection.PASSWORD); + + // 设置注册数据 + SignUpByPasswordDto payload = new SignUpByPasswordDto(); + payload.setPassword(password); + payload.setUsername(username); + dto.setPasswordPayload(payload); + + // 设置可选的个人资料 + dto.setProfile(profile); + + // 设置可选参数 + dto.setOptions(options); + + return this.signUp(dto); + } + + /** + * 使用邮箱 + 密码注册 + * + * @param email 邮箱 + * @param password 用户密码,默认不加密。Authing 所有 API 均通过 HTTPS + * 协议对密码进行安全传输,可以在一定程度上保证安全性。如果你还需要更高级别的安全性,我们还支持 `RSA256` 和国密 `SM2` + * 的密码加密方式。详情见可选参数 `options.passwordEncryptType`。 + * @param profile 注册时额外设置的用户资料,可选 + * @param options 注册可选参数 + * @return + */ + public UserSingleRespDto signUpByEmailPassword(String email, String password, + SignUpProfileDto profile, SignUpOptionsDto options) { + SignUpDto dto = new SignUpDto(); + + // 设置认证方式 + dto.setConnection(SignUpDto.Connection.PASSWORD); + + // 设置注册数据 + SignUpByPasswordDto payload = new SignUpByPasswordDto(); + payload.setPassword(password); + payload.setEmail(email); + dto.setPasswordPayload(payload); + + // 设置可选的个人资料 + dto.setProfile(profile); + + // 设置可选参数 + dto.setOptions(options); + + return this.signUp(dto); + } + + /** + * 使用邮箱 + 验证码注册 + * + * @param email 邮箱 + * @param passCode 验证码 + * @param profile 注册时额外设置的用户资料,可选 + * @param options 注册可选参数 + * @return + */ + public UserSingleRespDto signUpByEmailPassCode(String email, String passCode, + SignUpProfileDto profile, SignUpOptionsDto options) { + SignUpDto dto = new SignUpDto(); + + // 设置认证方式 + dto.setConnection(SignUpDto.Connection.PASSCODE); + + // 设置注册数据 + SignUpByPassCodeDto payload = new SignUpByPassCodeDto(); + payload.setPassCode(passCode); + payload.setEmail(email); + dto.setPassCodePayload(payload); + + // 设置可选的个人资料 + dto.setProfile(profile); + + // 设置可选参数 + dto.setOptions(options); + + return this.signUp(dto); + } + + /** + * 使用手机号 + 验证码注册 + * + * @param phone 手机号 + * @param phoneCountryCode 手机区号 + * @param passCode 验证码 + * @param profile 注册时额外设置的用户资料,可选 + * @param options 注册可选参数 + * @return + */ + public UserSingleRespDto signUpByPhonePassCode(String phone, String passCode, + String phoneCountryCode, SignUpProfileDto profile, SignUpOptionsDto options) { + SignUpDto dto = new SignUpDto(); + + // 设置认证方式 + dto.setConnection(SignUpDto.Connection.PASSCODE); + + // 设置注册数据 + SignUpByPassCodeDto payload = new SignUpByPassCodeDto(); + payload.setPassCode(passCode); + payload.setPhone(phone); + payload.setPhoneCountryCode(phoneCountryCode); + dto.setPassCodePayload(payload); + + // 设置可选的个人资料 + dto.setProfile(profile); + + // 设置可选参数 + dto.setOptions(options); + + return this.signUp(dto); + } + + // ==== AUTO GENERATED AUTHENTICATION METHODS BEGIN ==== + + /** + * @summary 生成绑定外部身份源的链接 + * @description 此接口用于生成绑定外部身份源的链接,生成之后可以引导用户进行跳转。 + **/ + public GenerateBindExtIdpLinkRespDto generateLinkExtIdpUrl(GenerateLinkExtidpUrlDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/generate-link-extidp-url"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GenerateBindExtIdpLinkRespDto.class); + } - // ==== AUTO GENERATED AUTHENTICATION METHODS BEGIN ==== -/** - * @summary 使用用户凭证登录 - * @description - * 此端点为基于直接 API 调用形式的登录端点,适用于你需要自建登录页面的场景。**此端点暂时不支持 MFA、信息补全、首次密码重置等流程,如有需要,请使用 OIDC 标准协议认证端点。** - * - * - * 注意事项:取决于你在 Authing 创建应用时选择的**应用类型**和应用配置的**换取 token 身份验证方式**,在调用此接口时需要对客户端的身份进行不同形式的验证。 - * - *
- * 点击展开详情 - * - *
- * - * 你可以在 [Authing 控制台](https://console.authing.cn) 的**应用** - **自建应用** - **应用详情** - **应用配置** - **其他设置** - **授权配置** - * 中找到**换取 token 身份验证方式** 配置项: - * - * > 单页 Web 应用和客户端应用隐藏,默认为 `none`,不允许修改;后端应用和标准 Web 应用可以修改此配置项。 - * - * ![](https://files.authing.co/api-explorer/tokenAuthMethod.jpg) - * - * #### 换取 token 身份验证方式为 none 时 - * - * 调用此接口不需要进行额外操作。 - * - * #### 换取 token 身份验证方式为 client_secret_post 时 - * - * 调用此接口时必须在 body 中传递 `client_id` 和 `client_secret` 参数,作为验证客户端身份的条件。其中 `client_id` 为应用 ID、`client_secret` 为应用密钥。 - * - * #### 换取 token 身份验证方式为 client_secret_basic 时 - * - * 调用此接口时必须在 HTTP 请求头中携带 `authorization` 请求头,作为验证客户端身份的条件。`authorization` 请求头的格式如下(其中 `client_id` 为应用 ID、`client_secret` 为应用密钥。): - * - * ``` - * Basic base64(:) - * ``` - * - * 结果示例: - * - * ``` - * Basic NjA2M2ZiMmYzY3h4eHg2ZGY1NWYzOWViOjJmZTdjODdhODFmODY3eHh4eDAzMjRkZjEyZGFlZGM3 - * ``` - * - * JS 代码示例: - * - * ```js - * 'Basic ' + Buffer.from(client_id + ':' + client_secret).toString('base64'); - * ``` - * - *
- * - * - **/ -public LoginTokenRespDto signInByCredentials(SigninByCredentialsDto reqDto) { + /** + * @summary 解绑外部身份源 + * @description 解绑外部身份源,此接口需要传递用户绑定的外部身份源 ID,**注意不是身份源连接 ID**。 + **/ + public CommonResponseDto unlinkExtIdp(UnlinkExtIdpDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/unlink-extidp"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 获取绑定的外部身份源 + * @description 如在**介绍**部分中所描述的,一个外部身份源对应多个外部身份源连接,用户通过某个外部身份源连接绑定了某个外部身份源账号之后, + * 用户会建立一条与此外部身份源之间的关联关系。此接口用于获取此用户绑定的所有外部身份源。 + *

+ * 取决于外部身份源的具体实现,一个用户在外部身份源中,可能会有多个身份 ID,比如在微信体系中会有 `openid` 和 `unionid`,在非书中有 + * `open_id`、`union_id` 和 `user_id`。在 Authing 中,我们把这样的一条 `open_id` 或者 `unionid_` 叫做一条 `Identity`, + * 所以用户在一个身份源会有多条 `Identity` 记录。 + *

+ * 以微信为例,如果用户使用微信登录或者绑定了微信账号,他的 `Identity` 信息如下所示: + *

+ * ```json [ { "identityId": "62f20932xxxxbcc10d966ee5", "extIdpId": "62f209327xxxxcc10d966ee5", + * "provider": "wechat", "type": "openid", "userIdInIdp": "oH_5k5SflrwjGvk7wqpoBKq_cc6M", + * "originConnIds": ["62f2093244fa5cb19ff21ed3"] }, { "identityId": "62f726239xxxxe3285d21c93", + * "extIdpId": "62f209327xxxxcc10d966ee5", "provider": "wechat", "type": "unionid", "userIdInIdp": + * "o9Nka5ibU-lUGQaeAHqu0nOZyJg0", "originConnIds": ["62f2093244fa5cb19ff21ed3"] } ] ``` + *

+ *

+ * 可以看到他们的 `extIdpId` 是一样的,这个是你在 Authing 中创建的**身份源 ID**;`provider` 都是 `wechat`; 通过 `type` 可以区分出哪个是 + * `openid`,哪个是 `unionid`,以及具体的值(`userIdInIdp`);他们都来自于同一个身份源连接(`originConnIds`)。 + **/ + public GetIdentitiesRespDto getIdentities() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-identities"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetIdentitiesRespDto.class); + } + + /** + * @summary 获取应用开启的外部身份源列表 + * @description 获取应用开启的外部身份源列表,前端可以基于此渲染外部身份源按钮。 + **/ + public GetExtIdpsRespDto getApplicationEnabledExtIdps() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-application-enabled-extidps"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetExtIdpsRespDto.class); + } + + /** + * @summary 使用用户凭证登录 + * @description 此端点为基于直接 API 调用形式的登录端点,适用于你需要自建登录页面的场景。**此端点暂时不支持 MFA、信息补全、首次密码重置等流程,如有需要,请使用 OIDC + * 标准协议认证端点。** + *

+ *

+ * 注意事项:取决于你在 Authing 创建应用时选择的**应用类型**和应用配置的**换取 token 身份验证方式**,在调用此接口时需要对客户端的身份进行不同形式的验证。 + * + *

+ * 点击展开详情 + * + *
+ *

+ * 你可以在 [Authing 控制台](https://console.authing.cn) 的**应用** - **自建应用** - **应用详情** - **应用配置** - + * **其他设置** - **授权配置** 中找到**换取 token 身份验证方式** 配置项: + *

+ * > 单页 Web 应用和客户端应用隐藏,默认为 `none`,不允许修改;后端应用和标准 Web 应用可以修改此配置项。 + *

+ * ![](https://files.authing.co/api-explorer/tokenAuthMethod.jpg) + *

+ * #### 换取 token 身份验证方式为 none 时 + *

+ * 调用此接口不需要进行额外操作。 + *

+ * #### 换取 token 身份验证方式为 client_secret_post 时 + *

+ * 调用此接口时必须在 body 中传递 `client_id` 和 `client_secret` 参数,作为验证客户端身份的条件。其中 `client_id` 为应用 + * ID、`client_secret` 为应用密钥。 + *

+ * #### 换取 token 身份验证方式为 client_secret_basic 时 + *

+ * 调用此接口时必须在 HTTP 请求头中携带 `authorization` 请求头,作为验证客户端身份的条件。`authorization` 请求头的格式如下(其中 `client_id` + * 为应用 ID、`client_secret` 为应用密钥。): + *

+ * ``` Basic base64(:) ``` + *

+ * 结果示例: + *

+ * ``` Basic NjA2M2ZiMmYzY3h4eHg2ZGY1NWYzOWViOjJmZTdjODdhODFmODY3eHh4eDAzMjRkZjEyZGFlZGM3 ``` + *

+ * JS 代码示例: + *

+ * ```js 'Basic ' + Buffer.from(client_id + ':' + client_secret).toString('base64'); ``` + * + *

+ **/ + public LoginTokenRespDto signInByCredentials(SigninByCredentialsDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/signin"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, LoginTokenRespDto.class); -} -/** - * @summary 使用移动端社会化登录 - * @description - * 此端点为移动端社会化登录接口,使用第三方移动社会化登录返回的临时凭证登录,并换取用户的 `id_token` 和 `access_token`。请先阅读相应社会化登录的接入流程。 - * - * - * 注意事项:取决于你在 Authing 创建应用时选择的**应用类型**和应用配置的**换取 token 身份验证方式**,在调用此接口时需要对客户端的身份进行不同形式的验证。 - * - *
- * 点击展开详情 - * - *
- * - * 你可以在 [Authing 控制台](https://console.authing.cn) 的**应用** - **自建应用** - **应用详情** - **应用配置** - **其他设置** - **授权配置** - * 中找到**换取 token 身份验证方式** 配置项: - * - * > 单页 Web 应用和客户端应用隐藏,默认为 `none`,不允许修改;后端应用和标准 Web 应用可以修改此配置项。 - * - * ![](https://files.authing.co/api-explorer/tokenAuthMethod.jpg) - * - * #### 换取 token 身份验证方式为 none 时 - * - * 调用此接口不需要进行额外操作。 - * - * #### 换取 token 身份验证方式为 client_secret_post 时 - * - * 调用此接口时必须在 body 中传递 `client_id` 和 `client_secret` 参数,作为验证客户端身份的条件。其中 `client_id` 为应用 ID、`client_secret` 为应用密钥。 - * - * #### 换取 token 身份验证方式为 client_secret_basic 时 - * - * 调用此接口时必须在 HTTP 请求头中携带 `authorization` 请求头,作为验证客户端身份的条件。`authorization` 请求头的格式如下(其中 `client_id` 为应用 ID、`client_secret` 为应用密钥。): - * - * ``` - * Basic base64(:) - * ``` - * - * 结果示例: - * - * ``` - * Basic NjA2M2ZiMmYzY3h4eHg2ZGY1NWYzOWViOjJmZTdjODdhODFmODY3eHh4eDAzMjRkZjEyZGFlZGM3 - * ``` - * - * JS 代码示例: - * - * ```js - * 'Basic ' + Buffer.from(client_id + ':' + client_secret).toString('base64'); - * ``` - * - *
- * - * - **/ -public LoginTokenRespDto signInByMobile(SigninByMobileDto reqDto) { + } + + /** + * @summary 使用移动端社会化登录 + * @description 此端点为移动端社会化登录接口,使用第三方移动社会化登录返回的临时凭证登录,并换取用户的 `id_token` 和 + * `access_token`。请先阅读相应社会化登录的接入流程。 + *

+ *

+ * 注意事项:取决于你在 Authing 创建应用时选择的**应用类型**和应用配置的**换取 token 身份验证方式**,在调用此接口时需要对客户端的身份进行不同形式的验证。 + * + *

+ * 点击展开详情 + * + *
+ *

+ * 你可以在 [Authing 控制台](https://console.authing.cn) 的**应用** - **自建应用** - **应用详情** - **应用配置** - + * **其他设置** - **授权配置** 中找到**换取 token 身份验证方式** 配置项: + *

+ * > 单页 Web 应用和客户端应用隐藏,默认为 `none`,不允许修改;后端应用和标准 Web 应用可以修改此配置项。 + *

+ * ![](https://files.authing.co/api-explorer/tokenAuthMethod.jpg) + *

+ * #### 换取 token 身份验证方式为 none 时 + *

+ * 调用此接口不需要进行额外操作。 + *

+ * #### 换取 token 身份验证方式为 client_secret_post 时 + *

+ * 调用此接口时必须在 body 中传递 `client_id` 和 `client_secret` 参数,作为验证客户端身份的条件。其中 `client_id` 为应用 + * ID、`client_secret` 为应用密钥。 + *

+ * #### 换取 token 身份验证方式为 client_secret_basic 时 + *

+ * 调用此接口时必须在 HTTP 请求头中携带 `authorization` 请求头,作为验证客户端身份的条件。`authorization` 请求头的格式如下(其中 `client_id` + * 为应用 ID、`client_secret` 为应用密钥。): + *

+ * ``` Basic base64(:) ``` + *

+ * 结果示例: + *

+ * ``` Basic NjA2M2ZiMmYzY3h4eHg2ZGY1NWYzOWViOjJmZTdjODdhODFmODY3eHh4eDAzMjRkZjEyZGFlZGM3 ``` + *

+ * JS 代码示例: + *

+ * ```js 'Basic ' + Buffer.from(client_id + ':' + client_secret).toString('base64'); ``` + * + *

+ **/ + public LoginTokenRespDto signInByMobile(SigninByMobileDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/signin-by-mobile"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, LoginTokenRespDto.class); -} -/** - * @summary 获取支付宝 AuthInfo - * @description 此接口用于获取发起支付宝认证需要的[初始化参数 AuthInfo](https://opendocs.alipay.com/open/218/105325)。 - **/ -public GetAlipayAuthInfoRespDto getAlipayAuthInfo(GetAlipayAuthinfoDto reqDto) { + } + + /** + * @summary 获取支付宝 AuthInfo + * @description 此接口用于获取发起支付宝认证需要的[初始化参数 AuthInfo](https://opendocs.alipay.com/open/218/105325)。 + **/ + public GetAlipayAuthInfoRespDto getAlipayAuthInfo(GetAlipayAuthinfoDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/get-alipay-authinfo"); config.setBody(reqDto); config.setMethod("GET"); String response = request(config); return deserialize(response, GetAlipayAuthInfoRespDto.class); -} -/** - * @summary 生成用于登录的二维码 - * @description 生成用于登录的二维码,目前支持生成微信公众号扫码登录、小程序扫码登录、自建移动 APP 扫码登录的二维码。 - **/ -public GeneQRCodeRespDto geneQrCode(GenerateQrcodeDto reqDto) { + } + + /** + * @summary 生成用于登录的二维码 + * @description 生成用于登录的二维码,目前支持生成微信公众号扫码登录、小程序扫码登录、自建移动 APP 扫码登录的二维码。 + **/ + public GeneQRCodeRespDto geneQrCode(GenerateQrcodeDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/gene-qrcode"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, GeneQRCodeRespDto.class); -} -/** - * @summary 查询二维码状态 - * @description 按照用户扫码顺序,共分为未扫码、已扫码等待用户确认、用户同意/取消授权、二维码过期以及未知错误六种状态,前端应该通过不同的状态给到用户不同的反馈。你可以通过下面这篇文章了解扫码登录详细的流程:https://docs.authing.cn/v2/concepts/how-qrcode-works.html. - **/ -public CheckQRCodeStatusRespDto checkQrCodeStatus(CheckQrcodeStatusDto reqDto) { + } + + /** + * @summary 查询二维码状态 + * @description + * 按照用户扫码顺序,共分为未扫码、已扫码等待用户确认、用户同意/取消授权、二维码过期以及未知错误六种状态,前端应该通过不同的状态给到用户不同的反馈。你可以通过下面这篇文章了解扫码登录详细的流程:https://docs.authing.cn/v2/concepts/how-qrcode-works.html. + **/ + public CheckQRCodeStatusRespDto checkQrCodeStatus(CheckQrcodeStatusDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/check-qrcode-status"); config.setBody(reqDto); config.setMethod("GET"); String response = request(config); return deserialize(response, CheckQRCodeStatusRespDto.class); -} -/** - * @summary 使用二维码 ticket 换取 TokenSet - * @description - * 此端点为使用二维码的 ticket 换取用户的 `access_token` 和 `id_token`。 - * - * - * 注意事项:取决于你在 Authing 创建应用时选择的**应用类型**和应用配置的**换取 token 身份验证方式**,在调用此接口时需要对客户端的身份进行不同形式的验证。 - * - *
- * 点击展开详情 - * - *
- * - * 你可以在 [Authing 控制台](https://console.authing.cn) 的**应用** - **自建应用** - **应用详情** - **应用配置** - **其他设置** - **授权配置** - * 中找到**换取 token 身份验证方式** 配置项: - * - * > 单页 Web 应用和客户端应用隐藏,默认为 `none`,不允许修改;后端应用和标准 Web 应用可以修改此配置项。 - * - * ![](https://files.authing.co/api-explorer/tokenAuthMethod.jpg) - * - * #### 换取 token 身份验证方式为 none 时 - * - * 调用此接口不需要进行额外操作。 - * - * #### 换取 token 身份验证方式为 client_secret_post 时 - * - * 调用此接口时必须在 body 中传递 `client_id` 和 `client_secret` 参数,作为验证客户端身份的条件。其中 `client_id` 为应用 ID、`client_secret` 为应用密钥。 - * - * #### 换取 token 身份验证方式为 client_secret_basic 时 - * - * 调用此接口时必须在 HTTP 请求头中携带 `authorization` 请求头,作为验证客户端身份的条件。`authorization` 请求头的格式如下(其中 `client_id` 为应用 ID、`client_secret` 为应用密钥。): - * - * ``` - * Basic base64(:) - * ``` - * - * 结果示例: - * - * ``` - * Basic NjA2M2ZiMmYzY3h4eHg2ZGY1NWYzOWViOjJmZTdjODdhODFmODY3eHh4eDAzMjRkZjEyZGFlZGM3 - * ``` - * - * JS 代码示例: - * - * ```js - * 'Basic ' + Buffer.from(client_id + ':' + client_secret).toString('base64'); - * ``` - * - *
- * - * - **/ -public LoginTokenRespDto exchangeTokenSetWithQrCodeTicket(ExchangeTokenSetWithQRcodeTicketDto reqDto) { + } + + /** + * @summary 使用二维码 ticket 换取 TokenSet + * @description 此端点为使用二维码的 ticket 换取用户的 `access_token` 和 `id_token`。 + *

+ *

+ * 注意事项:取决于你在 Authing 创建应用时选择的**应用类型**和应用配置的**换取 token 身份验证方式**,在调用此接口时需要对客户端的身份进行不同形式的验证。 + * + *

+ * 点击展开详情 + * + *
+ *

+ * 你可以在 [Authing 控制台](https://console.authing.cn) 的**应用** - **自建应用** - **应用详情** - **应用配置** - + * **其他设置** - **授权配置** 中找到**换取 token 身份验证方式** 配置项: + *

+ * > 单页 Web 应用和客户端应用隐藏,默认为 `none`,不允许修改;后端应用和标准 Web 应用可以修改此配置项。 + *

+ * ![](https://files.authing.co/api-explorer/tokenAuthMethod.jpg) + *

+ * #### 换取 token 身份验证方式为 none 时 + *

+ * 调用此接口不需要进行额外操作。 + *

+ * #### 换取 token 身份验证方式为 client_secret_post 时 + *

+ * 调用此接口时必须在 body 中传递 `client_id` 和 `client_secret` 参数,作为验证客户端身份的条件。其中 `client_id` 为应用 + * ID、`client_secret` 为应用密钥。 + *

+ * #### 换取 token 身份验证方式为 client_secret_basic 时 + *

+ * 调用此接口时必须在 HTTP 请求头中携带 `authorization` 请求头,作为验证客户端身份的条件。`authorization` 请求头的格式如下(其中 `client_id` + * 为应用 ID、`client_secret` 为应用密钥。): + *

+ * ``` Basic base64(:) ``` + *

+ * 结果示例: + *

+ * ``` Basic NjA2M2ZiMmYzY3h4eHg2ZGY1NWYzOWViOjJmZTdjODdhODFmODY3eHh4eDAzMjRkZjEyZGFlZGM3 ``` + *

+ * JS 代码示例: + *

+ * ```js 'Basic ' + Buffer.from(client_id + ':' + client_secret).toString('base64'); ``` + * + *

+ **/ + public LoginTokenRespDto exchangeTokenSetWithQrCodeTicket( + ExchangeTokenSetWithQRcodeTicketDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/exchange-tokenset-with-qrcode-ticket"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, LoginTokenRespDto.class); -} -/** - * @summary 自建 APP 扫码登录:APP 端修改二维码状态 - * @description 此端点用于在自建 APP 扫码登录中修改二维码状态,对应着在浏览器渲染出二维码之后,终端用户扫码、确认授权、取消授权的过程。**此接口要求具备用户的登录态**。 - **/ -public CommonResponseDto changeQrCodeStatus(ChangeQRCodeStatusDto reqDto) { + } + + /** + * @summary 自建 APP 扫码登录:APP 端修改二维码状态 + * @description 此端点用于在自建 APP 扫码登录中修改二维码状态,对应着在浏览器渲染出二维码之后,终端用户扫码、确认授权、取消授权的过程。**此接口要求具备用户的登录态**。 + **/ + public CommonResponseDto changeQrCodeStatus(ChangeQRCodeStatusDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/change-qrcode-status"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, CommonResponseDto.class); -} -/** - * @summary 发送短信 - * @description 发送短信时必须指定短信 Channel,每个手机号同一 Channel 在一分钟内只能发送一次。 - **/ -public SendSMSRespDto sendSms(SendSMSDto reqDto) { + } + + /** + * @summary 推送登录 + * @description 推送登录。 + **/ + public GenePushCodeRespDto signInByPush(SignInByPushDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/signin-by-push"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, GenePushCodeRespDto.class); + } + + /** + * @summary 查询推送码状态 + * @description 按照推送码使用顺序,共分为已推送、等待用户 同意/取消 授权、推送码过期以及未知错误五种状态,前端应该通过不同的状态给到用户不同的反馈。 + **/ + public CheckPushCodeStatusRespDto checkPushCodeStatus(CheckPushcodeStatusDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/check-pushcode-status"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, CheckPushCodeStatusRespDto.class); + } + + /** + * @summary 推送登录:APP 端修改推送码状态 + * @description 此端点用于在 Authing 令牌 APP + * 推送登录中修改推送码状态,对应着在浏览器使用推送登录,点击登录之后,终端用户收到推送登录信息,确认授权、取消授权的过程。**此接口要求具备用户的登录态**。 + **/ + public CommonResponseDto changePushCodeStatus(ChangePushCodeStatusDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/change-pushcode-status"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 注册 + * @description 此端点目前支持以下几种基于的注册方式: + *

+ * 1. 基于密码(PASSWORD):用户名 + 密码,邮箱 + 密码。 2. 基于一次性临时验证码(PASSCODE):手机号 + 验证码,邮箱 + + * 验证码。你需要先调用发送短信或者发送邮件接口获取验证码。 + *

+ * 社会化登录等使用外部身份源“注册”请直接使用**登录**接口,我们会在其第一次登录的时候为其创建一个新账号。 + **/ + public UserSingleRespDto signUp(SignUpDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/signup"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, UserSingleRespDto.class); + } + + /** + * @summary 发送短信 + * @description 发送短信时必须指定短信 Channel,每个手机号同一 Channel 在一分钟内只能发送一次。 + **/ + public SendSMSRespDto sendSms(SendSMSDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/send-sms"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, SendSMSRespDto.class); -} -/** - * @summary 发送邮件 - * @description 发送邮件时必须指定邮件 Channel,每个邮箱同一 Channel 在一分钟内只能发送一次。 - **/ -public SendEmailRespDto sendEmail(SendEmailDto reqDto) { + } + + /** + * @summary 发送邮件 + * @description 发送邮件时必须指定邮件 Channel,每个邮箱同一 Channel 在一分钟内只能发送一次。 + **/ + public SendEmailRespDto sendEmail(SendEmailDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/send-email"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, SendEmailRespDto.class); -} -/** - * @summary 获取用户资料 - * @description 此端点用户获取用户资料,需要在请求头中带上用户的 `access_token`,Authing 服务器会根据用户 `access_token` 中的 `scope` 返回对应的字段。 - **/ -public UserSingleRespDto getProfile(GetProfileDto reqDto) { + } + + /** + * @summary 解密微信小程序数据 + * @description 解密微信小程序数据 + **/ + public DecryptWechatMiniProgramDataRespDto decryptWechatMiniProgramData( + DecryptWechatMiniProgramDataDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/decrypt-wechat-miniprogram-data"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, DecryptWechatMiniProgramDataRespDto.class); + } + + /** + * @summary 获取微信小程序、公众号 Access Token + * @description 获取 Authing 服务器缓存的微信小程序、公众号 Access Token + **/ + public GetWechatAccessTokenRespDto getWechatMpAccessToken(GetWechatAccessTokenDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-wechat-access-token"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, GetWechatAccessTokenRespDto.class); + } + + /** + * @summary 获取登录日志 + * @description 获取登录日志 + **/ + public GetLoginHistoryRespDto getLoginHistory(GetMyLoginHistoryDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-my-login-history"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetLoginHistoryRespDto.class); + } + + /** + * @summary 获取登录应用 + * @description 获取登录应用 + **/ + public GetLoggedInAppsRespDto getLoggedInApps() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-my-logged-in-apps"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetLoggedInAppsRespDto.class); + } + + /** + * @summary 获取具备访问权限的应用 + * @description 获取具备访问权限的应用 + **/ + public GetAccessibleAppsRespDto getAccessibleApps() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-my-accessible-apps"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetAccessibleAppsRespDto.class); + } + + /** + * @summary 获取租户列表 + * @description 获取租户列表 + **/ + public GetTenantListRespDto getTenantList() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-my-tenant-list"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetTenantListRespDto.class); + } + + /** + * @summary 获取角色列表 + * @description 获取角色列表 + **/ + public RoleListRespDto getRoleList(GetMyRoleListDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-my-role-list"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, RoleListRespDto.class); + } + + /** + * @summary 获取分组列表 + * @description 获取分组列表 + **/ + public GroupListRespDto getGroupList() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-my-group-list"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GroupListRespDto.class); + } + + /** + * @summary 获取部门列表 + * @description 此接口用于获取用户的部门列表,可根据一定排序规则进行排序。 + **/ + public UserDepartmentPaginatedRespDto getDepartmentList(GetMyDepartmentListDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-my-department-list"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, UserDepartmentPaginatedRespDto.class); + } + + /** + * @summary 获取被授权的资源列表 + * @description 此接口用于获取用户被授权的资源列表。 + **/ + public AuthorizedResourcePaginatedRespDto getAuthorizedResources( + GetMyAuthorizedResourcesDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-my-authorized-resources"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, AuthorizedResourcePaginatedRespDto.class); + } + + /** + * @summary 获取用户资料 + * @description 此端点用户获取用户资料,需要在请求头中带上用户的 `access_token`,Authing 服务器会根据用户 `access_token` 中的 `scope` + * 返回对应的字段。 + **/ + public UserSingleRespDto getProfile(GetProfileDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/get-profile"); config.setBody(reqDto); config.setMethod("GET"); String response = request(config); return deserialize(response, UserSingleRespDto.class); -} -/** - * @summary 修改用户资料 - * @description 此接口用于修改用户的用户资料,包含用户的自定义数据。如果需要**修改邮箱**、**修改手机号**、**修改密码**,请使用对应的单独接口。 - **/ -public UserSingleRespDto updateProfile(UpdateUserProfileDto reqDto) { + } + + /** + * @summary 修改用户资料 + * @description 此接口用于修改用户的用户资料,包含用户的自定义数据。如果需要**修改邮箱**、**修改手机号**、**修改密码**,请使用对应的单独接口。 + **/ + public UserSingleRespDto updateProfile(UpdateUserProfileDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/update-profile"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, UserSingleRespDto.class); -} -/** - * @summary 绑定邮箱 - * @description 如果用户还**没有绑定邮箱**,此接口可用于用户**自主**绑定邮箱。如果用户已经绑定邮箱想要修改邮箱,请使用**修改邮箱**接口。你需要先调用**发送邮件**接口发送邮箱验证码。 - **/ -public CommonResponseDto bindEmail(BindEmailDto reqDto) { + } + + /** + * @summary 绑定邮箱 + * @description + * 如果用户还**没有绑定邮箱**,此接口可用于用户**自主**绑定邮箱。如果用户已经绑定邮箱想要修改邮箱,请使用**修改邮箱**接口。你需要先调用**发送邮件**接口发送邮箱验证码。 + **/ + public CommonResponseDto bindEmail(BindEmailDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/bind-email"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, CommonResponseDto.class); -} -/** - * @summary 解绑邮箱 - * @description 用户解绑邮箱,如果用户没有绑定其他登录方式(手机号、社会化登录账号),将无法解绑邮箱,会提示错误。 - **/ -public CommonResponseDto unbindEmail(UnbindEmailDto reqDto) { + } + + /** + * @summary 解绑邮箱 + * @description 用户解绑邮箱,如果用户没有绑定其他登录方式(手机号、社会化登录账号),将无法解绑邮箱,会提示错误。 + **/ + public CommonResponseDto unbindEmail(UnbindEmailDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/unbind-email"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, CommonResponseDto.class); -} -/** - * @summary 绑定手机号 - * @description 如果用户还**没有绑定手机号**,此接口可用于用户**自主**绑定手机号。如果用户已经绑定手机号想要修改手机号,请使用**修改手机号**接口。你需要先调用**发送短信**接口发送短信验证码。 - **/ -public CommonResponseDto bindPhone(BindPhoneDto reqDto) { + } + + /** + * @summary 绑定手机号 + * @description + * 如果用户还**没有绑定手机号**,此接口可用于用户**自主**绑定手机号。如果用户已经绑定手机号想要修改手机号,请使用**修改手机号**接口。你需要先调用**发送短信**接口发送短信验证码。 + **/ + public CommonResponseDto bindPhone(BindPhoneDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/bind-phone"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, CommonResponseDto.class); -} -/** - * @summary 解绑手机号 - * @description 用户解绑手机号,如果用户没有绑定其他登录方式(邮箱、社会化登录账号),将无法解绑手机号,会提示错误。 - **/ -public CommonResponseDto unbindPhone(UnbindPhoneDto reqDto) { + } + + /** + * @summary 解绑手机号 + * @description 用户解绑手机号,如果用户没有绑定其他登录方式(邮箱、社会化登录账号),将无法解绑手机号,会提示错误。 + **/ + public CommonResponseDto unbindPhone(UnbindPhoneDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/unbind-phone"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, CommonResponseDto.class); -} -/** - * @summary 获取密码强度和账号安全等级评分 - * @description 获取用户的密码强度和账号安全等级评分,需要在请求头中带上用户的 `access_token`。 - **/ -public GetSecurityInfoRespDto getSecurityLevel() { + } + + /** + * @summary 获取密码强度和账号安全等级评分 + * @description 获取用户的密码强度和账号安全等级评分,需要在请求头中带上用户的 `access_token`。 + **/ + public GetSecurityInfoRespDto getSecurityLevel() { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/get-security-info"); config.setBody(new Object()); config.setMethod("GET"); String response = request(config); return deserialize(response, GetSecurityInfoRespDto.class); -} -/** - * @summary 修改密码 - * @description 此端点用于用户自主修改密码,如果用户之前已经设置密码,需要提供用户的原始密码作为凭证。如果用户忘记了当前密码,请使用**忘记密码**接口。 - **/ -public CommonResponseDto updatePassword(UpdatePasswordDto reqDto) { + } + + /** + * @summary 修改密码 + * @description 此端点用于用户自主修改密码,如果用户之前已经设置密码,需要提供用户的原始密码作为凭证。如果用户忘记了当前密码,请使用**忘记密码**接口。 + **/ + public CommonResponseDto updatePassword(UpdatePasswordDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/update-password"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, CommonResponseDto.class); -} -/** - * @summary 发起修改邮箱的验证请求 - * @description 终端用户自主修改邮箱时,需要提供相应的验证手段。此接口用于验证用户的修改邮箱请求是否合法。当前支持通过**邮箱验证码**的方式进行验证,你需要先调用发送邮件接口发送对应的邮件验证码。 - **/ -public VerifyUpdateEmailRequestRespDto verifyUpdateEmailRequest(VerifyUpdateEmailRequestDto reqDto) { + } + + /** + * @summary 发起修改邮箱的验证请求 + * @description + * 终端用户自主修改邮箱时,需要提供相应的验证手段。此接口用于验证用户的修改邮箱请求是否合法。当前支持通过**邮箱验证码**的方式进行验证,你需要先调用发送邮件接口发送对应的邮件验证码。 + **/ + public VerifyUpdateEmailRequestRespDto verifyUpdateEmailRequest( + VerifyUpdateEmailRequestDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/verify-update-email-request"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, VerifyUpdateEmailRequestRespDto.class); -} -/** - * @summary 修改邮箱 - * @description 终端用户自主修改邮箱,需要提供相应的验证手段,见[发起修改邮箱的验证请求](#tag/用户资料/修改邮箱/operation/ProfileV3Controller_updateEmailVerification)。 - * 此参数需要提供一次性临时凭证 `updateEmailToken`,此数据需要从**发起修改邮箱的验证请求**接口获取。 - **/ -public CommonResponseDto updateEmail(UpdateEmailDto reqDto) { + } + + /** + * @summary 修改邮箱 + * @description + * 终端用户自主修改邮箱,需要提供相应的验证手段,见[发起修改邮箱的验证请求](#tag/用户资料/API%20列表/operation/ProfileV3Controller_verifyUpdateEmailRequest)。 + * 此参数需要提供一次性临时凭证 `updateEmailToken`,此数据需要从**发起修改邮箱的验证请求**接口获取。 + **/ + public CommonResponseDto updateEmail(UpdateEmailDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/update-email"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, CommonResponseDto.class); -} -/** - * @summary 发起修改手机号的验证请求 - * @description 终端用户自主修改手机号时,需要提供相应的验证手段。此接口用于验证用户的修改手机号请求是否合法。当前支持通过**短信验证码**的方式进行验证,你需要先调用发送短信接口发送对应的短信验证码。 - **/ -public VerifyUpdatePhoneRequestRespDto verifyUpdatePhoneRequest(VerifyUpdatePhoneRequestDto reqDto) { + } + + /** + * @summary 发起修改手机号的验证请求 + * @description + * 终端用户自主修改手机号时,需要提供相应的验证手段。此接口用于验证用户的修改手机号请求是否合法。当前支持通过**短信验证码**的方式进行验证,你需要先调用发送短信接口发送对应的短信验证码。 + **/ + public VerifyUpdatePhoneRequestRespDto verifyUpdatePhoneRequest( + VerifyUpdatePhoneRequestDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/verify-update-phone-request"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, VerifyUpdatePhoneRequestRespDto.class); -} -/** - * @summary 修改手机号 - * @description 终端用户自主修改手机号,需要提供相应的验证手段,见[发起修改手机号的验证请求](#tag/用户资料/修改邮箱/operation/ProfileV3Controller_updatePhoneVerification)。 - * 此参数需要提供一次性临时凭证 `updatePhoneToken`,此数据需要从**发起修改手机号的验证请求**接口获取。 - **/ -public CommonResponseDto updatePhone(UpdatePhoneDto reqDto) { + } + + /** + * @summary 修改手机号 + * @description + * 终端用户自主修改手机号,需要提供相应的验证手段,见[发起修改手机号的验证请求](#tag/用户资料/API%20列表/operation/ProfileV3Controller_updatePhoneVerification)。 + * 此参数需要提供一次性临时凭证 `updatePhoneToken`,此数据需要从**发起修改手机号的验证请求**接口获取。 + **/ + public CommonResponseDto updatePhone(UpdatePhoneDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/update-phone"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, CommonResponseDto.class); -} -/** - * @summary 发起忘记密码请求 - * @description 当用户忘记密码时,可以通过此端点找回密码。用户需要使用相关验证手段进行验证,目前支持**邮箱验证码**和**手机号验证码**两种验证手段。 - **/ -public PasswordResetVerifyResp verifyResetPasswordRequest(VerifyResetPasswordRequestDto reqDto) { + } + + /** + * @summary 发起忘记密码请求 + * @description 当用户忘记密码时,可以通过此端点找回密码。用户需要使用相关验证手段进行验证,目前支持**邮箱验证码**和**手机号验证码**两种验证手段。 + **/ + public PasswordResetVerifyResp verifyResetPasswordRequest(VerifyResetPasswordRequestDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/verify-reset-password-request"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, PasswordResetVerifyResp.class); -} -/** - * @summary 忘记密码 - * @description 此端点用于用户忘记密码之后,通过**手机号验证码**或者**邮箱验证码**的方式重置密码。此接口需要提供用于重置密码的临时凭证 `passwordResetToken`,此参数需要通过**发起忘记密码请求**接口获取。 - **/ -public IsSuccessRespDto resetPassword(ResetPasswordDto reqDto) { + } + + /** + * @summary 忘记密码 + * @description 此端点用于用户忘记密码之后,通过**手机号验证码**或者**邮箱验证码**的方式重置密码。此接口需要提供用于重置密码的临时凭证 + * `passwordResetToken`,此参数需要通过**发起忘记密码请求**接口获取。 + **/ + public IsSuccessRespDto resetPassword(ResetPasswordDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/reset-password"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, IsSuccessRespDto.class); -} -/** - * @summary 发起注销账号请求 - * @description 当用户希望注销账号时,需提供相应凭证,当前支持**使用邮箱验证码**、使用**手机验证码**、**使用密码**三种验证方式。 - **/ -public VerifyDeleteAccountRequestRespDto verifyDeleteAccountRequest(VerifyDeleteAccountRequestDto reqDto) { + } + + /** + * @summary 发起注销账号请求 + * @description 当用户希望注销账号时,需提供相应凭证,当前支持**使用邮箱验证码**、使用**手机验证码**、**使用密码**三种验证方式。 + **/ + public VerifyDeleteAccountRequestRespDto verifyDeleteAccountRequest( + VerifyDeleteAccountRequestDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/verify-delete-account-request"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, VerifyDeleteAccountRequestRespDto.class); -} -/** - * @summary 注销账户 - * @description 此端点用于用户自主注销账号,需要提供用于注销账号的临时凭证 deleteAccountToken,此参数需要通过**发起注销账号请求**接口获取。 - **/ -public IsSuccessRespDto deleteAccount(DeleteAccounDto reqDto) { + } + + /** + * @summary 注销账户 + * @description 此端点用于用户自主注销账号,需要提供用于注销账号的临时凭证 deleteAccountToken,此参数需要通过**发起注销账号请求**接口获取。 + **/ + public IsSuccessRespDto deleteAccount(DeleteAccounDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/delete-account"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, IsSuccessRespDto.class); -} -/** - * @summary 获取服务器公开信息 - * @description 可端点可获取服务器的公开信息,如 RSA256 公钥、SM2 公钥、Authing 服务版本号等。 - **/ -public SystemInfoResp getSystemInfo() { + } + + /** + * @summary 获取服务器公开信息 + * @description 可端点可获取服务器的公开信息,如 RSA256 公钥、SM2 公钥、Authing 服务版本号等。 + **/ + public SystemInfoResp getSystemInfo() { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/system"); config.setBody(new Object()); config.setMethod("GET"); String response = request(config); return deserialize(response, SystemInfoResp.class); -} -/** - * @summary 获取国家列表 - * @description 动态获取国家列表,可以用于前端登录页面国家选择和国际短信输入框选择,以减少前端静态资源体积。 - **/ -public GetCountryListRespDto getCountryList() { + } + + /** + * @summary 获取国家列表 + * @description 动态获取国家列表,可以用于前端登录页面国家选择和国际短信输入框选择,以减少前端静态资源体积。 + **/ + public GetCountryListRespDto getCountryList() { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/get-country-list"); config.setBody(new Object()); config.setMethod("GET"); String response = request(config); return deserialize(response, GetCountryListRespDto.class); -} -/** - * @summary 预检验验证码是否正确 - * @description 预检测验证码是否有效,此检验不会使得验证码失效。 - **/ -public PreCheckCodeRespDto preCheckCode(PreCheckCodeDto reqDto) { + } + + /** + * @summary 字符串类型资源鉴权 + * @description 字符串类型资源鉴权,支持用户对一个或者多个字符串资源进行权限判断 + **/ + public CheckResourcePermissionsRespDto checkPermissionByStringResource( + CheckPermissionStringResourceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/check-permission-string-resource"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CheckResourcePermissionsRespDto.class); + } + + /** + * @summary 数组类型资源鉴权 + * @description 数组类型资源鉴权,支持用户对一个或者多个数组资源进行权限判断 + **/ + public CheckResourcePermissionsRespDto checkPermissionByArrayResource( + CheckPermissionArrayResourceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/check-permission-array-resource"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CheckResourcePermissionsRespDto.class); + } + + /** + * @summary 树类型资源鉴权 + * @description 树类型资源鉴权,支持用户对一个或者多个树资源进行权限判断 + **/ + public CheckResourcePermissionsRespDto checkPermissionByTreeResource( + CheckPermissionTreeResourceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/check-permission-tree-resource"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CheckResourcePermissionsRespDto.class); + } + + /** + * @summary 获取用户在登录应用下被授权资源列表 + * @description 获取用户指定资源权限列表,用户获取在某个应用下所拥有的资源列表。 + **/ + public GetUserAuthResourceListRespDto getUserAuthorizedResourcesList() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-auth-resource-list"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetUserAuthResourceListRespDto.class); + } + + /** + * @summary 获取用户指定资源权限列表 + * @description 获取用户指定资源的权限列表, 用户获取某个应用下指定资源的权限列表。 + **/ + public GetUserAuthResourcePermissionListRespDto getUserAuthResourcePermissionList( + GetUserAuthResourcePermissionListDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-auth-resource-permission-list"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, GetUserAuthResourcePermissionListRespDto.class); + } + + /** + * @summary 获取用户授权资源的结构列表 + * @description 获取用户授权的资源列表,用户获取某个应用下的某个资源所授权的结构列表,通过不同的资源类型返回对应资源的授权列表。 + **/ + public GetUserAuthResourceStructRespDto getUserAuthResourceStruct( + GetUserAuthResourceStructDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-auth-resource-struct"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, GetUserAuthResourceStructRespDto.class); + } + + /** + * @summary 获取 WebAuthn 认证请求初始化参数 + * @description 获取 WebAuthn 认证请求初始化参数 + **/ + public GetAuthenticationOptionsRespDto initAuthenticationOptions() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/webauthn/authentication"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetAuthenticationOptionsRespDto.class); + } + + /** + * @summary 验证 WebAuthn 认证请求凭证 + * @description 验证 WebAuthn 认证请求凭证 + **/ + public VerifyAuthenticationResultRespDto verifyAuthentication(VerifyAuthenticationDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/webauthn/authentication"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, VerifyAuthenticationResultRespDto.class); + } + + /** + * @summary 获取 webauthn 凭证创建初始化参数 + * @description 获取 webauthn 凭证创建初始化参数。此接口要求具备用户的登录态** + **/ + public GetRegistrationOptionsRespDto initRegisterOptions() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/webauthn/registration"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetRegistrationOptionsRespDto.class); + } + + /** + * @summary 验证 webauthn 绑定注册认证器凭证 + * @description 验证 webauthn 绑定注册认证器凭证 + **/ + public VerifyRegistrationResultRespDto verifyRegister(VerifyRegistrationDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/webauthn/registration"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, VerifyRegistrationResultRespDto.class); + } + + /** + * @summary 微信移动端登录 + * @description 移动端应用:使用微信作为外部身份源登录。 + **/ + public LoginTokenResponseDataDto authByCodeIdentity(WechatMobileAuthByCodeIdentityInput reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v2/ecConn/wechatMobile/authByCodeIdentity"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, LoginTokenResponseDataDto.class); + } + + /** + * @summary 微信移动端:使用身份源中用户信息 + * @description 询问绑定开启时:绑定到外部身份源,根据外部身份源中的用户信息创建用户后绑定到当前身份源并登录。 + **/ + public WechatLoginTokenRespDto registerNewUser(BindByRegiserInputApi reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v2/ecConn/wechatMobile/register"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, WechatLoginTokenRespDto.class); + } + + /** + * @summary 微信移动端:邮箱验证码模式 + * @description 询问绑定开启时:绑定到外部身份源,根据输入的邮箱验证用户信息,找到对应的用户后绑定到当前身份源并登录;找不到时报错“用户不存在”。 + **/ + public WechatLoginTokenRespDto bindByEmailCode(BindByEmailCodeInputApi reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v2/ecConn/wechatMobile/byEmailCode"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, WechatLoginTokenRespDto.class); + } + + /** + * @summary 微信移动端:手机号验证码模式 + * @description 询问绑定开启时:绑定到外部身份源,根据输入的手机验证用户信息,找到对应的用户后绑定到当前身份源并登录;找不到时报错“用户不存在”。 + **/ + public WechatLoginTokenRespDto bindByPhoneCode(BindByPhoneCodeInputApi reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v2/ecConn/wechatMobile/byPhoneCode"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, WechatLoginTokenRespDto.class); + } + + /** + * @summary 微信移动端:账号密码模式 + * @description 询问绑定开启时:绑定到外部身份源,根据输入的账号(用户名/手机号/邮箱)密码验证用户信息,找到对应的用户后绑定到当前身份源并登录;找不到时报错“用户不存在”。 + **/ + public WechatLoginTokenRespDto bindByAccount(BindByAccountInputApi reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v2/ecConn/wechatMobile/byAccount"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, WechatLoginTokenRespDto.class); + } + + /** + * @summary 微信移动端:多账号场景 + * @description 询问绑定开启时:根据选择的账号绑定外部身份源,根据输入的账号 ID 验证用户信息,找到对应的用户后绑定到当前身份源并登录;找不到时报错“用户不存在”。 + **/ + public WechatLoginTokenRespDto selectAccount(BindByAccountsInputApi reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v2/ecConn/wechatMobile/select"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, WechatLoginTokenRespDto.class); + } + + /** + * @summary 微信移动端:账号 ID 模式 + * @description 询问绑定开启时:绑定到外部身份源,根据输入的账号 ID 验证用户信息,找到对应的用户后绑定到当前身份源并登录;找不到时报错“用户不存在”。 + **/ + public WechatLoginTokenRespDto bindByAccountId(BindByAccountIdInputApi reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v2/ecConn/wechatMobile/byAccountId"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, WechatLoginTokenRespDto.class); + } + + /** + * @summary 获取推送登录请求关联的客户端应用 + * @description 此端点用于在 Authing 令牌 APP 收到推送登录通知时,可检查当前用户登录的应用是否支持对推送登录请求进行授权。 + **/ + public GetPushCodeRelationAppsRespDto getPushLoginRelationApps( + GetPushCodeRelationAppsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-pushlogin-relation-apps"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, GetPushCodeRelationAppsRespDto.class); + } + + /** + * @summary 获取快速认证二维码数据 + * @description 此端点用于在用户个人中心,获取快速认证参数生成二维码,可使用 Authing 令牌 APP 扫码,完成快速认证。**此接口要求具备用户的登录态**。 + **/ + public GeneFastpassQRCodeRespDto geneFastpassQrcodeInfo(SignInFastpassDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/gene-fastpass-qrcode-info"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, GeneFastpassQRCodeRespDto.class); + } + + /** + * @summary 获取快速认证的应用列表 + * @description 此端点用于使用 Authing 令牌 APP 扫「用户个人中心」-「快速认证」二维码后,拉取可快速认证的客户端应用列表。 + **/ + public GetFastpassQRCodeRelationAppsRespDto getFastpassParams(GetFastpassClientAppsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-fastpass-client-apps"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetFastpassQRCodeRelationAppsRespDto.class); + } + + /** + * @summary 查询个人中心「快速认证二维码」的状态 + * @description 按照用户扫码顺序,共分为未扫码、已扫码、已登录、二维码过期以及未知错误五种状态,前端应该通过不同的状态给到用户不同的反馈。 + **/ + public CheckQRCodeStatusRespDto getQrCodeStatus(GetAppLoginQrcodeStatusDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-app-login-qrcode-status"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, CheckQRCodeStatusRespDto.class); + } + + /** + * @summary APP 端扫码登录 + * @description 此端点用于在授权使 APP 成功扫码登录中,对应着在「个人中心」-「快速认证」页面渲染出二维码,终端用户扫码并成功登录的过程。 + **/ + public LoginTokenRespDto qrCodeAppLogin(AppQRCodeLoginDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/qrcode-app-login"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, LoginTokenRespDto.class); + } + + /** + * @summary 预检验验证码是否正确 + * @description 预检测验证码是否有效,此检验不会使得验证码失效。 + **/ + public PreCheckCodeRespDto preCheckCode(PreCheckCodeDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/pre-check-code"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, PreCheckCodeRespDto.class); -} -/** - * @summary 发起绑定 MFA 认证要素请求 - * @description 当用户未绑定某个 MFA 认证要素时,可以发起绑定 MFA 认证要素请求。不同类型的 MFA 认证要素绑定请求需要发送不同的参数,详细见 profile 参数。发起验证请求之后,Authing 服务器会根据相应的认证要素类型和传递的参数,使用不同的手段要求验证。此接口会返回 enrollmentToken,你需要在请求「绑定 MFA 认证要素」接口时带上此 enrollmentToken,并提供相应的凭证。 - **/ -public SendEnrollFactorRequestRespDto sendEnrollFactorRequest(SendEnrollFactorRequestDto reqDto) { + } + + /** + * + **/ + public Object listCredentialsByPage(ListDeviceCredentialDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/webauthn/page-authenticator-device"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, Object.class); + } + + /** + * + **/ + public Object checkValidCredentialsByCredIds(CheckDeviceCredentialIdDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/webauthn/check-valid-credentials-by-credIds"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, Object.class); + } + + /** + * + **/ + public Object removeAllCredentials(RemoveDeviceCredentialDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/webauthn/remove-credentials-by-authenticator-code"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, Object.class); + } + + /** + * + **/ + public Object removeCredential() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/webauthn/remove-credential/{credentialID}"); + + config.setMethod("POST"); + String response = request(config); + return deserialize(response, Object.class); + } + + /** + * + **/ + public Object authByCode(WechatMobileAuthByCodeInput reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v2/ecConn/wechatMobile/authByCode"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, Object.class); + } + + /** + * @summary 发起绑定 MFA 认证要素请求 + * @description 当用户未绑定某个 MFA 认证要素时,可以发起绑定 MFA 认证要素请求。不同类型的 MFA 认证要素绑定请求需要发送不同的参数,详细见 profile + * 参数。发起验证请求之后,Authing 服务器会根据相应的认证要素类型和传递的参数,使用不同的手段要求验证。此接口会返回 enrollmentToken,你需要在请求「绑定 MFA + * 认证要素」接口时带上此 enrollmentToken,并提供相应的凭证。 + **/ + public SendEnrollFactorRequestRespDto sendEnrollFactorRequest(SendEnrollFactorRequestDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/send-enroll-factor-request"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, SendEnrollFactorRequestRespDto.class); -} -/** - * @summary 绑定 MFA 认证要素 - * @description 绑定 MFA 要素。 - **/ -public EnrollFactorRespDto enrollFactor(EnrollFactorDto reqDto) { + } + + /** + * @summary 绑定 MFA 认证要素 + * @description 绑定 MFA 要素。 + **/ + public EnrollFactorRespDto enrollFactor(EnrollFactorDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/enroll-factor"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, EnrollFactorRespDto.class); -} -/** - * @summary 解绑 MFA 认证要素 - * @description 根据 Factor ID 解绑用户绑定的某个 MFA 认证要素。 - **/ -public ResetFactorRespDto resetFactor(ResetFactorDto reqDto) { + } + + /** + * @summary 解绑 MFA 认证要素 + * @description 根据 Factor ID 解绑用户绑定的某个 MFA 认证要素。 + **/ + public ResetFactorRespDto resetFactor(ResetFactorDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/reset-factor"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, ResetFactorRespDto.class); -} -/** - * @summary 获取绑定的所有 MFA 认证要素 - * @description Authing 目前支持四种类型的 MFA 认证要素:手机短信、邮件验证码、OTP、人脸。 - **/ -public ListEnrolledFactorsRespDto listEnrolledFactors() { + } + + /** + * @summary 获取绑定的所有 MFA 认证要素 + * @description Authing 目前支持四种类型的 MFA 认证要素:手机短信、邮件验证码、OTP、人脸。 + **/ + public ListEnrolledFactorsRespDto listEnrolledFactors() { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/list-enrolled-factors"); config.setBody(new Object()); config.setMethod("GET"); String response = request(config); return deserialize(response, ListEnrolledFactorsRespDto.class); -} -/** - * @summary 获取绑定的某个 MFA 认证要素 - * @description 根据 Factor ID 获取用户绑定的某个 MFA Factor 详情。 - **/ -public GetFactorRespDto getFactor(GetFactorDto reqDto) { + } + + /** + * @summary 获取绑定的某个 MFA 认证要素 + * @description 根据 Factor ID 获取用户绑定的某个 MFA Factor 详情。 + **/ + public GetFactorRespDto getFactor(GetFactorDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/get-factor"); config.setBody(reqDto); config.setMethod("GET"); String response = request(config); return deserialize(response, GetFactorRespDto.class); -} -/** - * @summary 获取可绑定的 MFA 认证要素 - * @description 获取所有应用已经开启、用户暂未绑定的 MFA 认证要素,用户可以从返回的列表中绑定新的 MFA 认证要素。 - **/ -public ListFactorsToEnrollRespDto listFactorsToEnroll() { + } + + /** + * @summary 获取可绑定的 MFA 认证要素 + * @description 获取所有应用已经开启、用户暂未绑定的 MFA 认证要素,用户可以从返回的列表中绑定新的 MFA 认证要素。 + **/ + public ListFactorsToEnrollRespDto listFactorsToEnroll() { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/list-factors-to-enroll"); config.setBody(new Object()); config.setMethod("GET"); String response = request(config); return deserialize(response, ListFactorsToEnrollRespDto.class); -} -/** - * @summary 校验用户 MFA 绑定的 OTP - * @description 校验用户 MFA 绑定的 OTP。 - **/ -public MfaOtpVerityRespDto mfaOtpVerify(MfaOtpVerityDto reqDto) { + } + + /** + * @summary 校验用户 MFA 绑定的 OTP + * @description 校验用户 MFA 绑定的 OTP。 + **/ + public MfaOtpVerityRespDto mfaOtpVerify(MfaOtpVerityDto reqDto) { AuthingRequestConfig config = new AuthingRequestConfig(); config.setUrl("/api/v3/mfa-totp-verify"); config.setBody(reqDto); config.setMethod("POST"); String response = request(config); return deserialize(response, MfaOtpVerityRespDto.class); -} -/** - * @summary 生成绑定外部身份源的链接 - * @description - * 此接口用于生成绑定外部身份源的链接,生成之后可以引导用户进行跳转。 - * - **/ -public GenerateBindExtIdpLinkRespDto generateLinkExtIdpUrl(GenerateLinkExtidpUrlDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/generate-link-extidp-url"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GenerateBindExtIdpLinkRespDto.class); -} -/** - * @summary 解绑外部身份源 - * @description 解绑外部身份源,此接口需要传递用户绑定的外部身份源 ID,**注意不是身份源连接 ID**。 - **/ -public CommonResponseDto unlinkExtIdp(UnlinkExtIdpDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/unlink-extidp"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CommonResponseDto.class); -} -/** - * @summary 获取绑定的外部身份源 - * @description - * 如在**介绍**部分中所描述的,一个外部身份源对应多个外部身份源连接,用户通过某个外部身份源连接绑定了某个外部身份源账号之后, - * 用户会建立一条与此外部身份源之间的关联关系。此接口用于获取此用户绑定的所有外部身份源。 - * - * 取决于外部身份源的具体实现,一个用户在外部身份源中,可能会有多个身份 ID,比如在微信体系中会有 `openid` 和 `unionid`,在非书中有 - * `open_id`、`union_id` 和 `user_id`。在 Authing 中,我们把这样的一条 `open_id` 或者 `unionid_` 叫做一条 `Identity`, 所以用户在一个身份源会有多条 `Identity` 记录。 - * - * 以微信为例,如果用户使用微信登录或者绑定了微信账号,他的 `Identity` 信息如下所示: - * - * ```json - * [ - * { - * "identityId": "62f20932xxxxbcc10d966ee5", - * "extIdpId": "62f209327xxxxcc10d966ee5", - * "provider": "wechat", - * "type": "openid", - * "userIdInIdp": "oH_5k5SflrwjGvk7wqpoBKq_cc6M", - * "originConnIds": ["62f2093244fa5cb19ff21ed3"] - * }, - * { - * "identityId": "62f726239xxxxe3285d21c93", - * "extIdpId": "62f209327xxxxcc10d966ee5", - * "provider": "wechat", - * "type": "unionid", - * "userIdInIdp": "o9Nka5ibU-lUGQaeAHqu0nOZyJg0", - * "originConnIds": ["62f2093244fa5cb19ff21ed3"] - * } - * ] - * ``` - * - * - * 可以看到他们的 `extIdpId` 是一样的,这个是你在 Authing 中创建的**身份源 ID**;`provider` 都是 `wechat`; - * 通过 `type` 可以区分出哪个是 `openid`,哪个是 `unionid`,以及具体的值(`userIdInIdp`);他们都来自于同一个身份源连接(`originConnIds`)。 - * - * - * - **/ - public GetIdentitiesRespDto getIdentities() { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-identities"); - config.setBody(new Object()); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetIdentitiesRespDto.class); - } - /** - * @summary 获取应用开启的外部身份源列表 - * @description 获取应用开启的外部身份源列表,前端可以基于此渲染外部身份源按钮。 - **/ - public GetExtIdpsRespDto getApplicationEnabledExtIdps() { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-application-enabled-extidps"); - config.setBody(new Object()); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetExtIdpsRespDto.class); - } - /** - * @summary 注册 - * @description - * 此端点目前支持以下几种基于的注册方式: - * - * 1. 基于密码(PASSWORD):用户名 + 密码,邮箱 + 密码。 - * 2. 基于一次性临时验证码(PASSCODE):手机号 + 验证码,邮箱 + 验证码。你需要先调用发送短信或者发送邮件接口获取验证码。 - * - * 社会化登录等使用外部身份源“注册”请直接使用**登录**接口,我们会在其第一次登录的时候为其创建一个新账号。 - * - **/ - public UserSingleRespDto signUp(SignUpDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/signup"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, UserSingleRespDto.class); - } - /** - * @summary 解密微信小程序数据 - * @description 解密微信小程序数据 - **/ - public DecryptWechatMiniProgramDataRespDto decryptWechatMiniProgramData(DecryptWechatMiniProgramDataDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/decrypt-wechat-miniprogram-data"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, DecryptWechatMiniProgramDataRespDto.class); - } - /** - * @summary 获取微信小程序、公众号 Access Token - * @description 获取 Authing 服务器缓存的微信小程序、公众号 Access Token - **/ - public GetWechatAccessTokenRespDto getWechatMpAccessToken(GetWechatAccessTokenDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-wechat-access-token"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, GetWechatAccessTokenRespDto.class); - } - /** - * @summary 获取登录日志 - * @description 获取登录日志 - **/ - public GetLoginHistoryRespDto getLoginHistory(GetMyLoginHistoryDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-my-login-history"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetLoginHistoryRespDto.class); - } - /** - * @summary 获取登录应用 - * @description 获取登录应用 - **/ - public GetLoggedInAppsRespDto getLoggedInApps() { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-my-logged-in-apps"); - config.setBody(new Object()); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetLoggedInAppsRespDto.class); - } - /** - * @summary 获取具备访问权限的应用 - * @description 获取具备访问权限的应用 - **/ - public GetAccessibleAppsRespDto getAccessibleApps() { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-my-accessible-apps"); - config.setBody(new Object()); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetAccessibleAppsRespDto.class); - } - /** - * @summary 获取租户列表 - * @description 获取租户列表 - **/ - public GetTenantListRespDto getTenantList() { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-my-tenant-list"); - config.setBody(new Object()); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetTenantListRespDto.class); - } - /** - * @summary 获取角色列表 - * @description 获取角色列表 - **/ - public RoleListRespDto getRoleList(GetMyRoleListDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-my-role-list"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, RoleListRespDto.class); - } - /** - * @summary 获取分组列表 - * @description 获取分组列表 - **/ - public GroupListRespDto getGroupList() { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-my-group-list"); - config.setBody(new Object()); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GroupListRespDto.class); - } - /** - * @summary 获取部门列表 - * @description 此接口用于获取用户的部门列表,可根据一定排序规则进行排序。 - **/ - public UserDepartmentPaginatedRespDto getDepartmentList(GetMyDepartmentListDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-my-department-list"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, UserDepartmentPaginatedRespDto.class); - } - /** - * @summary 获取被授权的资源列表 - * @description 此接口用于获取用户被授权的资源列表。 - **/ - public AuthorizedResourcePaginatedRespDto getAuthorizedResources(GetMyAuthorizedResourcesDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-my-authorized-resources"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, AuthorizedResourcePaginatedRespDto.class); - } - /** - * @summary 字符串类型资源鉴权 - * @description 字符串类型资源鉴权,支持用户对一个或者多个字符串资源进行权限判断 - **/ - public CheckResourcePermissionsRespDto checkPermissionByStringResource(CheckPermissionStringResourceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/check-permission-string-resource"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CheckResourcePermissionsRespDto.class); - } - /** - * @summary 数组类型资源鉴权 - * @description 数组类型资源鉴权,支持用户对一个或者多个数组资源进行权限判断 - **/ - public CheckResourcePermissionsRespDto checkPermissionByArrayResource(CheckPermissionArrayResourceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/check-permission-array-resource"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CheckResourcePermissionsRespDto.class); - } - /** - * @summary 树类型资源鉴权 - * @description 树类型资源鉴权,支持用户对一个或者多个树资源进行权限判断 - **/ - public CheckResourcePermissionsRespDto checkPermissionByTreeResource(CheckPermissionTreeResourceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/check-permission-tree-resource"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CheckResourcePermissionsRespDto.class); - } - /** - * @summary 获取用户在登录应用下被授权资源列表 - * @description 获取用户指定资源权限列表,用户获取在某个应用下所拥有的资源列表 - **/ - public GetUserAuthResourceListRespDto getUserAuthorizedResourcesList() { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-auth-resource-list"); - config.setBody(new Object()); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetUserAuthResourceListRespDto.class); - } - - /** - * @summary 获取用户在登录应用下被授权资源列表 - * @description 获取用户指定资源权限列表,用户获取在某个应用下所拥有的资源列表 - **/ - public GetUserAuthResourcePermissionListRespDto getUserAuthResourcePermissionList( - GetUserAuthResourcePermissionListDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-auth-resource-permission-list"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, GetUserAuthResourcePermissionListRespDto.class); - } - - /** - * @summary 获取用户在登录应用下被授权资源列表 - * @description 获取用户指定资源权限列表,用户获取在某个应用下所拥有的资源列表 - **/ - public GetUserAuthResourceStructRespDto getUserAuthResourceStruct( - GetUserAuthResourceStructDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-auth-resource-struct"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, GetUserAuthResourceStructRespDto.class); - } - + } // ==== AUTO GENERATED AUTHENTICATION METHODS END ==== diff --git a/src/main/java/cn/authing/sdk/java/client/ManagementClient.java b/src/main/java/cn/authing/sdk/java/client/ManagementClient.java index dbeabc5e..6b56b88e 100644 --- a/src/main/java/cn/authing/sdk/java/client/ManagementClient.java +++ b/src/main/java/cn/authing/sdk/java/client/ManagementClient.java @@ -12,3643 +12,4749 @@ public class ManagementClient extends BaseClient { - public ManagementClient(ManagementClientOptions options) { - super(options); - // 必要参数校验 - if (StrUtil.isBlank(options.getAccessKeyId())) { - throw new IllegalArgumentException("accessKeyId is required"); - } - if (StrUtil.isBlank(options.getAccessKeySecret())) { - throw new IllegalArgumentException("accessKeySecret is required"); - } - } - - public Object makeRequest(MakeRequestReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl(reqDto.getUrl()); - config.setBody(reqDto.getData()); - config.setMethod(reqDto.getMethod()); - String response = request(config); - return deserialize(response, Object.class); - } - - /** - * @summary 获取/搜索用户列表 - * @description 此接口用于获取用户列表,支持模糊搜索,以及通过用户基础字段、用户自定义字段、用户所在部门、用户历史登录应用等维度筛选用户。 - *

- * ### 模糊搜素示例 - *

- * 模糊搜索默认会从 `phone`, `email`, `name`, `username`, `nickname` 五个字段对用户进行模糊搜索,你也可以通过设置 - * `options.fuzzySearchOn` 决定模糊匹配的字段范围: - *

- * ```json { "keywords": "北京", "options": { "fuzzySearchOn": [ "address" ] } } ``` - *

- * ### 高级搜索示例 - *

- * 你可以通过 `advancedFilter` 进行高级搜索,高级搜索支持通过用户的基础信息、自定义数据、所在部门、用户来源、登录应用、外部身份源信息等维度对用户进行筛选。 - * **且这些筛选条件可以任意组合。** - *

- * #### 筛选状态为禁用的用户 - *

- * 用户状态(`status`)为字符串类型,可选值为 `Activated` 和 `Suspended`: - *

- * ```json { "advancedFilter": [ { "field": "status", "operator": "EQUAL", "value": "Suspended" - * } ] } ``` - *

- * #### 筛选邮箱中包含 `@example.com` 的用户 - *

- * 用户邮箱(`email`)为字符串类型,可以进行模糊搜索: - *

- * ```json { "advancedFilter": [ { "field": "email", "operator": "CONTAINS", "value": - * "@example.com" } ] } ``` - *

- * #### 根据用户的任意扩展字段进行搜索 - *

- * ```json { "advancedFilter": [ { "field": "some-custom-key", "operator": "EQUAL", "value": - * "some-value" } ] } ``` - *

- * #### 根据用户登录次数筛选 - *

- * 筛选登录次数大于 10 的用户: - *

- * ```json { "advancedFilter": [ { "field": "loginsCount", "operator": "GREATER", "value": 10 } - * ] } ``` - *

- * 筛选登录次数在 10 - 100 次的用户: - *

- * ```json { "advancedFilter": [ { "field": "loginsCount", "operator": "BETWEEN", "value": [10, - * 100] } ] } ``` - *

- * #### 根据用户上次登录时间进行筛选 - *

- * 筛选最近 7 天内登录过的用户: - *

- * ```json { "advancedFilter": [ { "field": "lastLoginTime", "operator": "GREATER", "value": new - * Date(Date.now() - 7 * 24 * 60 * 60 * 1000) } ] } ``` - *

- * 筛选在某一段时间内登录过的用户: - *

- * ```json { "advancedFilter": [ { "field": "lastLoginTime", "operator": "BETWEEN", "value": [ - * new Date(Date.now() - 14 * 24 * 60 * 60 * 1000), new Date(Date.now() - 7 * 24 * 60 * 60 * - * 1000) ] } ] } ``` - *

- * #### 根据用户曾经登录过的应用筛选 - *

- * 筛选出曾经登录过应用 `appId1` 或者 `appId2` 的用户: - *

- * ```json { "advancedFilter": [ { "field": "loggedInApps", "operator": "IN", "value": [ - * "appId1", "appId2" ] } ] } ``` - *

- * #### 根据用户所在部门进行筛选 - *

- * ```json { "advancedFilter": [ { "field": "department", "operator": "IN", "value": [ { - * "organizationCode": "steamory", "departmentId": "root", "departmentIdType": "department_id", - * "includeChildrenDepartments": true } ] } ] } ``` - **/ - public UserPaginatedRespDto listUsers(ListUsersRequestDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-users"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, UserPaginatedRespDto.class); - } - - /** - * @summary 获取用户列表 - * @description 获取用户列表接口,支持分页,可以选择获取自定义数据、identities 等。 - * @deprecated - **/ - public UserPaginatedRespDto listUsersLegacy(ListUsersDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-users"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, UserPaginatedRespDto.class); - } - - /** - * @summary 获取用户信息 - * @description 通过用户 ID,获取用户详情,可以选择获取自定义数据、identities、选择指定用户 ID 类型等。 - **/ - public UserSingleRespDto getUser(GetUserDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, UserSingleRespDto.class); - } - - /** - * @summary 批量获取用户信息 - * @description 通过用户 ID 列表,批量获取用户信息,可以选择获取自定义数据、identities、选择指定用户 ID 类型等。 - **/ - public UserListRespDto getUserBatch(GetUserBatchDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-batch"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, UserListRespDto.class); - } - - /** - * @summary 创建用户 - * @description 创建用户,邮箱、手机号、用户名必须包含其中一个,邮箱、手机号、用户名、externalId 用户池内唯一,此接口将以管理员身份创建用户因此不需要进行手机号验证码检验等安全检测。 - **/ - public UserSingleRespDto createUser(CreateUserReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-user"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, UserSingleRespDto.class); - } - - /** - * @summary 批量创建用户 - * @description 批量创建用户,邮箱、手机号、用户名必须包含其中一个,邮箱、手机号、用户名、externalId 用户池内唯一,此接口将以管理员身份创建用户因此不需要进行手机号验证码检验等安全检测。 - **/ - public UserListRespDto createUsersBatch(CreateUserBatchReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-users-batch"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, UserListRespDto.class); - } - - /** - * @summary 修改用户资料 - * @description 通过用户 ID,修改用户资料,邮箱、手机号、用户名、externalId 用户池内唯一,此接口将以管理员身份修改用户资料因此不需要进行手机号验证码检验等安全检测。 - **/ - public UserSingleRespDto updateUser(UpdateUserReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-user"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, UserSingleRespDto.class); - } - - /** - * @summary 批量修改用户资料 - * @description 批量修改用户资料,邮箱、手机号、用户名、externalId 用户池内唯一,此接口将以管理员身份修改用户资料因此不需要进行手机号验证码检验等安全检测。 - **/ - public UserListRespDto updateUserBatch(UpdateUserBatchReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-user-batch"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, UserListRespDto.class); - } - - /** - * @summary 删除用户 - * @description 通过用户 ID 列表,删除用户,支持批量删除,可以选择指定用户 ID 类型等。 - **/ - public IsSuccessRespDto deleteUsersBatch(DeleteUsersBatchDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-users-batch"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 获取用户的外部身份源 - * @description 通过用户 ID,获取用户的外部身份源、选择指定用户 ID 类型。 - **/ - public IdentityListRespDto getUserIdentities(GetUserIdentitiesDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-identities"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, IdentityListRespDto.class); - } - - /** - * @summary 获取用户角色列表 - * @description 通过用户 ID,获取用户角色列表,可以选择所属权限分组 code、选择指定用户 ID 类型等。 - **/ - public RolePaginatedRespDto getUserRoles(GetUserRolesDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-roles"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, RolePaginatedRespDto.class); - } - - /** - * @summary 获取用户实名认证信息 - * @description 通过用户 ID,获取用户实名认证信息,可以选择指定用户 ID 类型。 - **/ - public PrincipalAuthenticationInfoPaginatedRespDto getUserPrincipalAuthenticationInfo( - GetUserPrincipalAuthenticationInfoDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-principal-authentication-info"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, PrincipalAuthenticationInfoPaginatedRespDto.class); - } - - /** - * @summary 删除用户实名认证信息 - * @description 通过用户 ID,删除用户实名认证信息,可以选择指定用户 ID 类型等。 - **/ - public IsSuccessRespDto resetUserPrincipalAuthenticationInfo( - ResetUserPrincipalAuthenticationInfoDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/reset-user-principal-authentication-info"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 获取用户部门列表 - * @description 通过用户 ID,获取用户部门列表,支持分页,可以选择获取自定义数据、选择指定用户 ID 类型、增序或降序等。 - **/ - public UserDepartmentPaginatedRespDto getUserDepartments(GetUserDepartmentsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-departments"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, UserDepartmentPaginatedRespDto.class); - } - - /** - * @summary 设置用户所在部门 - * @description 通过用户 ID,设置用户所在部门,可以选择指定用户 ID 类型等。 - **/ - public IsSuccessRespDto setUserDepartments(SetUserDepartmentsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/set-user-departments"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 获取用户分组列表 - * @description 通过用户 ID,获取用户分组列表,可以选择指定用户 ID 类型等。 - **/ - public GroupPaginatedRespDto getUserGroups(GetUserGroupsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-groups"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GroupPaginatedRespDto.class); - } - - /** - * @summary 获取用户 MFA 绑定信息 - * @description 通过用户 ID,获取用户 MFA 绑定信息,可以选择指定用户 ID 类型等。 - **/ - public UserMfaSingleRespDto getUserMfaInfo(GetUserMfaInfoDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-mfa-info"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, UserMfaSingleRespDto.class); - } - - /** - * @summary 获取已归档的用户列表 - * @description 获取已归档的用户列表,支持分页,可以筛选开始时间等。 - **/ - public ListArchivedUsersSingleRespDto listArchivedUsers(ListArchivedUsersDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-archived-users"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, ListArchivedUsersSingleRespDto.class); - } - - /** - * @summary 强制下线用户 - * @description 通过用户 ID、App ID 列表,强制让用户下线,可以选择指定用户 ID 类型等。 - **/ - public IsSuccessRespDto kickUsers(KickUsersDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/kick-users"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 判断用户是否存在 - * @description 根据条件判断用户是否存在,可以筛选用户名、邮箱、手机号、第三方外部 ID 等。 - **/ - public IsUserExistsRespDto isUserExists(IsUserExistsReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/is-user-exists"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsUserExistsRespDto.class); - } - - /** - * @summary 获取用户可访问的应用 - * @description 通过用户 ID,获取用户可访问的应用,可以选择指定用户 ID 类型等。 - **/ - public AppListRespDto getUserAccessibleApps(GetUserAccessibleAppsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-accessible-apps"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, AppListRespDto.class); - } - - /** - * @summary 获取用户授权的应用 - * @description 通过用户 ID,获取用户授权的应用,可以选择指定用户 ID 类型等。 - **/ - public AppListRespDto getUserAuthorizedApps(GetUserAuthorizedAppsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-authorized-apps"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, AppListRespDto.class); - } - - /** - * @summary 判断用户是否有某个角色 - * @description 通过用户 ID,判断用户是否有某个角色,支持传入多个角色,可以选择指定用户 ID 类型等。 - **/ - public HasAnyRoleRespDto hasAnyRole(HasAnyRoleReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/has-any-role"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, HasAnyRoleRespDto.class); - } - - /** - * @summary 获取用户的登录历史记录 - * @description 通过用户 ID,获取用户登录历史记录,支持分页,可以选择指定用户 ID 类型、应用 ID、开始与结束时间戳等。 - **/ - public UserLoginHistoryPaginatedRespDto getUserLoginHistory(GetUserLoginHistoryDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-login-history"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, UserLoginHistoryPaginatedRespDto.class); - } - - /** - * @summary 获取用户曾经登录过的应用 - * @description 通过用户 ID,获取用户曾经登录过的应用,可以选择指定用户 ID 类型等。 - **/ - public UserLoggedInAppsListRespDto getUserLoggedinApps(GetUserLoggedinAppsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-loggedin-apps"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, UserLoggedInAppsListRespDto.class); - } - - /** - * @summary 获取用户曾经登录过的身份源 - * @description 通过用户 ID,获取用户曾经登录过的身份源,可以选择指定用户 ID 类型等。 - **/ - public UserLoggedInIdentitiesRespDto getUserLoggedinIdentities( - GetUserLoggedInIdentitiesDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-logged-in-identities"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, UserLoggedInIdentitiesRespDto.class); - } - - /** - * @summary 用户离职 - * @description 通过用户 ID,对用户进行离职操作 - **/ - public ResignUserRespDto resignUser(ResignUserReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/resign-user"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, ResignUserRespDto.class); - } - - /** - * @summary 批量用户离职 - * @description 通过用户 ID,对用户进行离职操作 - **/ - public ResignUserRespDto resignUserBatch(ResignUserBatchReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/resign-user-batch"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, ResignUserRespDto.class); - } - - /** - * @summary 获取用户被授权的所有资源 - * @description 通过用户 ID,获取用户被授权的所有资源,可以选择指定用户 ID 类型等,用户被授权的资源是用户自身被授予、通过分组继承、通过角色继承、通过组织机构继承的集合。 - **/ - public AuthorizedResourcePaginatedRespDto getUserAuthorizedResources( - GetUserAuthorizedResourcesDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-authorized-resources"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, AuthorizedResourcePaginatedRespDto.class); - } - - /** - * @summary 检查某个用户在应用下是否具备 Session 登录态 - * @description 检查某个用户在应用下是否具备 Session 登录态 - **/ - public CheckSessionStatusRespDto checkSessionStatus(CheckSessionStatusDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/check-session-status"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CheckSessionStatusRespDto.class); - } - - /** - * @summary 导入用户的 OTP - * @description 导入用户的 OTP - **/ - public CommonResponseDto importOtp(ImportOtpReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/import-otp"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CommonResponseDto.class); - } - - /** - * @summary 获取用户绑定 OTP 的秘钥 - * @description 通过用户 ID,获取用户绑定 OTP 的秘钥。可以选择指定用户 ID 类型等。 - **/ - public GetOtpSecretRespDto getOtpSecretByUser(GetOtpSecretByUserDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-otp-secret-by-user"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetOtpSecretRespDto.class); - } - - /** - * @summary 获取组织机构详情 - * @description 获取组织机构详情 - **/ - public OrganizationSingleRespDto getOrganization(GetOrganizationDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-organization"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, OrganizationSingleRespDto.class); - } - - - /** - * @summary 批量获取组织机构详情 - * @description 批量获取组织机构详情 - **/ - public OrganizationListRespDto getOrganizationsBatch(GetOrganizationBatchDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-organization-batch"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, OrganizationListRespDto.class); - } - - /** - * @summary 获取组织机构列表 - * @description 获取组织机构列表,支持分页。 - **/ - public OrganizationPaginatedRespDto listOrganizations(ListOrganizationsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-organizations"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, OrganizationPaginatedRespDto.class); - } - - - /** - * @summary 创建组织机构 - * @description 创建组织机构,会创建一个只有一个节点的组织机构,可以选择组织描述信息、根节点自定义 ID、多语言等。 - **/ - public OrganizationSingleRespDto createOrganization(CreateOrganizationReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-organization"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, OrganizationSingleRespDto.class); - } - - /** - * @summary 修改组织机构 - * @description 通过组织 code,修改组织机构,可以选择部门描述、新组织 code、组织名称等。 - **/ - public OrganizationSingleRespDto updateOrganization(UpdateOrganizationReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-organization"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, OrganizationSingleRespDto.class); - } - - /** - * @summary 删除组织机构 - * @description 通过组织 code,删除组织机构树。 - **/ - public IsSuccessRespDto deleteOrganization(DeleteOrganizationReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-organization"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 搜索组织机构列表 - * @description 通过搜索关键词,搜索组织机构列表,支持分页。 - **/ - public OrganizationPaginatedRespDto searchOrganizations(SearchOrganizationsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/search-organizations"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, OrganizationPaginatedRespDto.class); - } - - /** - * @summary 获取部门信息 - * @description 通过组织 code 以及 部门 ID 或 部门 code,获取部门信息,可以获取自定义数据。 - **/ - public DepartmentSingleRespDto getDepartment(GetDepartmentDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-department"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, DepartmentSingleRespDto.class); - } - - - - /** - * @summary 创建部门 - * @description 通过组织 code、部门名称、父部门 ID,创建部门,可以设置多种参数。 - **/ - public DepartmentSingleRespDto createDepartment(CreateDepartmentReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-department"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, DepartmentSingleRespDto.class); - } - - - - /** - * @summary 修改部门 - * @description 通过组织 code、部门 ID,修改部门,可以设置多种参数。 - **/ - public DepartmentSingleRespDto updateDepartment(UpdateDepartmentReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-department"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, DepartmentSingleRespDto.class); - } - - - - /** - * @summary 删除部门 - * @description 通过组织 code、部门 ID,删除部门。 - **/ - public IsSuccessRespDto deleteDepartment(DeleteDepartmentReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-department"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - - - /** - * @summary 搜索部门 - * @description 通过组织 code、搜索关键词,搜索部门,可以搜索组织名称等。 - * @deprecated - **/ - public DepartmentListRespDto searchDepartments(SearchDepartmentsReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/search-departments"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, DepartmentListRespDto.class); - } - - /** - * @summary 搜索部门 - * @description 通过组织 code、搜索关键词,搜索部门,可以搜索组织名称等。 - **/ - public DepartmentListRespDto searchDepartmentsList(SearchDepartmentsListReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/search-departments-list"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, DepartmentListRespDto.class); - } - - /** - * @summary 获取子部门列表 - * @description 通过组织 code、部门 ID,获取子部门列表,可以选择获取自定义数据、虚拟组织等。 - **/ - public DepartmentPaginatedRespDto listChildrenDepartments(ListChildrenDepartmentsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-children-departments"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, DepartmentPaginatedRespDto.class); - } - - - - /** - * @summary 获取部门成员列表 - * @description 通过组织 code、部门 ID、排序,获取部门成员列表,支持分页,可以选择获取自定义数据、identities 等。 - **/ - public UserPaginatedRespDto listDepartmentMembers(ListDepartmentMembersDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-department-members"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, UserPaginatedRespDto.class); - } - - - - /** - * @summary 获取部门直属成员 ID 列表 - * @description 通过组织 code、部门 ID,获取部门直属成员 ID 列表。 - **/ - public UserIdListRespDto listDepartmentMemberIds(ListDepartmentMemberIdsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-department-member-ids"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, UserIdListRespDto.class); - } - - /** - * @summary 搜索部门下的成员 - * @description 通过组织 code、部门 ID、搜索关键词,搜索部门下的成员,支持分页,可以选择获取自定义数据、identities 等。 - **/ - public UserPaginatedRespDto searchDepartmentMembers(SearchDepartmentMembersDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/search-department-members"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, UserPaginatedRespDto.class); - } - - /** - * @summary 部门下添加成员 - * @description 通过部门 ID、组织 code,添加部门下成员。 - **/ - public IsSuccessRespDto addDepartmentMembers(AddDepartmentMembersReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/add-department-members"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 部门下删除成员 - * @description 通过部门 ID、组织 code,删除部门下成员。 - **/ - public IsSuccessRespDto removeDepartmentMembers(RemoveDepartmentMembersReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/remove-department-members"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 获取父部门信息 - * @description 通过组织 code、部门 ID,获取父部门信息,可以选择获取自定义数据等。 - **/ - public DepartmentSingleRespDto getParentDepartment(GetParentDepartmentDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-parent-department"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, DepartmentSingleRespDto.class); - } - - /** - * @summary 判断用户是否在某个部门下 - * @description 通过组织 code、部门 ID,判断用户是否在某个部门下,可以选择包含子部门。 - **/ - public IsUserInDepartmentRespDto isUserInDepartment(IsUserInDepartmentDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/is-user-in-department"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, IsUserInDepartmentRespDto.class); - } - - /** - * @summary 根据部门id查询部门 - * @description 根据部门id查询部门 - **/ - public DepartmentSingleRespDto getDepartmentById(GetDepartmentByIdDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-department-by-id"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, DepartmentSingleRespDto.class); - } - - /** - * @summary 根据组织树批量创建部门 - * @description 根据组织树批量创建部门,部门名称不存在时会自动创建 - **/ - public CreateDepartmentTreeRespDto createDepartmentTree(CreateDepartmentTreeReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-department-tree"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CreateDepartmentTreeRespDto.class); - } - - /** - * @summary 获取分组详情 - * @description 通过分组 code,获取分组详情。 - **/ - public GroupSingleRespDto getGroup(GetGroupDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-group"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GroupSingleRespDto.class); - } - - /** - * @summary 获取分组列表 - * @description 获取分组列表,支持分页。 - **/ - public GroupPaginatedRespDto listGroups(ListGroupsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-groups"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GroupPaginatedRespDto.class); - } - - /** - * @summary 创建分组 - * @description 创建分组,一个分组必须包含分组名称与唯一标志符 code,且必须为一个合法的英文标志符,如 developers。 - **/ - public GroupSingleRespDto createGroup(CreateGroupReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-group"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, GroupSingleRespDto.class); - } - - /** - * @summary 批量创建分组 - * @description 批量创建分组,一个分组必须包含分组名称与唯一标志符 code,且必须为一个合法的英文标志符,如 developers。 - **/ - public GroupListRespDto createGroupsBatch(CreateGroupBatchReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-groups-batch"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, GroupListRespDto.class); - } - - /** - * @summary 修改分组 - * @description 通过分组 code,修改分组,可以修改此分组的 code。 - **/ - public GroupSingleRespDto updateGroup(UpdateGroupReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-group"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, GroupSingleRespDto.class); - } - - /** - * @summary 批量删除分组 - * @description 通过分组 code,批量删除分组。 - **/ - public IsSuccessRespDto deleteGroupsBatch(DeleteGroupsReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-groups-batch"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 添加分组成员 - * @description 添加分组成员,成员以用户 ID 数组形式传递。 - **/ - public IsSuccessRespDto addGroupMembers(AddGroupMembersReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/add-group-members"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 批量移除分组成员 - * @description 批量移除分组成员,成员以用户 ID 数组形式传递。 - **/ - public IsSuccessRespDto removeGroupMembers(RemoveGroupMembersReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/remove-group-members"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 获取分组成员列表 - * @description 通过分组 code,获取分组成员列表,支持分页,可以获取自定义数据、identities、部门 ID 列表。 - **/ - public UserPaginatedRespDto listGroupMembers(ListGroupMembersDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-group-members"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, UserPaginatedRespDto.class); - } - - /** - * @summary 获取分组被授权的资源列表 - * @description 通过分组 code,获取分组被授权的资源列表,可以通过资源类型、权限分组 code 筛选。 - **/ - public AuthorizedResourceListRespDto getGroupAuthorizedResources( - GetGroupAuthorizedResourcesDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-group-authorized-resources"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, AuthorizedResourceListRespDto.class); - } - - /** - * @summary 获取角色详情 - * @description 通过权限分组内角色 code,获取角色详情。 - **/ - public RoleSingleRespDto getRole(GetRoleDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-role"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, RoleSingleRespDto.class); - } - - /** - * @summary 分配角色 - * @description 通过权限分组内角色 code,分配角色,被分配者可以是用户或部门。 - **/ - public IsSuccessRespDto assignRole(AssignRoleDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/assign-role"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 移除分配的角色 - * @description 通过权限分组内角色 code,移除分配的角色,被分配者可以是用户或部门。 - **/ - public IsSuccessRespDto revokeRole(RevokeRoleDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/revoke-role"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 获取角色被授权的资源列表 - * @description 通过权限分组内角色 code,获取角色被授权的资源列表。 - **/ - public RoleAuthorizedResourcePaginatedRespDto getRoleAuthorizedResources( - GetRoleAuthorizedResourcesDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-role-authorized-resources"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, RoleAuthorizedResourcePaginatedRespDto.class); - } - - /** - * @summary 获取角色成员列表 - * @description 通过权限分组内内角色 code,获取角色成员列表,支持分页,可以选择或获取自定义数据、identities 等。 - **/ - public UserPaginatedRespDto listRoleMembers(ListRoleMembersDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-role-members"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, UserPaginatedRespDto.class); - } - - /** - * @summary 获取角色的部门列表 - * @description 通过权限分组内角色 code,获取角色的部门列表,支持分页。 - **/ - public RoleDepartmentListPaginatedRespDto listRoleDepartments(ListRoleDepartmentsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-role-departments"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, RoleDepartmentListPaginatedRespDto.class); - } - - /** - * @summary 创建角色 - * @description 通过权限分组(权限空间)内角色 code,创建角色,可以选择权限分组、角色描述、角色名称等。 - **/ - public RoleSingleRespDto createRole(CreateRoleDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-role"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, RoleSingleRespDto.class); - } - - /** - * @summary 获取角色列表 - * @description 获取角色列表,支持分页、支持根据权限分组(权限空间)筛选 - **/ - public RolePaginatedRespDto listRoles(ListRolesDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-roles"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, RolePaginatedRespDto.class); - } - - /** - * @summary 单个权限分组(权限空间)内删除角色 - * @description 单个权限分组(权限空间)内删除角色,可以批量删除。 - **/ - public IsSuccessRespDto deleteRolesBatch(DeleteRoleDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-roles-batch"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 批量创建角色 - * @description 批量创建角色,可以选择权限分组、角色描述等。 - **/ - public IsSuccessRespDto createRolesBatch(CreateRolesBatch reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-roles-batch"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 修改角色 - * @description 通过权限分组(权限空间 ) 内角色新旧 Code , 修改角色 , 可以选择角色名称 、 角色描述等 。 - **/ - public IsSuccessRespDto updateRole(UpdateRoleDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-role"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 跨权限分组(空间)删除角色 - * @description 跨权限分组(空间)删除角色,可以批量删除。 - **/ - public IsSuccessRespDto deleteRoles(DeleteRoleBatchDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/multiple-namespace-delete-roles-batch"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 校验角色 Code 或者名称是否可用 - * @description 通过用户池 ID、权限空间 Code和角色 Code,或者用户池 ID、权限空间名称和角色名称查询是否可用。 - **/ - public RoleCheckParamsRespDto checkParamsNamespace(CheckRoleParamsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/check-role-params"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, RoleCheckParamsRespDto.class); - } - - /** - * @summary 获取角色授权列表 - * @description 获取角色授权列表。 - **/ - public RoleListPageRespDto listRoleAssignments(ListRoleAssignmentsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-role-assignments"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, RoleListPageRespDto.class); - } - - /** - * @summary 获取身份源列表 - * @description 获取身份源列表,可以指定 租户 ID 筛选。 - **/ - public ExtIdpListPaginatedRespDto listExtIdp(ListExtIdpDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-ext-idp"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, ExtIdpListPaginatedRespDto.class); - } - - - - /** - * @summary 获取身份源详情 - * @description 通过 身份源 ID,获取身份源详情,可以指定 租户 ID 筛选。 - **/ - public ExtIdpDetailSingleRespDto getExtIdp(GetExtIdpDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-ext-idp"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, ExtIdpDetailSingleRespDto.class); - } - - - - /** - * @summary 创建身份源 - * @description 创建身份源,可以设置身份源名称、连接类型、租户 ID 等。 - **/ - public ExtIdpSingleRespDto createExtIdp(CreateExtIdpDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-ext-idp"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, ExtIdpSingleRespDto.class); - } - - - /** - * @summary 更新身份源配置 - * @description 更新身份源配置,可以设置身份源 ID 与 名称。 - **/ - public ExtIdpSingleRespDto updateExtIdp(UpdateExtIdpDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-ext-idp"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, ExtIdpSingleRespDto.class); - } - - - /** - * @summary 删除身份源 - * @description 通过身份源 ID,删除身份源。 - **/ - public IsSuccessRespDto deleteExtIdp(DeleteExtIdpDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-ext-idp"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 在某个已有身份源下创建新连接 - * @description 在某个已有身份源下创建新连接,可以设置身份源图标、是否只支持登录等。 - **/ - public ExtIdpConnDetailSingleRespDto createExtIdpConn(CreateExtIdpConnDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-ext-idp-conn"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, ExtIdpConnDetailSingleRespDto.class); - } - - - - /** - * @summary 更新身份源连接 - * @description 更新身份源连接,可以设置身份源图标、是否只支持登录等。 - **/ - public ExtIdpConnDetailSingleRespDto updateExtIdpConn(UpdateExtIdpConnDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-ext-idp-conn"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, ExtIdpConnDetailSingleRespDto.class); - } - - - - /** - * @summary 删除身份源连接 - * @description 通过身份源连接 ID,删除身份源连接。 - **/ - public IsSuccessRespDto deleteExtIdpConn(DeleteExtIdpConnDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-ext-idp-conn"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - - - /** - * @summary 身份源连接开关 - * @description 身份源连接开关,可以打开或关闭身份源连接。 - **/ - public IsSuccessRespDto changeExtIdpConnState(ChangeExtIdpConnStateDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/change-ext-idp-conn-state"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - - - /** - * @summary 租户关联身份源 - * @description 租户可以关联或取消关联身份源连接。 - **/ - public IsSuccessRespDto changeExtIdpConnAssociationState( - ChangeExtIdpAssociationStateDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/change-ext-idp-conn-association-state"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - - - /** - * @summary 租户控制台获取身份源列表 - * @description 在租户控制台内获取身份源列表,可以根据 应用 ID 筛选。 - **/ - public ExtIdpListPaginatedRespDto listTenantExtIdp(ListTenantExtIdpDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-tenant-ext-idp"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, ExtIdpListPaginatedRespDto.class); - } - - - - /** - * @summary 身份源下应用的连接详情 - * @description 在身份源详情页获取应用的连接情况 - **/ - public ExtIdpListPaginatedRespDto extIdpConnStateByApps(ExtIdpConnAppsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/ext-idp-conn-apps"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, ExtIdpListPaginatedRespDto.class); - } - - - - /** - * @summary 获取用户内置字段列表 - * @description 获取用户内置的字段列表 - **/ - public CustomFieldListRespDto getUserBaseFields() { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-base-fields"); - config.setBody(new Object()); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, CustomFieldListRespDto.class); - } - - /** - * @summary 修改用户内置字段配置 - * @description 修改用户内置字段配置,内置字段不允许修改数据类型、唯一性。 - **/ - public CustomFieldListRespDto setUserBaseFields(SetUserBaseFieldsReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/set-user-base-fields"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CustomFieldListRespDto.class); - } - - /** - * @summary 获取自定义字段列表 - * @description 通过主体类型,获取用户、部门或角色的自定义字段列表。 - **/ - public CustomFieldListRespDto getCustomFields(GetCustomFieldsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-custom-fields"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, CustomFieldListRespDto.class); - } - - /** - * @summary 创建/修改自定义字段定义 - * @description 创建/修改用户、部门或角色自定义字段定义,如果传入的 key 不存在则创建,存在则更新。 - **/ - public CustomFieldListRespDto setCustomFields(SetCustomFieldsReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/set-custom-fields"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CustomFieldListRespDto.class); - } - - /** - * @summary 设置自定义字段的值 - * @description 给用户、角色或部门设置自定义字段的值,如果存在则更新,不存在则创建。 - **/ - public IsSuccessRespDto setCustomData(SetCustomDataReqDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/set-custom-data"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 获取用户、分组、角色、组织机构的自定义字段值 - * @description 通过筛选条件,获取用户、分组、角色、组织机构的自定义字段值。 - **/ - public GetCustomDataRespDto getCustomData(GetCustomDataDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-custom-data"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetCustomDataRespDto.class); - } - - /** - * @summary 创建资源 - * @description 创建资源,可以设置资源的描述、定义的操作类型、URL 标识等。 - **/ - public ResourceRespDto createResource(CreateResourceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-resource"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, ResourceRespDto.class); - } - - /** - * @summary 批量创建资源 - * @description 批量创建资源,可以设置资源的描述、定义的操作类型、URL 标识等。 - **/ - public IsSuccessRespDto createResourcesBatch(CreateResourcesBatchDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-resources-batch"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 获取资源详情 - * @description 根据筛选条件,获取资源详情。 - **/ - public ResourceRespDto getResource(GetResourceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-resource"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, ResourceRespDto.class); - } - - /** - * @summary 批量获取资源详情 - * @description 根据筛选条件,批量获取资源详情。 - **/ - public ResourceListRespDto getResourcesBatch(GetResourcesBatchDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-resources-batch"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, ResourceListRespDto.class); - } - - /** - * @summary 分页获取常规资源列表 - * @description 根据筛选条件,分页获取常规资源详情列表。 - **/ - public CommonResourcePaginatedRespDto listCommonResource(ListCommonResourceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-common-resource"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, CommonResourcePaginatedRespDto.class); - } - - - - /** - * @summary 分页获取资源列表 - * @description 根据筛选条件,分页获取资源详情列表。 - **/ - public ResourcePaginatedRespDto listResources(ListResourcesDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-resources"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, ResourcePaginatedRespDto.class); - } - - - /** - * @summary 修改资源 - * @description 修改资源,可以设置资源的描述、定义的操作类型、URL 标识等。 - **/ - public ResourceRespDto updateResource(UpdateResourceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-resource"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, ResourceRespDto.class); - } - - /** - * @summary 删除资源 - * @description 通过资源唯一标志符以及所属权限分组,删除资源。 - **/ - public IsSuccessRespDto deleteResource(DeleteResourceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-resource"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 批量删除资源 - * @description 批量删除资源,允许通过资源 Id 列表进行批量删除,同时允许权限空间加资源 Code 列表进行批量删除,资源 Id 列表和资源 Code - * 列表同时必须存在一个,如果两个都存在,则以资源 Id 列表为主 - **/ - public IsSuccessRespDto deleteResourcesBatch(DeleteResourcesBatchDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-resources-batch"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 批量删除资源 - * @description 批量删除资源,通过资源 Id 进行批量删除。 - * @deprecated - **/ - public IsSuccessRespDto deleteResourcesByIdBatch(DeleteCommonResourcesBatchDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-common-resources-batch"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 关联/取消关联应用资源到租户 - * @description 通过资源唯一标识以及权限分组,关联或取消关联资源到租户 - **/ - public IsSuccessRespDto associateTenantResource(AssociateTenantResourceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/associate-tenant-resource"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - - /** - * @summary 创建权限分组 - * @description 创建权限分组,可以设置权限分组名称、Code 和描述信息。 - **/ - public NamespaceRespDto createNamespace(CreateNamespaceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-namespace"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, NamespaceRespDto.class); - } - - /** - * @summary 批量创建权限分组 - * @description 批量创建权限分组,可以分别设置权限分组名称、Code 和描述信息。 - **/ - public IsSuccessRespDto createNamespacesBatch(CreateNamespacesBatchDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-namespaces-batch"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 获取权限分组详情 - * @description 通过权限分组唯一标志符(Code),获取权限分组详情。 - **/ - public NamespaceRespDto getNamespace(GetNamespaceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-namespace"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, NamespaceRespDto.class); - } - - /** - * @summary 批量获取权限分组详情 - * @description 分别通过权限分组唯一标志符(Code),批量获取权限分组详情。 - **/ - public NamespaceListRespDto getNamespacesBatch(GetNamespacesBatchDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-namespaces-batch"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, NamespaceListRespDto.class); - } - - /** - * @summary 修改权限分组信息 - * @description 修改权限分组信息,可以修改名称、描述信息以及新的唯一标志符(NewCode)。 - **/ - public UpdateNamespaceRespDto updateNamespace(UpdateNamespaceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-namespace"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, UpdateNamespaceRespDto.class); - } - - /** - * @summary 删除权限分组信息 - * @description 通过权限分组唯一标志符(Code),删除权限分组信息。 - **/ - public IsSuccessRespDto deleteNamespace(DeleteNamespaceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-namespace"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 批量删除权限分组 - * @description 分别通过权限分组唯一标志符(Code),批量删除权限分组。 - **/ - public IsSuccessRespDto deleteNamespacesBatch(DeleteNamespacesBatchDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-namespaces-batch"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 分页获取权限分组列表 - * @description 根据筛选条件,分页获取权限分组列表。 - **/ - public NamespaceListPaginatedRespDto listNamespaces(ListNamespacesDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-namespaces"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, NamespaceListPaginatedRespDto.class); - } - - /** - * @summary 分页权限分组下所有的角色列表 - * @description 根据筛选条件,分页获取权限分组下所有的角色列表。 - **/ - public NamespaceRolesListPaginatedRespDto listNamespaceRoles(ListNamespaceRolesDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-namespace-roles"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, NamespaceRolesListPaginatedRespDto.class); - } - - /** - * @summary 授权资源 - * @description 将一个/多个资源授权给用户、角色、分组、组织机构等主体,且可以分别指定不同的操作权限。 - **/ - public IsSuccessRespDto authorizeResources(AuthorizeResourcesDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/authorize-resources"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - /** - * @summary 获取某个主体被授权的资源列表 - * @description 根据筛选条件,获取某个主体被授权的资源列表。 - **/ - public AuthorizedResourcePaginatedRespDto getAuthorizedResources( - GetAuthorizedResourcesDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-authorized-resources"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, AuthorizedResourcePaginatedRespDto.class); - } - - /** - * @summary 判断用户是否对某个资源的某个操作有权限 - * @description 判断用户是否对某个资源的某个操作有权限。 - **/ - public IsActionAllowedRespDtp isActionAllowed(IsActionAllowedDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/is-action-allowed"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsActionAllowedRespDtp.class); - } - - - /** - * @summary 获取资源被授权的主体 - * @description 获取资源被授权的主体 - **/ - public GetResourceAuthorizedTargetRespDto getResourceAuthorizedTargets( - GetResourceAuthorizedTargetsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-resource-authorized-targets"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, GetResourceAuthorizedTargetRespDto.class); - } - - /** - * @summary 获取同步任务详情 - * @description 获取同步任务详情 - **/ - public SyncTaskSingleRespDto getSyncTask(GetSyncTaskDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-sync-task"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, SyncTaskSingleRespDto.class); - } - - /** - * @summary 获取同步任务列表 - * @description 获取同步任务列表 - **/ - public SyncTaskPaginatedRespDto listSyncTasks(ListSyncTasksDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-sync-tasks"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, SyncTaskPaginatedRespDto.class); - } - - /** - * @summary 创建同步任务 - * @description 创建同步任务 - **/ - public SyncTaskPaginatedRespDto createSyncTask(CreateSyncTaskDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-sync-task"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, SyncTaskPaginatedRespDto.class); - } - - /** - * @summary 修改同步任务 - * @description 修改同步任务 - **/ - public SyncTaskPaginatedRespDto updateSyncTask(UpdateSyncTaskDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-sync-task"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, SyncTaskPaginatedRespDto.class); - } - - /** - * @summary 执行同步任务 - * @description 执行同步任务 - **/ - public TriggerSyncTaskRespDto triggerSyncTask(TriggerSyncTaskDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/trigger-sync-task"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, TriggerSyncTaskRespDto.class); - } - - /** - * @summary 获取同步作业详情 - * @description 获取同步作业详情 - **/ - public SyncJobSingleRespDto getSyncJob(GetSyncJobDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-sync-job"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, SyncJobSingleRespDto.class); - } - - /** - * @summary 获取同步作业详情 - * @description 获取同步作业详情 - **/ - public SyncJobPaginatedRespDto listSyncJobs(ListSyncJobsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-sync-jobs"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, SyncJobPaginatedRespDto.class); - } - - /** - * @summary 获取同步作业详情 - * @description 获取同步作业详情 - **/ - public TriggerSyncTaskRespDto listSyncJobLogs(ListSyncJobLogsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-sync-job-logs"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, TriggerSyncTaskRespDto.class); - } - - /** - * @summary 获取同步风险操作列表 - * @description 获取同步风险操作列表 - **/ - public SyncRiskOperationPaginatedRespDto listSyncRiskOperations( - ListSyncRiskOperationsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-sync-risk-operations"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, SyncRiskOperationPaginatedRespDto.class); - } - - /** - * @summary 执行同步风险操作 - * @description 执行同步风险操作 - **/ - public TriggerSyncRiskOperationsRespDto triggerSyncRiskOperations( - TriggerSyncRiskOperationDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/trigger-sync-risk-operations"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, TriggerSyncRiskOperationsRespDto.class); - } - - /** - * @summary 取消同步风险操作 - * @description 取消同步风险操作 - **/ - public CancelSyncRiskOperationsRespDto cancelSyncRiskOperation( - CancelSyncRiskOperationDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/cancel-sync-risk-operation"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CancelSyncRiskOperationsRespDto.class); - } - - /** - * @summary 获取用户行为日志 - * @description 可以选择请求 ID、客户端 IP、用户 ID、应用 ID、开始时间戳、请求是否成功、分页参数来获取用户行为日志 - **/ - public UserActionLogRespDto getUserActionLogs(GetUserActionLogsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-action-logs"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, UserActionLogRespDto.class); - } - - /** - * @summary 获取管理员操作日志 - * @description 可以选择请求 ID、客户端 IP、操作类型、资源类型、管理员用户 ID、请求是否成功、开始时间戳、结束时间戳、分页来获取管理员操作日志接口 - **/ - public AdminAuditLogRespDto getAdminAuditLogs(GetAdminAuditLogsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-admin-audit-logs"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, AdminAuditLogRespDto.class); - } - - /** - * @summary 获取邮件模版列表 - * @description 获取邮件模版列表 - **/ - public GetEmailTemplatesRespDto getEmailTemplates() { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-email-templates"); - config.setBody(new Object()); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetEmailTemplatesRespDto.class); - } - - /** - * @summary 修改邮件模版 - * @description 修改邮件模版 - **/ - public EmailTemplateSingleItemRespDto updateEmailTemplate(UpdateEmailTemplateDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-email-template"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, EmailTemplateSingleItemRespDto.class); - } - - /** - * @summary 预览邮件模版 - * @description 预览邮件模版 - **/ - public PreviewEmailTemplateRespDto previewEmailTemplate(PreviewEmailTemplateDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/preview-email-template"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, PreviewEmailTemplateRespDto.class); - } - - /** - * @summary 获取第三方邮件服务配置 - * @description 获取第三方邮件服务配置 - **/ - public EmailProviderRespDto getEmailProvider() { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-email-provider"); - config.setBody(new Object()); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, EmailProviderRespDto.class); - } - - /** - * @summary 配置第三方邮件服务 - * @description 配置第三方邮件服务 - **/ - public EmailProviderRespDto configEmailProvider(ConfigEmailProviderDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/config-email-provider"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, EmailProviderRespDto.class); - } - - /** - * @summary 获取应用详情 - * @description 通过应用 ID,获取应用详情。 - **/ - public ApplicationSingleRespDto getApplication(GetApplicationDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-application"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, ApplicationSingleRespDto.class); - } - - - - /** - * @summary 获取应用列表 - * @description 获取应用列表 - **/ - public ApplicationPaginatedRespDto listApplications(ListApplicationsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-applications"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, ApplicationPaginatedRespDto.class); - } - - /** - * @summary 获取应用简单信息 - * @description 通过应用 ID,获取应用简单信息。 - **/ - public ApplicationSimpleInfoSingleRespDto getApplicationSimpleInfo( - GetApplicationSimpleInfoDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-application-simple-info"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, ApplicationSimpleInfoSingleRespDto.class); - } - - - /** - * @summary 获取应用简单信息列表 - * @description 获取应用简单信息列表 - **/ - public ApplicationSimpleInfoPaginatedRespDto listApplicationSimpleInfo( - ListApplicationSimpleInfoDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-application-simple-info"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, ApplicationSimpleInfoPaginatedRespDto.class); - } - - /** - * @summary 创建应用 - * @description 创建应用 - **/ - public CreateApplicationRespDto createApplication(CreateApplicationDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-application"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CreateApplicationRespDto.class); - } - - /** - * @summary 删除应用 - * @description 通过应用 ID,删除应用。 - **/ - public IsSuccessRespDto deleteApplication(DeleteApplicationDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-application"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 获取应用密钥 - * @description 获取应用密钥 - **/ - public GetApplicationSecretRespDto getApplicationSecret(GetApplicationSecretDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-application-secret"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetApplicationSecretRespDto.class); - } - - /** - * @summary 刷新应用密钥 - * @description 刷新应用密钥 - **/ - public RefreshApplicationSecretRespDto refreshApplicationSecret( - RefreshApplicationSecretDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/refresh-application-secret"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, RefreshApplicationSecretRespDto.class); - } - - /** - * @summary 获取应用当前登录用户 - * @description 获取应用当前处于登录状态的用户 - **/ - public UserPaginatedRespDto listApplicationActiveUsers(ListApplicationActiveUsersDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-application-active-users"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, UserPaginatedRespDto.class); - } - - /** - * @summary 获取应用默认访问授权策略 - * @description 获取应用默认访问授权策略 - **/ - public GetApplicationPermissionStrategyRespDto getApplicationPermissionStrategy( - GetApplicationPermissionStrategyDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-application-permission-strategy"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetApplicationPermissionStrategyRespDto.class); - } - - /** - * @summary 更新应用默认访问授权策略 - * @description 更新应用默认访问授权策略 - **/ - public IsSuccessRespDto updateApplicationPermissionStrategy( - UpdateApplicationPermissionStrategyDataDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-application-permission-strategy"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 授权应用访问权限 - * @description 给用户、分组、组织或角色授权应用访问权限,如果用户、分组、组织或角色不存在,则跳过,进行下一步授权,不返回报错 - **/ - public IsSuccessRespDto authorizeApplicationAccess(AuthorizeApplicationAccessDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/authorize-application-access"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - - /** - * @summary 删除应用访问授权记录 - * @description 取消给用户、分组、组织或角色的应用访问权限授权,如果传入数据不存在,则返回数据不报错处理。 - **/ - public IsSuccessRespDto revokeApplicationAccess(RevokeApplicationAccessDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/revoke-application-access"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - - - /** - * @summary 检测域名是否可用 - * @description 检测域名是否可用于创建新应用或更新应用域名 - **/ - public CheckDomainAvailableSecretRespDto checkDomainAvailable(CheckDomainAvailable reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/check-domain-available"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CheckDomainAvailableSecretRespDto.class); - } - - /** - * @summary 获取租户应用列表 - * @description 获取应用列表,可以指定 租户 ID 筛选。 - **/ - public TenantApplicationListPaginatedRespDto listTenantApplications( - ListTenantApplicationsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-tenant-applications"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, TenantApplicationListPaginatedRespDto.class); - } - - - - /** - * @summary 更新应用登录页配置 - * @description 通过应用 ID 更新登录页配置。 - **/ - public IsSuccessRespDto updateLoginPageConfig(UpdateLoginConfigDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-login-page-config"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 获取用户池租户配置信息 - * @description 根据用户池 ID 获取用户池多租户配置信息 - **/ - public UserPoolTenantConfigDtoRespDto userpollTenantConfig() { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/userpool-tenant-config"); - config.setBody(new Object()); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, UserPoolTenantConfigDtoRespDto.class); - } - - /** - * @summary 更新用户池租户配置信息 - * @description 更新用户池多租户配置内登录信息 - **/ - public IsSuccessRespDto updateUserPoolTenantConfig(UpdateUserPoolTenantLoginConfigDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-userpool-tenant-config"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 设置用户池多租户身份源连接 - * @description 设置用户池多租户身份源连接,支持同时设置多个身份源连接,支持设置连接和取消连接 - **/ - public IsSuccessRespDto changeUserpoolTenanExtIdpConnState( - ChangeUserPoolTenantExtIdpConnDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/change-userpool-tenant-ext-idp-conn-state"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 创建 ASA 账号 - * @description 在某一应用下创建 ASA 账号 - **/ - public AsaAccountSingleRespDto createAsaAccount(CreateAsaAccountDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-asa-account"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, AsaAccountSingleRespDto.class); - } - - /** - * @summary 批量创建 ASA 账号 - * @description 在某一应用下批量创建 ASA 账号 - **/ - public IsSuccessRespDto createAsaAccountBatch(CreateAsaAccountsBatchDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-asa-accounts-batch"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 更新 ASA 账号 - * @description 更新某个 ASA 账号信息 - **/ - public AsaAccountSingleRespDto updateAsaAccount(UpdateAsaAccountDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-asa-account"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, AsaAccountSingleRespDto.class); - } - - /** - * @summary 获取 ASA 账号列表 - * @description 分页获取某一应用下的 ASA 账号列表 - **/ - public AsaAccountPaginatedRespDto listAsaAccount(ListAsaAccountsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-asa-accounts"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, AsaAccountPaginatedRespDto.class); - } - - /** - * @summary 获取 ASA 账号 - * @description 根据 ASA 账号 ID 获取账号详细信息 - **/ - public AsaAccountSingleRespDto getAsaAccount(GetAsaAccountDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-asa-account"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, AsaAccountSingleRespDto.class); - } - - /** - * @summary 批量获取 ASA 账号 - * @description 根据 ASA 账号 ID 列表批量获取账号详细信息 - **/ - public AsaAccountListRespDto getAsaAccountBatch(GetAsaAccountBatchDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-asa-accounts-batch"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, AsaAccountListRespDto.class); - } - - /** - * @summary 删除 ASA 账号 - * @description 通过 ASA 账号 ID 删除 ASA 账号 - **/ - public IsSuccessRespDto deleteAsaAccount(DeleteAsaAccountDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-asa-account"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 批量删除 ASA 账号 - * @description 通过 ASA 账号 ID 批量删除 ASA 账号 - **/ - public IsSuccessRespDto deleteAsaAccountBatch(DeleteAsaAccountBatchDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-asa-accounts-batch"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 分配 ASA 账号 - * @description 分配 ASA 账号给用户、组织、分组或角色 - **/ - public IsSuccessRespDto assignAsaAccount(AssignAsaAccountsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/assign-asa-account"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 取消分配 ASA 账号 - * @description 取消分配给用户、组织、分组或角色的 ASA 账号 - **/ - public IsSuccessRespDto unassignAsaAccount(AssignAsaAccountsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/unassign-asa-account"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 获取 ASA 账号分配的主体列表 - * @description 根据 ASA 账号 ID 分页获取账号被分配的主体列表 - **/ - public GetAsaAccountAssignedTargetRespDto getAsaAccountAssignedTargets( - GetAsaAccountAssignedTargetsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-asa-account-assigned-targets"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetAsaAccountAssignedTargetRespDto.class); - } - - /** - * @summary 获取主体被分配的 ASA 账号 - * @description 根据主体类型和标识获取直接分配给主体的 ASA 账号 - **/ - public AsaAccountSingleNullableRespDto getAssignedAccount(GetAssignedAccountDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-assigned-account"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, AsaAccountSingleNullableRespDto.class); - } - - /** - * @summary 获取安全配置 - * @description 无需传参获取安全配置 - **/ - public SecuritySettingsRespDto getSecuritySettings() { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-security-settings"); - config.setBody(new Object()); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, SecuritySettingsRespDto.class); - } - - /** - * @summary 修改安全配置 - * @description 可选安全域、Authing Token 有效时间(秒)、验证码长度、验证码尝试次数、用户修改邮箱的安全策略、用户修改手机号的安全策略、Cookie - * 过期时间设置、是否禁止用户注册、频繁注册检测配置、验证码注册后是否要求用户设置密码、未验证的邮箱登录时是否禁止登录并发送认证邮件、用户自助解锁配置、Authing - * 登录页面是否开启登录账号选择、APP 扫码登录安全配置进行修改安全配置 - **/ - public SecuritySettingsRespDto updateSecuritySettings(UpdateSecuritySettingsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-security-settings"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, SecuritySettingsRespDto.class); - } - - /** - * @summary 获取全局多因素认证配置 - * @description 无需传参获取全局多因素认证配置 - **/ - public MFASettingsRespDto getGlobalMfaSettings() { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-global-mfa-settings"); - config.setBody(new Object()); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, MFASettingsRespDto.class); - } - - /** - * @summary 修改全局多因素认证配置 - * @description 传入 MFA 认证因素列表进行开启, - **/ - public MFASettingsRespDto updateGlobalMfaSettings(MFASettingsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-global-mfa-settings"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, MFASettingsRespDto.class); - } - - /** - * @summary 创建权限空间 - * @description 创建权限空间, 可以设置权限空间名称、Code 和描述信息。 - **/ - public CreatePermissionNamespaceResponseDto createPermissionNamespace( - CreatePermissionNamespaceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-permission-namespace"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CreatePermissionNamespaceResponseDto.class); - } - - /** - * @summary 批量创建权限空间 - * @description 批量创建权限空间,可以分别设置权限空间名称、Code 和描述信息。 - **/ - public IsSuccessRespDto createPermissionNamespacesBatch( - CreatePermissionNamespacesBatchDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-permission-namespaces-batch"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 获取权限空间详情 - * @description 通过权限空间唯一标志符(Code),获取权限空间详情。 - **/ - public GetPermissionNamespaceResponseDto getPermissionNamespace( - GetPermissionNamespaceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-permission-namespace"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetPermissionNamespaceResponseDto.class); - } - - /** - * @summary 批量获取权限空间详情列表 - * @description 分别通过权限空间唯一标志符(Code),获取权限空间详情。 - **/ - public GetPermissionNamespaceListResponseDto getPermissionNamespacesBatch( - GetPermissionNamespacesBatchDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-permission-namespaces-batch"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetPermissionNamespaceListResponseDto.class); - } - - /** - * @summary 分页获取权限空间列表 - * @description 分页获取权限空间列表。 - **/ - public PermissionNamespaceListPaginatedRespDto listPermissionNamespaces( - ListPermissionNamespacesDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-permission-namespaces"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, PermissionNamespaceListPaginatedRespDto.class); - } - - /** - * @summary 修改权限空间 - * @description 修改权限空间,可以修改权限空间名称、权限空间描述信息以及权限空间新的唯一标志符(Code)。 - **/ - public UpdatePermissionNamespaceResponseDto updatePermissionNamespace( - UpdatePermissionNamespaceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-permission-namespace"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, UpdatePermissionNamespaceResponseDto.class); - } - - /** - * @summary 删除权限空间 - * @description 通过权限空间唯一标志符(Code),删除权限空间信息。 - **/ - public IsSuccessRespDto deletePermissionNamespace(DeletePermissionNamespaceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-permission-namespace"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 批量删除权限空间 - * @description 分别通过权限空间唯一标志符(Code),批量删除权限空间信息。 - **/ - public IsSuccessRespDto deletePermissionNamespacesBatch( - DeletePermissionNamespacesBatchDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-permission-namespaces-batch"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - /** - * @summary 校验权限空间 Code 或者名称是否可用 - * @description 通过用户池 ID 和权限空间 Code,或者用户池 ID 和权限空间名称查询是否可用。 - **/ - public PermissionNamespaceCheckExistsRespDto checkPermissionNamespaceExists( - CheckPermissionNamespaceExistsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/check-permission-namespace-exists"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, PermissionNamespaceCheckExistsRespDto.class); - } - - /** - * @summary 分页查询权限空间下所有的角色列表 - * @description 分页查询权限空间下所有的角色列表,分页获取权限空间下所有的角色列表。 - **/ - public PermissionNamespaceRolesListPaginatedRespDto listPermissionNamespaceRoles( - ListPermissionNamespaceRolesDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-permission-namespace-roles"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, PermissionNamespaceRolesListPaginatedRespDto.class); - } - - /** - * @summary 创建数据资源 - * @description 该接口用于创建数据资源,通过数据资源所属权限空间 Code、数据资源名称、数据资源 Code、数据资源类型(STRING、ARRAY、TREE)以及数据操作列表进行创建, - * 通过不同的数据资源类型适配不同的场景。 - *

- * ### 创建数据资源字符串类型示例 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "resourceName": "字符串资源1", - * "resourceCode": "str1", "type": "STRING", "description": "这是一个数据资源字符串类型创建", "struct":"str1", - * "actions": ["get","read","update"] } ``` - *

- * ### 创建数据资源数组类型示例 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "resourceName": "数组资源1", - * "resourceCode": "array1", "description": "这是一个数据资源数组类型创建", "type": "ARRAY", - * "struct":["array1", "array2", "array3"], "actions": ["get","read","update"] } ``` - *

- * ### 创建数据资源树类型示例 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "resourceName": "树资源1", - * "resourceCode": "tree1", "description": "这是一个数据资源树类型创建", "type": "TREE", "struct":[{ "code": - * "tree1", "name": "tree1", "value": "tree1", "children": [{ "code": "tree2", "name": "tree2", - * "value": "tree2", "children": [{ "code": "tree3", "name": "tree3", "value": "tree3" }] }] }], - * "actions": ["get","read","update"] } ``` - **/ - public CreateDataResourceResponseDto createDataResource(CreateDataResourceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-data-resource"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CreateDataResourceResponseDto.class); - } - - /** - * @summary 创建字符串数据资源 - * @description 创建字符串数据资源,通过数据资源所属权限空间 Code、数据资源名称、数据资源 Code、数据资源节点和数据资源权限操作等字段进行创建 - **/ - public CreateStringDataResourceResponseDto createDataResourceByString( - CreateStringDataResourceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-string-data-resource"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CreateStringDataResourceResponseDto.class); - } - - /** - * @summary 创建数组数据资源 - * @description 创建字符串数据资源,通过数据资源所属权限空间 Code、数据资源名称、数据资源 Code、数据资源节点和数据资源权限操作等字段进行创建 - **/ - public CreateArrayDataResourceResponseDto createDataResourceByArray( - CreateArrayDataResourceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-array-data-resource"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CreateArrayDataResourceResponseDto.class); - } - - /** - * @summary 创建树数据资源 - * @description 创建树数据资源,通过数据资源所属权限空间 Code、数据资源名称、数据资源 Code、数据资源节点和数据资源权限操作等字段进行创建 - **/ - public CreateTreeDataResourceResponseDto createDataResourceByTree( - CreateTreeDataResourceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-tree-data-resource"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CreateTreeDataResourceResponseDto.class); - } - - /** - * @summary 获取数据资源列表 - * @description 获取数据资源列表, 可通过数据资源名称、数据资源 Code 和数据资源所属权限空间 Code 列表进行指定筛选。 - **/ - public ListDataResourcesPaginatedRespDto listDataResources(ListDataResourcesDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-data-resources"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, ListDataResourcesPaginatedRespDto.class); - } - - /** - * @summary 获取数据资源信息 - * @description 获取数据资源, 通过数据资源 ID 查询对应的数据资源信息,包含数据资源名称、数据资源 Code、数据资源类型(TREE、STRING、ARRAY)、数据资源所属权限空间 - * ID、数据资源所属权限空间 Code 以及数据资源操作列表等基本信息。 - **/ - public GetDataResourceResponseDto getDataResource(GetDataResourceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-data-resource"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetDataResourceResponseDto.class); - } - - /** - * @summary 修改数据资源 - * @description 修改数据资源, 根据权限空间 Code 和数据资源 Code 查询原始信息,只允许修改数据资源名称、描述和数据资源节点。 - **/ - public UpdateDataResourceResponseDto updateDataResource(UpdateDataResourceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-data-resource"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, UpdateDataResourceResponseDto.class); - } - - /** - * @summary 删除数据资源 - * @description 删除数据资源, 根据数据资源 ID 删除对应的数据资源信息。 - **/ - public CommonResponseDto deleteDataResource(DeleteDataResourceDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-data-resource"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CommonResponseDto.class); - } - - /** - * @summary 检查数据资源名称或者 Code 是否可用 - * @description 检查数据资源名称或者 Code 在权限空间内是否有效,通过数据资源名称或者数据资源 Code 以及所属权限空间 Code,判断在指定的权限空间内是否可用。 - *

- * ### 数据资源 Code 有效示例 - *

- * - 入参 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "resourceCode": "test" } ``` - *

- * - 出参 - *

- * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 0, "data": { "isValid": "true" } } - * ``` - *

- * ### 数据资源名称有效示例 - *

- * - 入参 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "resourceName": "test" } ``` - *

- * - 出参 - *

- * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 0, "data": { "isValid": "true" } } - * ``` - *

- * ### 数据资源 Code 无效示例 - *

- * - 入参 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "resourceCode": "test" } ``` - *

- * - 出参 - *

- * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 0, "requestId": - * "934108e5-9fbf-4d24-8da1-c330328abd6c", "data": { "isValid": "false", "message": "data - * resource code already exist" } } ``` - **/ - public CheckParamsDataResourceResponseDto checkDataResourceExists( - CheckDataResourceExistsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/check-data-resource-exists"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, CheckParamsDataResourceResponseDto.class); - } - - /** - * @summary 创建数据策略 - * @description 创建数据策略,通过数据策略名称、数据策略描述以及资源节点列表进行创建,数据策略支持跨多个权限空间进行数据资源创建,并且支持创建时设置数据资源是否具有操作权限。 - *

- * ```json { "policyName": "示例数据策略", "description": "这是一个示例数据策略", "statementList": [ { "effect": - * "ALLOW", "permissions": [ "examplePermissionNamespaceCode/strResourceCode/exampleAction", - * "examplePermissionNamespaceCode/arrResourceCode/exampleAction", - * "examplePermissionNamespaceCode/treeResourceCode/strutCode1/exampleAction" ] }, { "effect": - * "DENY", "permissions": [ "examplePermissionNamespaceCode/strResourceCode1/exampleAction", - * "examplePermissionNamespaceCode/arrResourceCode1/exampleAction", - * "examplePermissionNamespaceCode/treeResourceCode1/strutCode1/exampleAction" ] } ] } ``` - **/ - public CreateDataPolicyResponseDto createDataPolicy(CreateDataPolicyDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-data-policy"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CreateDataPolicyResponseDto.class); - } - - /** - * @summary 获取数据策略列表 - * @description 分页查询数据策略列表,也可通过关键字搜索数据策略名称或者数据策略 Code 进行模糊查找。 - **/ - public ListDataPoliciesPaginatedRespDto listDataPolices(ListDataPoliciesDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-data-policies"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, ListDataPoliciesPaginatedRespDto.class); - } - - /** - * @summary 获取数据策略简略信息列表 - * @description 分页获取数据策略简略信息列表,通过关键字搜索数据策略名称或者数据策略 Code 进行模糊查找出数据策略 ID、数据策略名称和数据策略描述信息。 - **/ - public ListSimpleDataPoliciesPaginatedRespDto listSimpleDataPolices( - ListSimpleDataPoliciesDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-simple-data-policies"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, ListSimpleDataPoliciesPaginatedRespDto.class); - } - - /** - * @summary 获取数据策略信息 - * @description 获取数据策略信息,通过数据策略 ID 获取对应数据策略信息,包含数据策略 ID、数据策略名称、数据策略描述、数据策略下所有的数据权限列表等信息。 - **/ - public GetDataPolicyResponseDto getDataPolicy(GetDataPolicyDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-data-policy"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetDataPolicyResponseDto.class); - } - - /** - * @summary 修改数据策略 - * @description 修改数据策略,通过数据策略名称、数据策略描述和相关的数据资源等字段修改数据策略信息。 - **/ - public UpdateDataPolicyResponseDto updateDataPolicy(UpdateDataPolicyDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-data-policy"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, UpdateDataPolicyResponseDto.class); - } - - /** - * @summary 删除数据策略 - * @description 删除数据策略,通过数据策略 ID 删除对应的策略,同时也删除数据策略和对应的数据资源等关系数据。 - **/ - public CommonResponseDto deleteDataPolicy(DeleteDataPolicyDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-data-policy"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CommonResponseDto.class); - } - - /** - * @summary 校验数据策略名称是否存在 - * @description 通过数据策略名称查询用户池内是否存在。 - **/ - public CheckParamsDataPolicyResponseDto checkDataPolicyExists(CheckDataPolicyExistsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/check-data-policy-exists"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, CheckParamsDataPolicyResponseDto.class); - } - - /** - * @summary 获取数据策略下所有的授权主体的信息 - * @description 获取数据策略下所有的授权主体的信息,通过授权主体类型、数据策略 ID 和数据资源 ID 查找授权主体列表。 - **/ - public ListDataPolicySubjectPaginatedRespDto listDataPolicyTargets( - ListDataPolicyTargetsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-data-policy-targets"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, ListDataPolicySubjectPaginatedRespDto.class); - } - - /** - * @summary 授权数据策略 - * @description 数据策略创建主体授权,通过授权主体和数据策略进行相互授权。 - **/ - public CommonResponseDto authorizeDataPolicies(CreateAuthorizeDataPolicyDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/authorize-data-policies"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CommonResponseDto.class); - } - - /** - * @summary 撤销数据策略 - * @description 删除数据策略相关的主体授权,通过授权主体 ID、授权主体类型和数据策略 ID 进行删除。 - **/ - public CommonResponseDto revokeDataPolicy(DeleteAuthorizeDataPolicyDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/revoke-data-policy"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CommonResponseDto.class); - } - - /** - * @summary 获取用户权限列表 - * @description 该接口用于用户列表权限查询,可以通过用户 ID 列表进行批量查询权限,也可以通过查询多个用户在同一个权限空间的权限,不同数据资源类型返回相应的资源结果。 - *

- * ### 查询一个用户拥有的数组资源、字符串资源和树资源权限列表示例 - *

- * - 入参 - *

- * ```json { "userIds": [ "6301ceaxxxxxxxxxxx27478" ] } ``` - *

- * - 出参 - *

- * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data": { - * "userPermissionList": [ { "userId": "6301ceaxxxxxxxxxxx27478", "namespaceCode": - * "examplePermissionNamespace", "resourceList": [ { "resourceCode": "strCode", "resourceType": - * "STRING", "strAuthorize": { "value": "示例字符串资源", "actions": [ "read", "post", "get", "write" ] - * } }, { "resourceCode": "arrayCode", "resourceType": "ARRAY", "arrAuthorize": { "values": [ - * "示例数据资源1", "示例数据资源2" ], "actions": [ "read", "post", "get", "write" ] } }, { "resourceCode": - * "treeCode", "resourceType": "TREE", "treeAuthorize": { "authList": [ { "nodePath": - * "/treeChildrenCode/treeChildrenCode1", "nodeActions": [ "read", "get" ], "nodeName": - * "treeChildrenName1", "nodeValue": "treeChildrenValue1" }, { "nodePath": - * "/treeChildrenCode/treeChildrenCode2", "nodeActions": [ "read", "get" ], "nodeName": - * "treeChildrenName2", "nodeValue": "treeChildrenValue2" }, { "nodePath": - * "/treeChildrenCode/treeChildrenCode3", "nodeActions": [ "read" ], "nodeName": - * "treeChildrenName3", "nodeValue": "treeChildrenValue3" } ] } } ] } ] } } ``` - *

- * ### 查询多个用户权限列表示例 - *

- * - 入参 - *

- * ```json { "userIds": [ "6301ceaxxxxxxxxxxx27478", "6121ceaxxxxxxxxxxx27312" ] } ``` - *

- * - 出参 - *

- * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data": { - * "userPermissionList": [ { "userId": "6301ceaxxxxxxxxxxx27478", "namespaceCode": - * "examplePermissionNamespace1", "resourceList": [ { "resourceCode": "strCode", "resourceType": - * "STRING", "strAuthorize": { "value": "示例字符串资源", "actions": [ "read", "post", "get", "write" ] - * } } ] }, { "userId": "6121ceaxxxxxxxxxxx27312", "namespaceCode": - * "examplePermissionNamespace2", "resourceList": [ { "resourceCode": "arrayCode", - * "resourceType": "ARRAY", "arrAuthorize": { "values": [ "示例数组资源1", "示例数组资源2" ], "actions": [ - * "read", "post", "get", "write" ] } } ] } ] } } ``` - *

- * ### 查询多个用户在多个权限空间下权限列表示例 - *

- * - 入参 - *

- * ```json { "userIds": [ "6301ceaxxxxxxxxxxx27478", "6121ceaxxxxxxxxxxx27312" ], - * "namespaceCodes": [ "examplePermissionNamespace1", "examplePermissionNamespace2" ] } ``` - *

- * - 出参 - *

- * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data": { - * "userPermissionList": [ { "userId": "6301ceaxxxxxxxxxxx27478", "namespaceCode": - * "examplePermissionNamespace1", "resourceList": [ { "resourceCode": "strCode1", - * "resourceType": "STRING", "strAuthorize": { "value": "示例字符串资源", "actions": [ "read", "post", - * "get", "write" ] } } ] }, { "userId": "6121ceaxxxxxxxxxxx27312", "namespaceCode": - * "examplePermissionNamespace2", "resourceList": [ { "resourceCode": "arrayCode", - * "resourceType": "ARRAY", "arrAuthorize": { "values": [ "示例数组资源1", "示例数组资源2" ], "actions": [ - * "read", "post", "get", "write" ] } } ] } ] } } ``` - **/ - public GetUserPermissionListRespDto getUserPermissionList(GetUserPermissionListDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-permission-list"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, GetUserPermissionListRespDto.class); - } - - /** - * @summary 判断用户权限 - * @description 该接口用于判断用户权限,通过权限空间 Code、用户 ID、资源操作以及资源列表来判断用户是否对资源拥有操作权限。可选传条件属性参数,默认不开启条件判断。 - *

- * ### 判断用户对字符串和数组资源权限示例(无条件判断) - *

- * - 入参 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "userId": - * "63721xxxxxxxxxxxxdde14a3", "action": "get", "resources":["strResourceCode1", - * "arrayResourceCode1"] } ``` - *

- * - 出参 - *

- * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data": { - * "checkResultList": [ { "namespaceCode": "examplePermissionNamespace", "resource": - * "strResourceCode1", "action": "get", "enabled": true }, { "namespaceCode": - * "examplePermissionNamespace", "resource": "arrayResourceCode1", "action": "get", "enabled": - * true } ] } } ``` - *

- * ### 判断用户对字符串和数组资源权限示例(开启条件判断) - *

- * - 入参 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "userId": - * "63721xxxxxxxxxxxxdde14a3", "action": "get", "resources": ["strResourceCode1", - * "arrayResourceCode1"], "judgeConditionEnabled": true, "authEnvParams":{ "ip":"110.96.0.0", - * "city":"北京", "province":"北京", "country":"中国", "deviceType":"PC", "systemType":"ios", - * "browserType":"IE", "requestDate":"2022-12-26 17:40:00" } } ``` - *

- * - 出参 - *

- * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data": { - * "checkResultList": [ { "namespaceCode": "examplePermissionNamespace", "resource": - * "strResourceCode1", "action": "get", "enabled": false }, { "namespaceCode": - * "examplePermissionNamespace", "resource": "arrayResourceCode1", "action": "get", "enabled": - * false } ] } } ``` - *

- * ### 判断用户对树资源权限示例 - *

- * - 入参 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "userId": - * "63721xxxxxxxxxxxxdde14a3", "action": "get" "resources":["treeResourceCode1/StructCode1/resourceStructChildrenCode1", - * "treeResourceCode2/StructCode1/resourceStructChildrenCode1"] } ``` - *

- * - 出参 - *

- * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "checkResultList": - * [{ "namespaceCode": "examplePermissionNamespace", "action": "get", "resource": - * "treeResourceCode1/StructCode1/resourceStructChildrenCode1", "enabled": true },{ - * "namespaceCode": "examplePermissionNamespace", "action": "get", "resource": - * "treeResourceCode2/StructCode1/resourceStructChildrenCode1", "enabled": true }] } } ``` - **/ - public CheckPermissionRespDto checkPermission(CheckPermissionDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/check-permission"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CheckPermissionRespDto.class); - } - - /** - * @summary 判断外部用户权限 - * @description 判断外部用户权限 - **/ - public CheckExternalUserPermissionRespDto checkExternalUserPermission( - CheckExternalUserPermissionDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/check-external-user-permission"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CheckExternalUserPermissionRespDto.class); - } - - /** - * @summary 获取用户指定资源权限列表 - * @description 该接口主要用于获取用户指定资源的权限列表, 通过权限空间 Code、用户 ID 以及资源列表查询所有权限。 - *

- * ### 获取用户字符串和数组资源权限示例 - *

- * - 入参 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "userId": - * "63721xxxxxxxxxxxxdde14a3", "resources":["strResourceCode1", "arrayResourceCode1"] } ``` - *

- * - 出参 - *

- * ```json { - *

- * "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "permissionList": [{ - * "namespaceCode": "examplePermissionNamespace", "actionList": ["read","get"], "resource": - * "strResourceCode1" },{ "namespaceCode": "examplePermissionNamespace", "actionList": - * ["read","update","delete"], "resource": "arrayResourceCode1" }] } } ``` - *

- * ### 获取用户树资源权限示例 - *

- * - 入参 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "userId": - * "63721xxxxxxxxxxxxdde14a3", "resources":["treeResourceCode1/StructCode1/resourceStructChildrenCode1", - * "treeResourceCode2/StructCode1/resourceStructChildrenCode1"] } ``` - *

- * - 出参 - *

- * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "permissionList": - * [{ "namespaceCode": "examplePermissionNamespace", "actionList": ["read", "update", "delete"], - * "resource": "treeResourceCode1/StructCode1/resourceStructChildrenCode1" },{ "namespaceCode": - * "examplePermissionNamespace", "actionList": ["read", "get", "delete"], "resource": - * "treeResourceCode2/StructCode1/resourceStructChildrenCode1" }] } } ``` - **/ - public GetUserResourcePermissionListRespDto getUserResourcePermissionList( - GetUserResourcePermissionListDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-resource-permission-list"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, GetUserResourcePermissionListRespDto.class); - } - - /** - * @summary 获取资源被授权的用户列表 - * @description 该接口主要用于获取资源被授权的用户列表,通过权限空间 Code 、资源操作列表以及资源列表查询有权限的用户列表。 - *

- * ### 获取字符串和数组资源被授权的用户列表示例 - *

- * - 入参 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "actions": ["get", "update", - * "read"], "resources":["strResourceCode1", "arrayResourceCode1"] } ``` - *

- * - 出参 - *

- * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "authUserList": [{ - * "resource": "strResourceCode1", "actionAuthList": [{ "userIds": ["63721xxxxxxxxxxxxdde14a3"], - * "action": "get" },{ "userIds": ["63721xxxxxxxxxxxxdde14a3"], "action": "update" },{ - * "userIds": ["63721xxxxxxxxxxxxdde14a3"], "action": "read" }] },{ "resource": - * "arrayResourceCode1", "actionAuthList": [{ "userIds": ["63721xxxxxxxxxxxxdde14a3"], "action": - * "get" },{ "userIds": ["63721xxxxxxxxxxxxdde14a3"], "action": "update" },{ "userIds": - * ["63721xxxxxxxxxxxxdde14a3"], "action": "read" }] }] } } ``` - *

- * ### 获取树资源被授权的用户列表示例 - *

- * - 入参 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "actions": ["get", "update", - * "delete"], "resources":["treeResourceCode1/StructCode1/resourceStructChildrenCode1", - * "treeResourceCode2/StructCode1/resourceStructChildrenCode1"] } ``` - *

- * - 出参 - *

- * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "authUserList": [{ - * "resource": "treeResourceCode1/StructCode1/resourceStructChildrenCode1", "actionAuthList": [{ - * "userIds": ["63721xxxxxxxxxxxxdde14a3"], "action": "get" },{ "userIds": - * ["63721xxxxxxxxxxxxdde14a3"], "action": "update" },{ "userIds": ["63721xxxxxxxxxxxxdde14a3"], - * "action": "delete" }] },{ "resource": "treeResourceCode2/StructCode1/resourceStructChildrenCode1", - * "actionAuthList": [{ "userIds": ["63721xxxxxxxxxxxxdde14a3"], "action": "get" },{ "userIds": - * ["63721xxxxxxxxxxxxdde14a3"], "action": "update" },{ "userIds": ["63721xxxxxxxxxxxxdde14a3"], - * "action": "delete" }] }] } } ``` - **/ - public ListResourceTargetsRespDto listResourceTargets(ListResourceTargetsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-resource-targets"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, ListResourceTargetsRespDto.class); - } - - /** - * @summary 获取用户授权资源的结构列表 - * @description 该接口主要用于获取用户授权的资源列表,通过权限空间 Code、用户 Id、资源 Code 获取用户资源的授权列表,通过不同的资源类型返回对应资源的授权。 - *

- * ### 获取用户授权字符串数据资源示例 - *

- * - 入参 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "userId": - * "63721xxxxxxxxxxxxdde14a3", "resourceCode": "exampleStrResourceCode" } ``` - *

- * - 出参 - *

- * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "namespaceCode": - * "exampleNamespaceCode", "resourceCode": "exampleStrResourceCode", "resourceType": "STRING", - * "strResourceAuthAction":{ "value": "strTestValue", "actions": ["get","delete"] } } } ``` - *

- *

- * ### 获取用户授权数据数组资源示例 - *

- * - 入参 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "userId": - * "63721xxxxxxxxxxxxdde14a3", "resourceCode": "exampleArrResourceCode" } ``` - *

- * - 出参 - *

- * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "namespaceCode": - * "exampleNamespaceCode", "resourceCode": "exampleArrResourceCode", "resourceType": "ARRAY", - * "arrResourceAuthAction":{ "values": ["arrTestValue1","arrTestValue2","arrTestValue3"], - * "actions": ["get","delete"] } } } ``` - *

- *

- * ### 获取用户授权树数据资源示例 - *

- * - 入参 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "userId": - * "63721xxxxxxxxxxxxdde14a3", "resourceCode": "exampleArrResourceCode" } ``` - *

- * - 出参 - *

- * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "namespaceCode": - * "exampleNamespaceCode", "resourceCode": "exampleArrResourceCode", "resourceType": "TREE", - * "treeResourceAuthAction":{ "nodeAuthActionList":[{ "code": "tree11", "name": "tree11", - * "value": "test11Value", "actions": ["get","delete"], "children": [{ "code": "tree111", - * "name": "tree111", "value": "test111Value", "actions": ["update","read"], }] },{ "code": - * "tree22", "name": "tree22", "value": "test22Value", "actions": ["get","delete"], }] } } } - * ``` - **/ - public GetUserResourceStructRespDto getUserResourceStruct(GetUserResourceStructDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-user-resource-struct"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, GetUserResourceStructRespDto.class); - } - - /** - * @summary 获取外部用户授权资源的结构列表 - * @description 该接口主要用于获取外部用户授权的资源列表,通过权限空间 Code、外部用户 Id、资源 Code 获取外部用户资源的授权列表,通过不同的资源类型返回对应资源的授权。 - *

- *

- * ### 获取用户授权字符串数据资源示例 - *

- * - 入参 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "externalId": - * "63721xxxxxxxxxxxxdde14a3", "resourceCode": "exampleStrResourceCode" } ``` - *

- * - 出参 - *

- * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "namespaceCode": - * "exampleNamespaceCode", "resourceCode": "exampleStrResourceCode", "resourceType": "STRING", - * "strResourceAuthAction":{ "value": "strTestValue", "actions": ["get","delete"] } } } ``` - *

- *

- * ### 获取用户授权数据数组资源示例 - *

- * - 入参 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "externalId": - * "63721xxxxxxxxxxxxdde14a3", "resourceCode": "exampleArrResourceCode" } ``` - *

- * - 出参 - *

- * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "namespaceCode": - * "exampleNamespaceCode", "resourceCode": "exampleArrResourceCode", "resourceType": "ARRAY", - * "arrResourceAuthAction":{ "values": ["arrTestValue1","arrTestValue2","arrTestValue3"], - * "actions": ["get","delete"] } } } ``` - *

- *

- * ### 获取用户授权树数据资源示例 - *

- * - 入参 - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "externalId": - * "63721xxxxxxxxxxxxdde14a3", "resourceCode": "exampleArrResourceCode" } ``` - *

- * - 出参 - *

- * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "namespaceCode": - * "exampleNamespaceCode", "resourceCode": "exampleArrResourceCode", "resourceType": "TREE", - * "treeResourceAuthAction":{ "nodeAuthActionList":[{ "code": "tree11", "name": "tree11", - * "value": "test11Value", "actions": ["get","delete"], "children": [{ "code": "tree111", - * "name": "tree111", "value": "test111Value", "actions": ["update","read"], }] },{ "code": - * "tree22", "name": "tree22", "value": "test22Value", "actions": ["get","delete"], }] } } } - * ``` - **/ - public GetExternalUserResourceStructRespDto getExternalUserResourceStruct( - GetExternalUserResourceStructDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-external-user-resource-struct"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, GetExternalUserResourceStructRespDto.class); - } - - /** - * @summary 判断用户在树资源同层级下的权限 - * @description 该接口主要用于判断用户在树资源同层级下的权限,通过权限空间 Code 、用户 ID、资源操作、资源或资源子节点查询用户是否有该树资源同级路径的权限。可选传条件属性参数,默认不开启条件判断。 - *

- *

- * ### 判断用户在树资源同层级权限示例(无条件判断) - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "userId": - * "63721xxxxxxxxxxxxdde14a3", "action": "read", "resource": "treeResourceCode/structCode", - * "resourceNodeCodes": ["resourceStructChildrenCode1","resourceStructChildrenCode2","resourceStructChildrenCode3"] - * } ``` - *

- * ### 判断用户在树资源同层级权限示例(开启条件判断) - *

- * ```json { "namespaceCode": "examplePermissionNamespace", "userId": - * "63721xxxxxxxxxxxxdde14a3", "action": "read", "resource": "treeResourceCode/structCode", - * "resourceNodeCodes": ["resourceStructChildrenCode1","resourceStructChildrenCode2","resourceStructChildrenCode3"], - * "judgeConditionEnabled": true, "authEnvParams":{ "ip":"110.96.0.0", "city":"北京", - * "province":"北京", "country":"中国", "deviceType":"PC", "systemType":"ios", "browserType":"IE", - * "requestDate":"2022-12-26 17:40:00" } } ``` - **/ - public CheckUserSameLevelPermissionResponseDto checkUserSameLevelPermission( - CheckUserSameLevelPermissionDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/check-user-same-level-permission"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CheckUserSameLevelPermissionResponseDto.class); - } - - /** - * @summary 获取套餐详情 - * @description 获取当前用户池套餐详情。 - **/ - public CostGetCurrentPackageRespDto getCurrentPackageInfo() { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-current-package-info"); - config.setBody(new Object()); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, CostGetCurrentPackageRespDto.class); - } - - /** - * @summary 获取用量详情 - * @description 获取当前用户池用量详情。 - **/ - public CostGetCurrentUsageRespDto getUsageInfo() { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-usage-info"); - config.setBody(new Object()); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, CostGetCurrentUsageRespDto.class); - } - - /** - * @summary 获取 MAU 使用记录 - * @description 获取当前用户池 MAU 使用记录 - **/ - public CostGetMauPeriodUsageHistoryRespDto getMauPeriodUsageHistory( - GetMauPeriodUsageHistoryDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-mau-period-usage-history"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, CostGetMauPeriodUsageHistoryRespDto.class); - } - - /** - * @summary 获取所有权益 - * @description 获取当前用户池所有权益 - **/ - public CostGetAllRightItemRespDto getAllRightsItem() { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-all-rights-items"); - config.setBody(new Object()); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, CostGetAllRightItemRespDto.class); - } - - /** - * @summary 获取订单列表 - * @description 获取当前用户池订单列表 - **/ - public CostGetOrdersRespDto getOrders(GetOrdersDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-orders"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, CostGetOrdersRespDto.class); - } - - /** - * @summary 获取订单详情 - * @description 获取当前用户池订单详情 - **/ - public CostGetOrderDetailRespDto getOrderDetail(GetOrderDetailDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-order-detail"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, CostGetOrderDetailRespDto.class); - } - - /** - * @summary 获取订单支付明细 - * @description 获取当前用户池订单支付明细 - **/ - public CostGetOrderPayDetailRespDto getOrderPayDetail(GetOrderPayDetailDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-order-pay-detail"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, CostGetOrderPayDetailRespDto.class); - } - - /** - * @summary 创建 Pipeline 函数 - * @description 创建 Pipeline 函数 - **/ - public PipelineFunctionSingleRespDto createPipelineFunction(CreatePipelineFunctionDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-pipeline-function"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, PipelineFunctionSingleRespDto.class); - } - - /** - * @summary 获取 Pipeline 函数详情 - * @description 获取 Pipeline 函数详情 - **/ - public PipelineFunctionSingleRespDto getPipelineFunction(GetPipelineFunctionDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-pipeline-function"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, PipelineFunctionSingleRespDto.class); - } - - /** - * @summary 重新上传 Pipeline 函数 - * @description 当 Pipeline 函数上传失败时,重新上传 Pipeline 函数 - **/ - public PipelineFunctionSingleRespDto reuploadPipelineFunction( - ReUploadPipelineFunctionDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/reupload-pipeline-function"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, PipelineFunctionSingleRespDto.class); - } - - /** - * @summary 修改 Pipeline 函数 - * @description 修改 Pipeline 函数 - **/ - public PipelineFunctionSingleRespDto updatePipelineFunction(UpdatePipelineFunctionDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-pipeline-function"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, PipelineFunctionSingleRespDto.class); - } - - /** - * @summary 修改 Pipeline 函数顺序 - * @description 修改 Pipeline 函数顺序 - **/ - public CommonResponseDto updatePipelineOrder(UpdatePipelineOrderDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-pipeline-order"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CommonResponseDto.class); - } - - /** - * @summary 删除 Pipeline 函数 - * @description 删除 Pipeline 函数 - **/ - public CommonResponseDto deletePipelineFunction(DeletePipelineFunctionDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-pipeline-function"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CommonResponseDto.class); - } - - /** - * @summary 获取 Pipeline 函数列表 - * @description 获取 Pipeline 函数列表 - **/ - public PipelineFunctionPaginatedRespDto listPipelineFunctions(ListPipelineFunctionsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-pipeline-functions"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, PipelineFunctionPaginatedRespDto.class); - } - - /** - * @summary 获取 Pipeline 日志 - * @description 获取 Pipeline - **/ - public PipelineFunctionPaginatedRespDto getPipelineLogs(GetPipelineLogsDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-pipeline-logs"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, PipelineFunctionPaginatedRespDto.class); - } - - /** - * @summary 创建 Webhook - * @description 你需要指定 Webhook 名称、Webhook 回调地址、请求数据格式、用户真实名称来创建 Webhook。还可选是否启用、请求密钥进行创建 - **/ - public CreateWebhookRespDto createWebhook(CreateWebhookDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-webhook"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CreateWebhookRespDto.class); - } - - /** - * @summary 获取 Webhook 列表 - * @description 获取 Webhook 列表,可选页数、分页大小来获取 - **/ - public GetWebhooksRespDto listWebhooks(ListWebhooksDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-webhooks"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetWebhooksRespDto.class); - } - - /** - * @summary 修改 Webhook 配置 - * @description 需要指定 webhookId,可选 Webhook 名称、Webhook 回调地址、请求数据格式、用户真实名称、是否启用、请求密钥参数进行修改 webhook - **/ - public UpdateWebhooksRespDto updateWebhook(UpdateWebhookDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-webhook"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, UpdateWebhooksRespDto.class); - } - - /** - * @summary 删除 Webhook - * @description 通过指定多个 webhookId,以数组的形式进行 webhook 的删除,如果 webhookId 不存在,不提示报错 - **/ - public DeleteWebhookRespDto deleteWebhook(DeleteWebhookDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-webhook"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, DeleteWebhookRespDto.class); - } - - /** - * @summary 获取 Webhook 日志 - * @description 通过指定 webhookId,可选 page 和 limit 来获取 webhook 日志,如果 webhookId 不存在,不返回报错信息 - **/ - public ListWebhookLogsRespDto getWebhookLogs(ListWebhookLogs reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-webhook-logs"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, ListWebhookLogsRespDto.class); - } - - /** - * @summary 手动触发 Webhook 执行 - * @description 通过指定 webhookId,可选请求头和请求体进行手动触发 webhook 执行 - **/ - public TriggerWebhookRespDto triggerWebhook(TriggerWebhookDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/trigger-webhook"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, TriggerWebhookRespDto.class); - } - - /** - * @summary 获取 Webhook 详情 - * @description 根据指定的 webhookId 获取 webhook 详情 - **/ - public GetWebhookRespDto getWebhook(GetWebhookDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-webhook"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetWebhookRespDto.class); - } - - /** - * @summary 获取 Webhook 事件列表 - * @description 返回事件列表和分类列表 - **/ - public WebhookEventListRespDto getWebhookEventList() { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-webhook-event-list"); - config.setBody(new Object()); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, WebhookEventListRespDto.class); - } - - /** - * @summary 获取协作管理员 AK/SK 列表 - * @description 根据协作管理员 Id 获取协作管理员下所有的 AK/SK 列表 - **/ - public ListAccessKeyResponseDto getAccessKeyList(ListAccessKeyDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/list-access-key"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, ListAccessKeyResponseDto.class); - } - - /** - * @summary 获取协作管理员 AK/SK 详细信息 - * @description 获取协作管理员 AK/SK 详细信息,根据协作管理员 ID 和 accessKeyId 获取对应 AK/SK 的详细信息。 - **/ - public GetAccessKeyResponseDto getAccessKey(GetAccessKeyDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/get-access-key"); - config.setBody(reqDto); - config.setMethod("GET"); - String response = request(config); - return deserialize(response, GetAccessKeyResponseDto.class); - } - - /** - * @summary 创建协作管理员的 AK/SK - * @description 创建协作管理员的 AK/SK,根据协作管理员 ID 生成指定的 AK/SK。 - **/ - public CreateAccessKeyResponseDto createAccessKey(CreateAccessKeyDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/create-access-key"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CreateAccessKeyResponseDto.class); - } - - /** - * @summary 删除协作管理员的 AK/SK - * @description 删除协作管理员的 AK/SK,根据所选择的 AK/SK 的 accessKeyId 进行指定删除。 - **/ - public CommonResponseDto deleteAccessKey(DeleteAccessKeyDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/delete-access-key"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, CommonResponseDto.class); - } - - /** - * @summary 更新一个管理员 AccessKey - * @description 根据 AccessKeyId 更新一个管理员 AccessKey,目前只支持更新 status,status 支持 activated / revoked - **/ - public IsSuccessRespDto updateAccessKey(UpdateAccessKeyDto reqDto) { - AuthingRequestConfig config = new AuthingRequestConfig(); - config.setUrl("/api/v3/update-access-key"); - config.setBody(reqDto); - config.setMethod("POST"); - String response = request(config); - return deserialize(response, IsSuccessRespDto.class); - } - - + public ManagementClient(ManagementClientOptions options) { + super(options); + // 必要参数校验 + if (StrUtil.isBlank(options.getAccessKeyId())) { + throw new IllegalArgumentException("accessKeyId is required"); + } + if (StrUtil.isBlank(options.getAccessKeySecret())) { + throw new IllegalArgumentException("accessKeySecret is required"); + } + } + + public Object makeRequest(MakeRequestReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl(reqDto.getUrl()); + config.setBody(reqDto.getData()); + config.setMethod(reqDto.getMethod()); + String response = request(config); + return deserialize(response, Object.class); + } + + /** + * @summary 岗位列表 + * @description 岗位列表 + **/ + public PostPaginatedRespDto postList(ListPostDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-post"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, PostPaginatedRespDto.class); + } + + /** + * @summary 获取岗位 + * @description 获取岗位 + **/ + public CreatePostDto getPost(GetPostDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-post"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, CreatePostDto.class); + } + + /** + * @summary 获取用户关联岗位 + * @description 获取用户关联岗位 + **/ + public CreatePostDto getUserPost(GetUserPostDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-post"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, CreatePostDto.class); + } + + /** + * @summary 获取岗位信息 + * @description 根据岗位 id 获取岗位详情 + **/ + public PostRespDto getPostById(GetPostByIdListDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-post-by-id"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, PostRespDto.class); + } + + /** + * @summary 创建岗位 + * @description 创建岗位 + **/ + public CreatePostRespDto createPost(CreatePostDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-post"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CreatePostRespDto.class); + } + + /** + * @summary 更新岗位信息 + * @description 更新岗位信息 + **/ + public CreatePostRespDto updatePost(CreatePostDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-post"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CreatePostRespDto.class); + } + + /** + * @summary 删除岗位 + * @description 删除岗位 + **/ + public CommonResponseDto removePost(RemovePostDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/remove-post"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 用户关联岗位 + * @description 用户关联岗位 + **/ + public CommonResponseDto userConnectionPost(UserConnectionPostDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/user-connection-post"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 获取同步任务详情 + * @description 获取同步任务详情 + **/ + public SyncTaskSingleRespDto getSyncTask(GetSyncTaskDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-sync-task"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, SyncTaskSingleRespDto.class); + } + + /** + * @summary 获取同步任务列表 + * @description 获取同步任务列表 + **/ + public SyncTaskPaginatedRespDto listSyncTasks(ListSyncTasksDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-sync-tasks"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, SyncTaskPaginatedRespDto.class); + } + + /** + * @summary 创建同步任务 + * @description 创建同步任务 + **/ + public SyncTaskPaginatedRespDto createSyncTask(CreateSyncTaskDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-sync-task"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, SyncTaskPaginatedRespDto.class); + } + + /** + * @summary 修改同步任务 + * @description 修改同步任务 + **/ + public SyncTaskPaginatedRespDto updateSyncTask(UpdateSyncTaskDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-sync-task"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, SyncTaskPaginatedRespDto.class); + } + + /** + * @summary 执行同步任务 + * @description 执行同步任务 + **/ + public TriggerSyncTaskRespDto triggerSyncTask(TriggerSyncTaskDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/trigger-sync-task"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, TriggerSyncTaskRespDto.class); + } + + /** + * @summary 获取同步作业详情 + * @description 获取同步作业详情 + **/ + public SyncJobSingleRespDto getSyncJob(GetSyncJobDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-sync-job"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, SyncJobSingleRespDto.class); + } + + /** + * @summary 获取同步作业详情 + * @description 获取同步作业详情 + **/ + public SyncJobPaginatedRespDto listSyncJobs(ListSyncJobsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-sync-jobs"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, SyncJobPaginatedRespDto.class); + } + + /** + * @summary 获取同步作业详情 + * @description 获取同步作业详情 + **/ + public TriggerSyncTaskRespDto listSyncJobLogs(ListSyncJobLogsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-sync-job-logs"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, TriggerSyncTaskRespDto.class); + } + + /** + * @summary 获取同步风险操作列表 + * @description 获取同步风险操作列表 + **/ + public SyncRiskOperationPaginatedRespDto listSyncRiskOperations( + ListSyncRiskOperationsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-sync-risk-operations"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, SyncRiskOperationPaginatedRespDto.class); + } + + /** + * @summary 执行同步风险操作 + * @description 执行同步风险操作 + **/ + public TriggerSyncRiskOperationsRespDto triggerSyncRiskOperations( + TriggerSyncRiskOperationDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/trigger-sync-risk-operations"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, TriggerSyncRiskOperationsRespDto.class); + } + + /** + * @summary 取消同步风险操作 + * @description 取消同步风险操作 + **/ + public CancelSyncRiskOperationsRespDto cancelSyncRiskOperation( + CancelSyncRiskOperationDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/cancel-sync-risk-operation"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CancelSyncRiskOperationsRespDto.class); + } + + /** + * @summary 使用用户凭证登录 + * @description 此端点为基于直接 API 调用形式的登录端点,适用于你需要自建登录页面的场景。**此端点暂时不支持 MFA、信息补全、首次密码重置等流程,如有需要,请使用 OIDC + * 标准协议认证端点。** + *

+ *

+ * 注意事项:取决于你在 Authing 创建应用时选择的**应用类型**和应用配置的**换取 token 身份验证方式**,在调用此接口时需要对客户端的身份进行不同形式的验证。 + * + *

+ * 点击展开详情 + * + *
+ *

+ * 你可以在 [Authing 控制台](https://console.authing.cn) 的**应用** - **自建应用** - **应用详情** - **应用配置** - + * **其他设置** - **授权配置** 中找到**换取 token 身份验证方式** 配置项: + *

+ * > 单页 Web 应用和客户端应用隐藏,默认为 `none`,不允许修改;后端应用和标准 Web 应用可以修改此配置项。 + *

+ * ![](https://files.authing.co/api-explorer/tokenAuthMethod.jpg) + *

+ * #### 换取 token 身份验证方式为 none 时 + *

+ * 调用此接口不需要进行额外操作。 + *

+ * #### 换取 token 身份验证方式为 client_secret_post 时 + *

+ * 调用此接口时必须在 body 中传递 `client_id` 和 `client_secret` 参数,作为验证客户端身份的条件。其中 `client_id` 为应用 + * ID、`client_secret` 为应用密钥。 + *

+ * #### 换取 token 身份验证方式为 client_secret_basic 时 + *

+ * 调用此接口时必须在 HTTP 请求头中携带 `authorization` 请求头,作为验证客户端身份的条件。`authorization` 请求头的格式如下(其中 `client_id` + * 为应用 ID、`client_secret` 为应用密钥。): + *

+ * ``` Basic base64(:) ``` + *

+ * 结果示例: + *

+ * ``` Basic NjA2M2ZiMmYzY3h4eHg2ZGY1NWYzOWViOjJmZTdjODdhODFmODY3eHh4eDAzMjRkZjEyZGFlZGM3 ``` + *

+ * JS 代码示例: + *

+ * ```js 'Basic ' + Buffer.from(client_id + ':' + client_secret).toString('base64'); ``` + * + *

+ **/ + public LoginTokenRespDto signInByCredentials(SigninByCredentialsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/signin"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, LoginTokenRespDto.class); + } + + /** + * @summary 使用移动端社会化登录 + * @description 此端点为移动端社会化登录接口,使用第三方移动社会化登录返回的临时凭证登录,并换取用户的 `id_token` 和 + * `access_token`。请先阅读相应社会化登录的接入流程。 + *

+ *

+ * 注意事项:取决于你在 Authing 创建应用时选择的**应用类型**和应用配置的**换取 token 身份验证方式**,在调用此接口时需要对客户端的身份进行不同形式的验证。 + * + *

+ * 点击展开详情 + * + *
+ *

+ * 你可以在 [Authing 控制台](https://console.authing.cn) 的**应用** - **自建应用** - **应用详情** - **应用配置** - + * **其他设置** - **授权配置** 中找到**换取 token 身份验证方式** 配置项: + *

+ * > 单页 Web 应用和客户端应用隐藏,默认为 `none`,不允许修改;后端应用和标准 Web 应用可以修改此配置项。 + *

+ * ![](https://files.authing.co/api-explorer/tokenAuthMethod.jpg) + *

+ * #### 换取 token 身份验证方式为 none 时 + *

+ * 调用此接口不需要进行额外操作。 + *

+ * #### 换取 token 身份验证方式为 client_secret_post 时 + *

+ * 调用此接口时必须在 body 中传递 `client_id` 和 `client_secret` 参数,作为验证客户端身份的条件。其中 `client_id` 为应用 + * ID、`client_secret` 为应用密钥。 + *

+ * #### 换取 token 身份验证方式为 client_secret_basic 时 + *

+ * 调用此接口时必须在 HTTP 请求头中携带 `authorization` 请求头,作为验证客户端身份的条件。`authorization` 请求头的格式如下(其中 `client_id` + * 为应用 ID、`client_secret` 为应用密钥。): + *

+ * ``` Basic base64(:) ``` + *

+ * 结果示例: + *

+ * ``` Basic NjA2M2ZiMmYzY3h4eHg2ZGY1NWYzOWViOjJmZTdjODdhODFmODY3eHh4eDAzMjRkZjEyZGFlZGM3 ``` + *

+ * JS 代码示例: + *

+ * ```js 'Basic ' + Buffer.from(client_id + ':' + client_secret).toString('base64'); ``` + * + *

+ **/ + public LoginTokenRespDto signInByMobile(SigninByMobileDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/signin-by-mobile"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, LoginTokenRespDto.class); + } + + /** + * @summary 获取支付宝 AuthInfo + * @description 此接口用于获取发起支付宝认证需要的[初始化参数 AuthInfo](https://opendocs.alipay.com/open/218/105325)。 + **/ + public GetAlipayAuthInfoRespDto getAlipayAuthInfo(GetAlipayAuthinfoDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-alipay-authinfo"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetAlipayAuthInfoRespDto.class); + } + + /** + * @summary 生成用于登录的二维码 + * @description 生成用于登录的二维码,目前支持生成微信公众号扫码登录、小程序扫码登录、自建移动 APP 扫码登录的二维码。 + **/ + public GeneQRCodeRespDto geneQrCode(GenerateQrcodeDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/gene-qrcode"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, GeneQRCodeRespDto.class); + } + + /** + * @summary 查询二维码状态 + * @description + * 按照用户扫码顺序,共分为未扫码、已扫码等待用户确认、用户同意/取消授权、二维码过期以及未知错误六种状态,前端应该通过不同的状态给到用户不同的反馈。你可以通过下面这篇文章了解扫码登录详细的流程:https://docs.authing.cn/v2/concepts/how-qrcode-works.html. + **/ + public CheckQRCodeStatusRespDto checkQrCodeStatus(CheckQrcodeStatusDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/check-qrcode-status"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, CheckQRCodeStatusRespDto.class); + } + + /** + * @summary 使用二维码 ticket 换取 TokenSet + * @description 此端点为使用二维码的 ticket 换取用户的 `access_token` 和 `id_token`。 + *

+ *

+ * 注意事项:取决于你在 Authing 创建应用时选择的**应用类型**和应用配置的**换取 token 身份验证方式**,在调用此接口时需要对客户端的身份进行不同形式的验证。 + * + *

+ * 点击展开详情 + * + *
+ *

+ * 你可以在 [Authing 控制台](https://console.authing.cn) 的**应用** - **自建应用** - **应用详情** - **应用配置** - + * **其他设置** - **授权配置** 中找到**换取 token 身份验证方式** 配置项: + *

+ * > 单页 Web 应用和客户端应用隐藏,默认为 `none`,不允许修改;后端应用和标准 Web 应用可以修改此配置项。 + *

+ * ![](https://files.authing.co/api-explorer/tokenAuthMethod.jpg) + *

+ * #### 换取 token 身份验证方式为 none 时 + *

+ * 调用此接口不需要进行额外操作。 + *

+ * #### 换取 token 身份验证方式为 client_secret_post 时 + *

+ * 调用此接口时必须在 body 中传递 `client_id` 和 `client_secret` 参数,作为验证客户端身份的条件。其中 `client_id` 为应用 + * ID、`client_secret` 为应用密钥。 + *

+ * #### 换取 token 身份验证方式为 client_secret_basic 时 + *

+ * 调用此接口时必须在 HTTP 请求头中携带 `authorization` 请求头,作为验证客户端身份的条件。`authorization` 请求头的格式如下(其中 `client_id` + * 为应用 ID、`client_secret` 为应用密钥。): + *

+ * ``` Basic base64(:) ``` + *

+ * 结果示例: + *

+ * ``` Basic NjA2M2ZiMmYzY3h4eHg2ZGY1NWYzOWViOjJmZTdjODdhODFmODY3eHh4eDAzMjRkZjEyZGFlZGM3 ``` + *

+ * JS 代码示例: + *

+ * ```js 'Basic ' + Buffer.from(client_id + ':' + client_secret).toString('base64'); ``` + * + *

+ **/ + public LoginTokenRespDto exchangeTokenSetWithQrCodeTicket( + ExchangeTokenSetWithQRcodeTicketDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/exchange-tokenset-with-qrcode-ticket"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, LoginTokenRespDto.class); + } + + /** + * @summary 自建 APP 扫码登录:APP 端修改二维码状态 + * @description 此端点用于在自建 APP 扫码登录中修改二维码状态,对应着在浏览器渲染出二维码之后,终端用户扫码、确认授权、取消授权的过程。**此接口要求具备用户的登录态**。 + **/ + public CommonResponseDto changeQrCodeStatus(ChangeQRCodeStatusDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/change-qrcode-status"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 推送登录 + * @description 推送登录。 + **/ + public GenePushCodeRespDto signInByPush(SignInByPushDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/signin-by-push"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, GenePushCodeRespDto.class); + } + + /** + * @summary 查询推送码状态 + * @description 按照推送码使用顺序,共分为已推送、等待用户 同意/取消 授权、推送码过期以及未知错误五种状态,前端应该通过不同的状态给到用户不同的反馈。 + **/ + public CheckPushCodeStatusRespDto checkPushCodeStatus(CheckPushcodeStatusDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/check-pushcode-status"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, CheckPushCodeStatusRespDto.class); + } + + /** + * @summary 推送登录:APP 端修改推送码状态 + * @description 此端点用于在 Authing 令牌 APP + * 推送登录中修改推送码状态,对应着在浏览器使用推送登录,点击登录之后,终端用户收到推送登录信息,确认授权、取消授权的过程。**此接口要求具备用户的登录态**。 + **/ + public CommonResponseDto changePushCodeStatus(ChangePushCodeStatusDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/change-pushcode-status"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 注册 + * @description 此端点目前支持以下几种基于的注册方式: + *

+ * 1. 基于密码(PASSWORD):用户名 + 密码,邮箱 + 密码。 2. 基于一次性临时验证码(PASSCODE):手机号 + 验证码,邮箱 + + * 验证码。你需要先调用发送短信或者发送邮件接口获取验证码。 + *

+ * 社会化登录等使用外部身份源“注册”请直接使用**登录**接口,我们会在其第一次登录的时候为其创建一个新账号。 + **/ + public UserSingleRespDto signUp(SignUpDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/signup"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, UserSingleRespDto.class); + } + + /** + * @summary 获取登录日志 + * @description 获取登录日志 + **/ + public GetLoginHistoryRespDto getLoginHistory(GetMyLoginHistoryDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-my-login-history"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetLoginHistoryRespDto.class); + } + + /** + * @summary 获取登录应用 + * @description 获取登录应用 + **/ + public GetLoggedInAppsRespDto getLoggedInApps() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-my-logged-in-apps"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetLoggedInAppsRespDto.class); + } + + /** + * @summary 获取具备访问权限的应用 + * @description 获取具备访问权限的应用 + **/ + public GetAccessibleAppsRespDto getAccessibleApps() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-my-accessible-apps"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetAccessibleAppsRespDto.class); + } + + /** + * @summary 获取租户列表 + * @description 获取租户列表 + **/ + public GetTenantListRespDto getTenantList() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-my-tenant-list"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetTenantListRespDto.class); + } + + /** + * @summary 获取角色列表 + * @description 获取角色列表 + **/ + public RoleListRespDto getRoleList(GetMyRoleListDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-my-role-list"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, RoleListRespDto.class); + } + + /** + * @summary 获取分组列表 + * @description 获取分组列表 + **/ + public GroupListRespDto getGroupList() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-my-group-list"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GroupListRespDto.class); + } + + /** + * @summary 获取部门列表 + * @description 此接口用于获取用户的部门列表,可根据一定排序规则进行排序。 + **/ + public UserDepartmentPaginatedRespDto getDepartmentList(GetMyDepartmentListDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-my-department-list"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, UserDepartmentPaginatedRespDto.class); + } + + /** + * @summary 获取被授权的资源列表 + * @description 此接口用于获取用户被授权的资源列表。 + **/ + public AuthorizedResourcePaginatedRespDto getAuthorizedResources( + GetAuthorizedResourcesDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-my-authorized-resources"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, AuthorizedResourcePaginatedRespDto.class); + } + + /** + * @summary 获取/搜索用户列表 + * @description 此接口用于获取用户列表,支持模糊搜索,以及通过用户基础字段、用户自定义字段、用户所在部门、用户历史登录应用等维度筛选用户。 + *

+ * ### 模糊搜素示例 + *

+ * 模糊搜索默认会从 `phone`, `email`, `name`, `username`, `nickname` 五个字段对用户进行模糊搜索,你也可以通过设置 + * `options.fuzzySearchOn` 决定模糊匹配的字段范围: + *

+ * ```json { "keywords": "北京", "options": { "fuzzySearchOn": [ "address" ] } } ``` + *

+ * ### 高级搜索示例 + *

+ * 你可以通过 `advancedFilter` 进行高级搜索,高级搜索支持通过用户的基础信息、自定义数据、所在部门、用户来源、登录应用、外部身份源信息等维度对用户进行筛选。 + * **且这些筛选条件可以任意组合。** + *

+ * #### 筛选状态为禁用的用户 + *

+ * 用户状态(`status`)为字符串类型,可选值为 `Activated` 和 `Suspended`: + *

+ * ```json { "advancedFilter": [ { "field": "status", "operator": "EQUAL", "value": "Suspended" } + * ] } ``` + *

+ * #### 筛选邮箱中包含 `@example.com` 的用户 + *

+ * 用户邮箱(`email`)为字符串类型,可以进行模糊搜索: + *

+ * ```json { "advancedFilter": [ { "field": "email", "operator": "CONTAINS", "value": + * "@example.com" } ] } ``` + *

+ * #### 根据用户的任意扩展字段进行搜索 + *

+ * ```json { "advancedFilter": [ { "field": "some-custom-key", "operator": "EQUAL", "value": + * "some-value" } ] } ``` + *

+ * #### 根据用户登录次数筛选 + *

+ * 筛选登录次数大于 10 的用户: + *

+ * ```json { "advancedFilter": [ { "field": "loginsCount", "operator": "GREATER", "value": 10 } ] + * } ``` + *

+ * 筛选登录次数在 10 - 100 次的用户: + *

+ * ```json { "advancedFilter": [ { "field": "loginsCount", "operator": "BETWEEN", "value": [10, + * 100] } ] } ``` + *

+ * #### 根据用户上次登录时间进行筛选 + *

+ * 筛选最近 7 天内登录过的用户: + *

+ * ```json { "advancedFilter": [ { "field": "lastLoginTime", "operator": "GREATER", "value": new + * Date(Date.now() - 7 * 24 * 60 * 60 * 1000) } ] } ``` + *

+ * 筛选在某一段时间内登录过的用户: + *

+ * ```json { "advancedFilter": [ { "field": "lastLogin", "operator": "BETWEEN", "value": [ + * Date.now() - 14 * 24 * 60 * 60 * 1000, Date.now() - 7 * 24 * 60 * 60 * 1000 ] } ] } ``` + *

+ * #### 根据用户曾经登录过的应用筛选 + *

+ * 筛选出曾经登录过应用 `appId1` 或者 `appId2` 的用户: + *

+ * ```json { "advancedFilter": [ { "field": "loggedInApps", "operator": "IN", "value": [ "appId1", + * "appId2" ] } ] } ``` + *

+ * #### 根据用户所在部门进行筛选 + *

+ * ```json { "advancedFilter": [ { "field": "department", "operator": "IN", "value": [ { + * "organizationCode": "steamory", "departmentId": "root", "departmentIdType": "department_id", + * "includeChildrenDepartments": true } ] } ] } ``` + **/ + public UserPaginatedRespDto listUsers(ListUsersRequestDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-users"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, UserPaginatedRespDto.class); + } + + /** + * @summary 获取用户列表 + * @description 获取用户列表接口,支持分页,可以选择获取自定义数据、identities 等。 + * @deprecated + **/ + public UserPaginatedRespDto listUsersLegacy(ListUsersDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-users"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, UserPaginatedRespDto.class); + } + + /** + * @summary 获取用户信息 + * @description 通过用户 ID,获取用户详情,可以选择获取自定义数据、identities、选择指定用户 ID 类型等。 + **/ + public UserSingleRespDto getUser(GetUserDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, UserSingleRespDto.class); + } + + /** + * @summary 批量获取用户信息 + * @description 通过用户 ID 列表,批量获取用户信息,可以选择获取自定义数据、identities、选择指定用户 ID 类型等。 + **/ + public UserListRespDto getUserBatch(GetUserBatchDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-batch"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, UserListRespDto.class); + } + + /** + * @summary 创建用户 + * @description 创建用户,邮箱、手机号、用户名必须包含其中一个,邮箱、手机号、用户名、externalId + * 用户池内唯一,此接口将以管理员身份创建用户因此不需要进行手机号验证码检验等安全检测。 + **/ + public UserSingleRespDto createUser(CreateUserReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-user"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, UserSingleRespDto.class); + } + + /** + * @summary 批量创建用户 + * @description 批量创建用户,邮箱、手机号、用户名必须包含其中一个,邮箱、手机号、用户名、externalId + * 用户池内唯一,此接口将以管理员身份创建用户因此不需要进行手机号验证码检验等安全检测。 + **/ + public UserListRespDto createUsersBatch(CreateUserBatchReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-users-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, UserListRespDto.class); + } + + /** + * @summary 修改用户资料 + * @description 通过用户 ID,修改用户资料,邮箱、手机号、用户名、externalId 用户池内唯一,此接口将以管理员身份修改用户资料因此不需要进行手机号验证码检验等安全检测。 + **/ + public UserSingleRespDto updateUser(UpdateUserReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-user"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, UserSingleRespDto.class); + } + + /** + * @summary 批量修改用户资料 + * @description 批量修改用户资料,邮箱、手机号、用户名、externalId 用户池内唯一,此接口将以管理员身份修改用户资料因此不需要进行手机号验证码检验等安全检测。 + **/ + public UserListRespDto updateUserBatch(UpdateUserBatchReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-user-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, UserListRespDto.class); + } + + /** + * @summary 删除用户 + * @description 通过用户 ID 列表,删除用户,支持批量删除,可以选择指定用户 ID 类型等。 + **/ + public IsSuccessRespDto deleteUsersBatch(DeleteUsersBatchDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-users-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 获取用户的外部身份源 + * @description 通过用户 ID,获取用户的外部身份源、选择指定用户 ID 类型。 + **/ + public IdentityListRespDto getUserIdentities(GetUserIdentitiesDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-identities"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, IdentityListRespDto.class); + } + + /** + * @summary 获取用户角色列表 + * @description 通过用户 ID,获取用户角色列表,可以选择所属权限分组 code、选择指定用户 ID 类型等。 + **/ + public RolePaginatedRespDto getUserRoles(GetUserRolesDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-roles"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, RolePaginatedRespDto.class); + } + + /** + * @summary 获取用户实名认证信息 + * @description 通过用户 ID,获取用户实名认证信息,可以选择指定用户 ID 类型。 + **/ + public PrincipalAuthenticationInfoPaginatedRespDto getUserPrincipalAuthenticationInfo( + GetUserPrincipalAuthenticationInfoDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-principal-authentication-info"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, PrincipalAuthenticationInfoPaginatedRespDto.class); + } + + /** + * @summary 删除用户实名认证信息 + * @description 通过用户 ID,删除用户实名认证信息,可以选择指定用户 ID 类型等。 + **/ + public IsSuccessRespDto resetUserPrincipalAuthenticationInfo( + ResetUserPrincipalAuthenticationInfoDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/reset-user-principal-authentication-info"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 获取用户部门列表 + * @description 通过用户 ID,获取用户部门列表,支持分页,可以选择获取自定义数据、选择指定用户 ID 类型、增序或降序等。 + **/ + public UserDepartmentPaginatedRespDto getUserDepartments(GetUserDepartmentsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-departments"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, UserDepartmentPaginatedRespDto.class); + } + + /** + * @summary 设置用户所在部门 + * @description 通过用户 ID,设置用户所在部门,可以选择指定用户 ID 类型等。 + **/ + public IsSuccessRespDto setUserDepartments(SetUserDepartmentsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/set-user-departments"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 获取用户分组列表 + * @description 通过用户 ID,获取用户分组列表,可以选择指定用户 ID 类型等。 + **/ + public GroupPaginatedRespDto getUserGroups(GetUserGroupsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-groups"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GroupPaginatedRespDto.class); + } + + /** + * @summary 获取用户 MFA 绑定信息 + * @description 通过用户 ID,获取用户 MFA 绑定信息,可以选择指定用户 ID 类型等。 + **/ + public UserMfaSingleRespDto getUserMfaInfo(GetUserMfaInfoDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-mfa-info"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, UserMfaSingleRespDto.class); + } + + /** + * @summary 获取已归档的用户列表 + * @description 获取已归档的用户列表,支持分页,可以筛选开始时间等。 + **/ + public ListArchivedUsersSingleRespDto listArchivedUsers(ListArchivedUsersDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-archived-users"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, ListArchivedUsersSingleRespDto.class); + } + + /** + * @summary 强制下线用户 + * @description 通过用户 ID、App ID 列表,强制让用户下线,可以选择指定用户 ID 类型等。 + **/ + public IsSuccessRespDto kickUsers(KickUsersDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/kick-users"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 判断用户是否存在 + * @description 根据条件判断用户是否存在,可以筛选用户名、邮箱、手机号、第三方外部 ID 等。 + **/ + public IsUserExistsRespDto isUserExists(IsUserExistsReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/is-user-exists"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsUserExistsRespDto.class); + } + + /** + * @summary 获取用户可访问的应用 + * @description 通过用户 ID,获取用户可访问的应用,可以选择指定用户 ID 类型等。 + **/ + public AppListRespDto getUserAccessibleApps(GetUserAccessibleAppsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-accessible-apps"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, AppListRespDto.class); + } + + /** + * @summary 获取用户授权的应用 + * @description 通过用户 ID,获取用户授权的应用,可以选择指定用户 ID 类型等。 + **/ + public AppListRespDto getUserAuthorizedApps(GetUserAuthorizedAppsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-authorized-apps"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, AppListRespDto.class); + } + + /** + * @summary 判断用户是否有某个角色 + * @description 通过用户 ID,判断用户是否有某个角色,支持传入多个角色,可以选择指定用户 ID 类型等。 + **/ + public HasAnyRoleRespDto hasAnyRole(HasAnyRoleReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/has-any-role"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, HasAnyRoleRespDto.class); + } + + /** + * @summary 获取用户的登录历史记录 + * @description 通过用户 ID,获取用户登录历史记录,支持分页,可以选择指定用户 ID 类型、应用 ID、开始与结束时间戳等。 + **/ + public UserLoginHistoryPaginatedRespDto getUserLoginHistory(GetUserLoginHistoryDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-login-history"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, UserLoginHistoryPaginatedRespDto.class); + } + + /** + * @summary 获取用户曾经登录过的应用 + * @description 通过用户 ID,获取用户曾经登录过的应用,可以选择指定用户 ID 类型等。 + **/ + public UserLoggedInAppsListRespDto getUserLoggedinApps(GetUserLoggedinAppsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-loggedin-apps"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, UserLoggedInAppsListRespDto.class); + } + + /** + * @summary 获取用户曾经登录过的身份源 + * @description 通过用户 ID,获取用户曾经登录过的身份源,可以选择指定用户 ID 类型等。 + **/ + public UserLoggedInIdentitiesRespDto getUserLoggedinIdentities( + GetUserLoggedInIdentitiesDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-logged-in-identities"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, UserLoggedInIdentitiesRespDto.class); + } + + /** + * @summary 用户离职 + * @description 通过用户 ID,对用户进行离职操作 + **/ + public ResignUserRespDto resignUser(ResignUserReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/resign-user"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, ResignUserRespDto.class); + } + + /** + * @summary 批量用户离职 + * @description 通过用户 ID,对用户进行离职操作 + **/ + public ResignUserRespDto resignUserBatch(ResignUserBatchReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/resign-user-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, ResignUserRespDto.class); + } + + /** + * @summary 获取用户被授权的所有资源 + * @description 通过用户 ID,获取用户被授权的所有资源,可以选择指定用户 ID 类型等,用户被授权的资源是用户自身被授予、通过分组继承、通过角色继承、通过组织机构继承的集合。 + **/ + public AuthorizedResourcePaginatedRespDto getUserAuthorizedResources( + GetUserAuthorizedResourcesDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-authorized-resources"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, AuthorizedResourcePaginatedRespDto.class); + } + + /** + * @summary 检查某个用户在应用下是否具备 Session 登录态 + * @description 检查某个用户在应用下是否具备 Session 登录态 + **/ + public CheckSessionStatusRespDto checkSessionStatus(CheckSessionStatusDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/check-session-status"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CheckSessionStatusRespDto.class); + } + + /** + * @summary 导入用户的 OTP + * @description 导入用户的 OTP + **/ + public CommonResponseDto importOtp(ImportOtpReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/import-otp"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 获取用户绑定 OTP 的秘钥 + * @description 通过用户 ID,获取用户绑定 OTP 的秘钥。可以选择指定用户 ID 类型等。 + **/ + public GetOtpSecretRespDto getOtpSecretByUser(GetOtpSecretByUserDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-otp-secret-by-user"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetOtpSecretRespDto.class); + } + + /** + * @summary 获取组织机构详情 + * @description 获取组织机构详情 + **/ + public OrganizationSingleRespDto getOrganization(GetOrganizationDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-organization"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, OrganizationSingleRespDto.class); + } + + /** + * @summary 批量获取组织机构详情 + * @description 批量获取组织机构详情 + **/ + public OrganizationListRespDto getOrganizationsBatch(GetOrganizationBatchDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-organization-batch"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, OrganizationListRespDto.class); + } + + /** + * @summary 获取组织机构列表 + * @description 获取组织机构列表,支持分页。 + **/ + public OrganizationPaginatedRespDto listOrganizations(ListOrganizationsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-organizations"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, OrganizationPaginatedRespDto.class); + } + + /** + * @summary 创建组织机构 + * @description 创建组织机构,会创建一个只有一个节点的组织机构,可以选择组织描述信息、根节点自定义 ID、多语言等。 + **/ + public OrganizationSingleRespDto createOrganization(CreateOrganizationReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-organization"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, OrganizationSingleRespDto.class); + } + + /** + * @summary 修改组织机构 + * @description 通过组织 code,修改组织机构,可以选择部门描述、新组织 code、组织名称等。 + **/ + public OrganizationSingleRespDto updateOrganization(UpdateOrganizationReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-organization"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, OrganizationSingleRespDto.class); + } + + /** + * @summary 删除组织机构 + * @description 通过组织 code,删除组织机构树。 + **/ + public IsSuccessRespDto deleteOrganization(DeleteOrganizationReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-organization"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 搜索组织机构列表 + * @description 通过搜索关键词,搜索组织机构列表,支持分页。 + **/ + public OrganizationPaginatedRespDto searchOrganizations(SearchOrganizationsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/search-organizations"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, OrganizationPaginatedRespDto.class); + } + + /** + * @summary 获取部门信息 + * @description 通过组织 code 以及 部门 ID 或 部门 code,获取部门信息,可以获取自定义数据。 + **/ + public DepartmentSingleRespDto getDepartment(GetDepartmentDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-department"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, DepartmentSingleRespDto.class); + } + + /** + * @summary 创建部门 + * @description 通过组织 code、部门名称、父部门 ID,创建部门,可以设置多种参数。 + **/ + public DepartmentSingleRespDto createDepartment(CreateDepartmentReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-department"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, DepartmentSingleRespDto.class); + } + + /** + * @summary 修改部门 + * @description 通过组织 code、部门 ID,修改部门,可以设置多种参数。 + **/ + public DepartmentSingleRespDto updateDepartment(UpdateDepartmentReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-department"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, DepartmentSingleRespDto.class); + } + + /** + * @summary 删除部门 + * @description 通过组织 code、部门 ID,删除部门。 + **/ + public IsSuccessRespDto deleteDepartment(DeleteDepartmentReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-department"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 搜索部门 + * @description 通过组织 code、搜索关键词,搜索部门,可以搜索组织名称等。 + * @deprecated + **/ + public DepartmentListRespDto searchDepartments(SearchDepartmentsReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/search-departments"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, DepartmentListRespDto.class); + } + + /** + * @summary 搜索部门 + * @description 通过组织 code、搜索关键词,搜索部门,可以搜索组织名称等。 + **/ + public DepartmentListRespDto searchDepartmentsList(SearchDepartmentsListReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/search-departments-list"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, DepartmentListRespDto.class); + } + + /** + * @summary 获取子部门列表 + * @description 通过组织 code、部门 ID,获取子部门列表,可以选择获取自定义数据、虚拟组织等。 + **/ + public DepartmentPaginatedRespDto listChildrenDepartments(ListChildrenDepartmentsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-children-departments"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, DepartmentPaginatedRespDto.class); + } + + /** + * @summary 获取部门成员列表 + * @description 通过组织 code、部门 ID、排序,获取部门成员列表,支持分页,可以选择获取自定义数据、identities 等。 + **/ + public UserPaginatedRespDto listDepartmentMembers(ListDepartmentMembersDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-department-members"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, UserPaginatedRespDto.class); + } + + /** + * @summary 获取部门直属成员 ID 列表 + * @description 通过组织 code、部门 ID,获取部门直属成员 ID 列表。 + **/ + public UserIdListRespDto listDepartmentMemberIds(ListDepartmentMemberIdsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-department-member-ids"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, UserIdListRespDto.class); + } + + /** + * @summary 搜索部门下的成员 + * @description 通过组织 code、部门 ID、搜索关键词,搜索部门下的成员,支持分页,可以选择获取自定义数据、identities 等。 + **/ + public UserPaginatedRespDto searchDepartmentMembers(SearchDepartmentMembersDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/search-department-members"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, UserPaginatedRespDto.class); + } + + /** + * @summary 部门下添加成员 + * @description 通过部门 ID、组织 code,添加部门下成员。 + **/ + public IsSuccessRespDto addDepartmentMembers(AddDepartmentMembersReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/add-department-members"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 部门下删除成员 + * @description 通过部门 ID、组织 code,删除部门下成员。 + **/ + public IsSuccessRespDto removeDepartmentMembers(RemoveDepartmentMembersReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/remove-department-members"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 获取父部门信息 + * @description 通过组织 code、部门 ID,获取父部门信息,可以选择获取自定义数据等。 + **/ + public DepartmentSingleRespDto getParentDepartment(GetParentDepartmentDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-parent-department"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, DepartmentSingleRespDto.class); + } + + /** + * @summary 判断用户是否在某个部门下 + * @description 通过组织 code、部门 ID,判断用户是否在某个部门下,可以选择包含子部门。 + **/ + public IsUserInDepartmentRespDto isUserInDepartment(IsUserInDepartmentDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/is-user-in-department"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, IsUserInDepartmentRespDto.class); + } + + /** + * @summary 根据部门id查询部门 + * @description 根据部门id查询部门 + **/ + public DepartmentSingleRespDto getDepartmentById(GetDepartmentByIdDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-department-by-id"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, DepartmentSingleRespDto.class); + } + + /** + * @summary 根据组织树批量创建部门 + * @description 根据组织树批量创建部门,部门名称不存在时会自动创建 + **/ + public CreateDepartmentTreeRespDto createDepartmentTree(CreateDepartmentTreeReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-department-tree"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CreateDepartmentTreeRespDto.class); + } + + /** + * @summary 获取分组详情 + * @description 通过分组 code,获取分组详情。 + **/ + public GroupSingleRespDto getGroup(GetGroupDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-group"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GroupSingleRespDto.class); + } + + /** + * @summary 获取分组列表 + * @description 获取分组列表,支持分页。 + **/ + public GroupPaginatedRespDto listGroups(ListGroupsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-groups"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GroupPaginatedRespDto.class); + } + + /** + * @summary 创建分组 + * @description 创建分组,一个分组必须包含分组名称与唯一标志符 code,且必须为一个合法的英文标志符,如 developers。 + **/ + public GroupSingleRespDto createGroup(CreateGroupReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-group"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, GroupSingleRespDto.class); + } + + /** + * @summary 批量创建分组 + * @description 批量创建分组,一个分组必须包含分组名称与唯一标志符 code,且必须为一个合法的英文标志符,如 developers。 + **/ + public GroupListRespDto createGroupsBatch(CreateGroupBatchReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-groups-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, GroupListRespDto.class); + } + + /** + * @summary 修改分组 + * @description 通过分组 code,修改分组,可以修改此分组的 code。 + **/ + public GroupSingleRespDto updateGroup(UpdateGroupReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-group"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, GroupSingleRespDto.class); + } + + /** + * @summary 批量删除分组 + * @description 通过分组 code,批量删除分组。 + **/ + public IsSuccessRespDto deleteGroupsBatch(DeleteGroupsReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-groups-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 添加分组成员 + * @description 添加分组成员,成员以用户 ID 数组形式传递。 + **/ + public IsSuccessRespDto addGroupMembers(AddGroupMembersReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/add-group-members"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 批量移除分组成员 + * @description 批量移除分组成员,成员以用户 ID 数组形式传递。 + **/ + public IsSuccessRespDto removeGroupMembers(RemoveGroupMembersReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/remove-group-members"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 获取分组成员列表 + * @description 通过分组 code,获取分组成员列表,支持分页,可以获取自定义数据、identities、部门 ID 列表。 + **/ + public UserPaginatedRespDto listGroupMembers(ListGroupMembersDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-group-members"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, UserPaginatedRespDto.class); + } + + /** + * @summary 获取分组被授权的资源列表 + * @description 通过分组 code,获取分组被授权的资源列表,可以通过资源类型、权限分组 code 筛选。 + **/ + public AuthorizedResourceListRespDto getGroupAuthorizedResources( + GetGroupAuthorizedResourcesDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-group-authorized-resources"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, AuthorizedResourceListRespDto.class); + } + + /** + * @summary 获取角色详情 + * @description 通过权限分组内角色 code,获取角色详情。 + **/ + public RoleSingleRespDto getRole(GetRoleDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-role"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, RoleSingleRespDto.class); + } + + /** + * @summary 分配角色 + * @description 通过权限分组内角色 code,分配角色,被分配者可以是用户或部门。 + **/ + public IsSuccessRespDto assignRole(AssignRoleDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/assign-role"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 移除分配的角色 + * @description 通过权限分组内角色 code,移除分配的角色,被分配者可以是用户或部门。 + **/ + public IsSuccessRespDto revokeRole(RevokeRoleDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/revoke-role"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 获取角色被授权的资源列表 + * @description 通过权限分组内角色 code,获取角色被授权的资源列表。 + **/ + public RoleAuthorizedResourcePaginatedRespDto getRoleAuthorizedResources( + GetRoleAuthorizedResourcesDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-role-authorized-resources"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, RoleAuthorizedResourcePaginatedRespDto.class); + } + + /** + * @summary 获取角色成员列表 + * @description 通过权限分组内内角色 code,获取角色成员列表,支持分页,可以选择或获取自定义数据、identities 等。 + **/ + public UserPaginatedRespDto listRoleMembers(ListRoleMembersDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-role-members"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, UserPaginatedRespDto.class); + } + + /** + * @summary 获取角色的部门列表 + * @description 通过权限分组内角色 code,获取角色的部门列表,支持分页。 + **/ + public RoleDepartmentListPaginatedRespDto listRoleDepartments(ListRoleDepartmentsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-role-departments"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, RoleDepartmentListPaginatedRespDto.class); + } + + /** + * @summary 创建角色 + * @description 通过权限分组(权限空间)内角色 code,创建角色,可以选择权限分组、角色描述、角色名称等。 + **/ + public RoleSingleRespDto createRole(CreateRoleDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-role"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, RoleSingleRespDto.class); + } + + /** + * @summary 获取角色列表 + * @description 获取角色列表,支持分页、支持根据权限分组(权限空间)筛选 + **/ + public RolePaginatedRespDto listRoles(ListRolesDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-roles"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, RolePaginatedRespDto.class); + } + + /** + * @summary 单个权限分组(权限空间)内删除角色 + * @description 单个权限分组(权限空间)内删除角色,可以批量删除。 + **/ + public IsSuccessRespDto deleteRolesBatch(DeleteRoleDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-roles-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 批量创建角色 + * @description 批量创建角色,可以选择权限分组、角色描述等。 + **/ + public IsSuccessRespDto createRolesBatch(CreateRolesBatch reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-roles-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 修改角色 + * @description 通过权限分组(权限空间 ) 内角色新旧 Code , 修改角色 , 可以选择角色名称 、 角色描述等 。 + **/ + public IsSuccessRespDto updateRole(UpdateRoleDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-role"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 跨权限分组(空间)删除角色 + * @description 跨权限分组(空间)删除角色,可以批量删除。 + **/ + public IsSuccessRespDto deleteRoles(DeleteRoleBatchDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/multiple-namespace-delete-roles-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 校验角色 Code 或者名称是否可用 + * @description 通过用户池 ID、权限空间 Code和角色 Code,或者用户池 ID、权限空间名称和角色名称查询是否可用。 + **/ + public RoleCheckParamsRespDto checkParamsNamespace(CheckRoleParamsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/check-role-params"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, RoleCheckParamsRespDto.class); + } + + /** + * @summary 获取角色授权列表 + * @description 获取角色授权列表。 + **/ + public RoleListPageRespDto listRoleAssignments(ListRoleAssignmentsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-role-assignments"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, RoleListPageRespDto.class); + } + + /** + * @summary 获取身份源列表 + * @description 获取身份源列表,可以指定 租户 ID 筛选。 + **/ + public ExtIdpListPaginatedRespDto listExtIdp(ListExtIdpDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-ext-idp"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, ExtIdpListPaginatedRespDto.class); + } + + /** + * @summary 获取身份源详情 + * @description 通过 身份源 ID,获取身份源详情,可以指定 租户 ID 筛选。 + **/ + public ExtIdpDetailSingleRespDto getExtIdp(GetExtIdpDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-ext-idp"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, ExtIdpDetailSingleRespDto.class); + } + + /** + * @summary 创建身份源 + * @description 创建身份源,可以设置身份源名称、连接类型、租户 ID 等。 + **/ + public ExtIdpSingleRespDto createExtIdp(CreateExtIdpDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-ext-idp"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, ExtIdpSingleRespDto.class); + } + + /** + * @summary 更新身份源配置 + * @description 更新身份源配置,可以设置身份源 ID 与 名称。 + **/ + public ExtIdpSingleRespDto updateExtIdp(UpdateExtIdpDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-ext-idp"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, ExtIdpSingleRespDto.class); + } + + /** + * @summary 删除身份源 + * @description 通过身份源 ID,删除身份源。 + **/ + public IsSuccessRespDto deleteExtIdp(DeleteExtIdpDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-ext-idp"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 在某个已有身份源下创建新连接 + * @description 在某个已有身份源下创建新连接,可以设置身份源图标、是否只支持登录等。 + **/ + public ExtIdpConnDetailSingleRespDto createExtIdpConn(CreateExtIdpConnDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-ext-idp-conn"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, ExtIdpConnDetailSingleRespDto.class); + } + + /** + * @summary 更新身份源连接 + * @description 更新身份源连接,可以设置身份源图标、是否只支持登录等。 + **/ + public ExtIdpConnDetailSingleRespDto updateExtIdpConn(UpdateExtIdpConnDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-ext-idp-conn"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, ExtIdpConnDetailSingleRespDto.class); + } + + /** + * @summary 删除身份源连接 + * @description 通过身份源连接 ID,删除身份源连接。 + **/ + public IsSuccessRespDto deleteExtIdpConn(DeleteExtIdpConnDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-ext-idp-conn"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 身份源连接开关 + * @description 身份源连接开关,可以打开或关闭身份源连接。 + **/ + public IsSuccessRespDto changeExtIdpConnState(ChangeExtIdpConnStateDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/change-ext-idp-conn-state"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 租户关联身份源 + * @description 租户可以关联或取消关联身份源连接。 + **/ + public IsSuccessRespDto changeExtIdpConnAssociationState(ChangeExtIdpAssociationStateDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/change-ext-idp-conn-association-state"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 租户控制台获取身份源列表 + * @description 在租户控制台内获取身份源列表,可以根据 应用 ID 筛选。 + **/ + public ExtIdpListPaginatedRespDto listTenantExtIdp(ListTenantExtIdpDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-tenant-ext-idp"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, ExtIdpListPaginatedRespDto.class); + } + + /** + * @summary 身份源下应用的连接详情 + * @description 在身份源详情页获取应用的连接情况 + **/ + public ExtIdpListPaginatedRespDto extIdpConnStateByApps(ExtIdpConnAppsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/ext-idp-conn-apps"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, ExtIdpListPaginatedRespDto.class); + } + + /** + * @summary 获取用户内置字段列表 + * @description 获取用户内置的字段列表 + **/ + public CustomFieldListRespDto getUserBaseFields() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-base-fields"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, CustomFieldListRespDto.class); + } + + /** + * @summary 修改用户内置字段配置 + * @description 修改用户内置字段配置,内置字段不允许修改数据类型、唯一性。 + **/ + public CustomFieldListRespDto setUserBaseFields(SetUserBaseFieldsReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/set-user-base-fields"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CustomFieldListRespDto.class); + } + + /** + * @summary 获取自定义字段列表 + * @description 通过主体类型,获取用户、部门或角色的自定义字段列表。 + **/ + public CustomFieldListRespDto getCustomFields(GetCustomFieldsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-custom-fields"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, CustomFieldListRespDto.class); + } + + /** + * @summary 创建/修改自定义字段定义 + * @description 创建/修改用户、部门或角色自定义字段定义,如果传入的 key 不存在则创建,存在则更新。 + **/ + public CustomFieldListRespDto setCustomFields(SetCustomFieldsReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/set-custom-fields"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CustomFieldListRespDto.class); + } + + /** + * @summary 设置自定义字段的值 + * @description 给用户、角色或部门设置自定义字段的值,如果存在则更新,不存在则创建。 + **/ + public IsSuccessRespDto setCustomData(SetCustomDataReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/set-custom-data"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 获取用户、分组、角色、组织机构的自定义字段值 + * @description 通过筛选条件,获取用户、分组、角色、组织机构的自定义字段值。 + **/ + public GetCustomDataRespDto getCustomData(GetCustomDataDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-custom-data"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetCustomDataRespDto.class); + } + + /** + * @summary 创建资源 + * @description 创建资源,可以设置资源的描述、定义的操作类型、URL 标识等。 + **/ + public ResourceRespDto createResource(CreateResourceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-resource"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, ResourceRespDto.class); + } + + /** + * @summary 批量创建资源 + * @description 批量创建资源,可以设置资源的描述、定义的操作类型、URL 标识等。 + **/ + public IsSuccessRespDto createResourcesBatch(CreateResourcesBatchDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-resources-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 获取资源详情 + * @description 根据筛选条件,获取资源详情。 + **/ + public ResourceRespDto getResource(GetResourceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-resource"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, ResourceRespDto.class); + } + + /** + * @summary 批量获取资源详情 + * @description 根据筛选条件,批量获取资源详情。 + **/ + public ResourceListRespDto getResourcesBatch(GetResourcesBatchDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-resources-batch"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, ResourceListRespDto.class); + } + + /** + * @summary 分页获取常规资源列表 + * @description 根据筛选条件,分页获取常规资源详情列表。 + **/ + public CommonResourcePaginatedRespDto listCommonResource(ListCommonResourceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-common-resource"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, CommonResourcePaginatedRespDto.class); + } + + /** + * @summary 分页获取资源列表 + * @description 根据筛选条件,分页获取资源详情列表。 + **/ + public ResourcePaginatedRespDto listResources(ListResourcesDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-resources"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, ResourcePaginatedRespDto.class); + } + + /** + * @summary 修改资源 + * @description 修改资源,可以设置资源的描述、定义的操作类型、URL 标识等。 + **/ + public ResourceRespDto updateResource(UpdateResourceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-resource"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, ResourceRespDto.class); + } + + /** + * @summary 删除资源 + * @description 通过资源唯一标志符以及所属权限分组,删除资源。 + **/ + public IsSuccessRespDto deleteResource(DeleteResourceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-resource"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 批量删除资源 + * @description 通过资源唯一标志符以及所属权限分组,批量删除资源 + **/ + public IsSuccessRespDto deleteResourcesBatch(DeleteResourcesBatchDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-resources-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 批量删除资源 + * @description 通过资源id批量删除资源 + **/ + public IsSuccessRespDto batchDeleteCommonResource(DeleteCommonResourcesBatchDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-common-resources-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 关联/取消关联应用资源到租户 + * @description 通过资源唯一标识以及权限分组,关联或取消关联资源到租户 + **/ + public IsSuccessRespDto associateTenantResource(AssociateTenantResourceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/associate-tenant-resource"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 创建权限分组 + * @description 创建权限分组,可以设置权限分组名称、Code 和描述信息。 + **/ + public NamespaceRespDto createNamespace(CreateNamespaceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-namespace"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, NamespaceRespDto.class); + } + + /** + * @summary 批量创建权限分组 + * @description 批量创建权限分组,可以分别设置权限分组名称、Code 和描述信息。 + **/ + public IsSuccessRespDto createNamespacesBatch(CreateNamespacesBatchDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-namespaces-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 获取权限分组详情 + * @description 通过权限分组唯一标志符(Code),获取权限分组详情。 + **/ + public NamespaceRespDto getNamespace(GetNamespaceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-namespace"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, NamespaceRespDto.class); + } + + /** + * @summary 批量获取权限分组详情 + * @description 分别通过权限分组唯一标志符(Code),批量获取权限分组详情。 + **/ + public NamespaceListRespDto getNamespacesBatch(GetNamespacesBatchDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-namespaces-batch"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, NamespaceListRespDto.class); + } + + /** + * @summary 修改权限分组信息 + * @description 修改权限分组信息,可以修改名称、描述信息以及新的唯一标志符(NewCode)。 + **/ + public UpdateNamespaceRespDto updateNamespace(UpdateNamespaceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-namespace"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, UpdateNamespaceRespDto.class); + } + + /** + * @summary 删除权限分组信息 + * @description 通过权限分组唯一标志符(Code),删除权限分组信息。 + **/ + public IsSuccessRespDto deleteNamespace(DeleteNamespaceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-namespace"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 批量删除权限分组 + * @description 分别通过权限分组唯一标志符(Code),批量删除权限分组。 + **/ + public IsSuccessRespDto deleteNamespacesBatch(DeleteNamespacesBatchDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-namespaces-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 分页获取权限分组列表 + * @description 根据筛选条件,分页获取权限分组列表。 + **/ + public NamespaceListPaginatedRespDto listNamespaces(ListNamespacesDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-namespaces"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, NamespaceListPaginatedRespDto.class); + } + + /** + * @summary 分页权限分组下所有的角色列表 + * @description 根据筛选条件,分页获取权限分组下所有的角色列表。 + **/ + public NamespaceRolesListPaginatedRespDto listNamespaceRoles(ListNamespaceRolesDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-namespace-roles"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, NamespaceRolesListPaginatedRespDto.class); + } + + /** + * @summary 授权资源 + * @description 将一个/多个资源授权给用户、角色、分组、组织机构等主体,且可以分别指定不同的操作权限。 + **/ + public IsSuccessRespDto authorizeResources(AuthorizeResourcesDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/authorize-resources"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 判断用户是否对某个资源的某个操作有权限 + * @description 判断用户是否对某个资源的某个操作有权限。 + **/ + public IsActionAllowedRespDtp isActionAllowed(IsActionAllowedDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/is-action-allowed"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsActionAllowedRespDtp.class); + } + + /** + * @summary 获取资源被授权的主体 + * @description 获取资源被授权的主体 + **/ + public GetResourceAuthorizedTargetRespDto getResourceAuthorizedTargets( + GetResourceAuthorizedTargetsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-resource-authorized-targets"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, GetResourceAuthorizedTargetRespDto.class); + } + + /** + * @summary 获取用户行为日志 + * @description 可以选择请求 ID、客户端 IP、用户 ID、应用 ID、开始时间戳、请求是否成功、分页参数来获取用户行为日志 + **/ + public UserActionLogRespDto getUserActionLogs(GetUserActionLogsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-action-logs"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, UserActionLogRespDto.class); + } + + /** + * @summary 获取管理员操作日志 + * @description 可以选择请求 ID、客户端 IP、操作类型、资源类型、管理员用户 ID、请求是否成功、开始时间戳、结束时间戳、分页来获取管理员操作日志接口 + **/ + public AdminAuditLogRespDto getAdminAuditLogs(GetAdminAuditLogsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-admin-audit-logs"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, AdminAuditLogRespDto.class); + } + + /** + * @summary 获取邮件模版列表 + * @description 获取邮件模版列表 + **/ + public GetEmailTemplatesRespDto getEmailTemplates() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-email-templates"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetEmailTemplatesRespDto.class); + } + + /** + * @summary 修改邮件模版 + * @description 修改邮件模版 + **/ + public EmailTemplateSingleItemRespDto updateEmailTemplate(UpdateEmailTemplateDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-email-template"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, EmailTemplateSingleItemRespDto.class); + } + + /** + * @summary 预览邮件模版 + * @description 预览邮件模版 + **/ + public PreviewEmailTemplateRespDto previewEmailTemplate(PreviewEmailTemplateDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/preview-email-template"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, PreviewEmailTemplateRespDto.class); + } + + /** + * @summary 获取第三方邮件服务配置 + * @description 获取第三方邮件服务配置 + **/ + public EmailProviderRespDto getEmailProvider() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-email-provider"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, EmailProviderRespDto.class); + } + + /** + * @summary 配置第三方邮件服务 + * @description 配置第三方邮件服务 + **/ + public EmailProviderRespDto configEmailProvider(ConfigEmailProviderDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/config-email-provider"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, EmailProviderRespDto.class); + } + + /** + * @summary 获取应用详情 + * @description 通过应用 ID,获取应用详情。 + **/ + public ApplicationSingleRespDto getApplication(GetApplicationDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-application"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, ApplicationSingleRespDto.class); + } + + /** + * @summary 获取应用列表 + * @description 获取应用列表 + **/ + public ApplicationPaginatedRespDto listApplications(ListApplicationsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-applications"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, ApplicationPaginatedRespDto.class); + } + + /** + * @summary 获取应用简单信息 + * @description 通过应用 ID,获取应用简单信息。 + **/ + public ApplicationSimpleInfoSingleRespDto getApplicationSimpleInfo( + GetApplicationSimpleInfoDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-application-simple-info"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, ApplicationSimpleInfoSingleRespDto.class); + } + + /** + * @summary 获取应用简单信息列表 + * @description 获取应用简单信息列表 + **/ + public ApplicationSimpleInfoPaginatedRespDto listApplicationSimpleInfo( + ListApplicationSimpleInfoDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-application-simple-info"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, ApplicationSimpleInfoPaginatedRespDto.class); + } + + /** + * @summary 创建应用 + * @description 创建应用 + **/ + public CreateApplicationRespDto createApplication(CreateApplicationDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-application"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CreateApplicationRespDto.class); + } + + /** + * @summary 删除应用 + * @description 通过应用 ID,删除应用。 + **/ + public IsSuccessRespDto deleteApplication(DeleteApplicationDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-application"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 获取应用密钥 + * @description 获取应用密钥 + **/ + public GetApplicationSecretRespDto getApplicationSecret(GetApplicationSecretDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-application-secret"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetApplicationSecretRespDto.class); + } + + /** + * @summary 刷新应用密钥 + * @description 刷新应用密钥 + **/ + public RefreshApplicationSecretRespDto refreshApplicationSecret( + RefreshApplicationSecretDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/refresh-application-secret"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, RefreshApplicationSecretRespDto.class); + } + + /** + * @summary 获取应用当前登录用户 + * @description 获取应用当前处于登录状态的用户 + **/ + public UserPaginatedRespDto listApplicationActiveUsers(ListApplicationActiveUsersDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-application-active-users"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, UserPaginatedRespDto.class); + } + + /** + * @summary 获取应用默认访问授权策略 + * @description 获取应用默认访问授权策略 + **/ + public GetApplicationPermissionStrategyRespDto getApplicationPermissionStrategy( + GetApplicationPermissionStrategyDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-application-permission-strategy"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetApplicationPermissionStrategyRespDto.class); + } + + /** + * @summary 更新应用默认访问授权策略 + * @description 更新应用默认访问授权策略 + **/ + public IsSuccessRespDto updateApplicationPermissionStrategy( + UpdateApplicationPermissionStrategyDataDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-application-permission-strategy"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 授权应用访问权限 + * @description 给用户、分组、组织或角色授权应用访问权限,如果用户、分组、组织或角色不存在,则跳过,进行下一步授权,不返回报错 + **/ + public IsSuccessRespDto authorizeApplicationAccess(AuthorizeApplicationAccessDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/authorize-application-access"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 删除应用访问授权记录 + * @description 取消给用户、分组、组织或角色的应用访问权限授权,如果传入数据不存在,则返回数据不报错处理。 + **/ + public IsSuccessRespDto revokeApplicationAccess(RevokeApplicationAccessDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/revoke-application-access"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 检测域名是否可用 + * @description 检测域名是否可用于创建新应用或更新应用域名 + **/ + public CheckDomainAvailableSecretRespDto checkDomainAvailable(CheckDomainAvailable reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/check-domain-available"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CheckDomainAvailableSecretRespDto.class); + } + + /** + * @summary 获取租户应用列表 + * @description 获取应用列表,可以指定 租户 ID 筛选。 + **/ + public TenantApplicationListPaginatedRespDto listTenantApplications( + ListTenantApplicationsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-tenant-applications"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, TenantApplicationListPaginatedRespDto.class); + } + + /** + * @summary 更新应用登录页配置 + * @description 通过应用 ID 更新登录页配置。 + **/ + public IsSuccessRespDto updateLoginPageConfig(UpdateLoginConfigDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-login-page-config"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 获取用户池租户配置信息 + * @description 根据用户池 ID 获取用户池多租户配置信息 + **/ + public UserPoolTenantConfigDtoRespDto userpollTenantConfig() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/userpool-tenant-config"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, UserPoolTenantConfigDtoRespDto.class); + } + + /** + * @summary 更新用户池租户配置信息 + * @description 更新用户池多租户配置内登录信息 + **/ + public IsSuccessRespDto updateUserPoolTenantConfig(UpdateUserPoolTenantLoginConfigDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-userpool-tenant-config"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 设置用户池多租户身份源连接 + * @description 设置用户池多租户身份源连接,支持同时设置多个身份源连接,支持设置连接和取消连接 + **/ + public IsSuccessRespDto changeUserpoolTenanExtIdpConnState( + ChangeUserPoolTenantExtIdpConnDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/change-userpool-tenant-ext-idp-conn-state"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 创建 ASA 账号 + * @description 在某一应用下创建 ASA 账号 + **/ + public AsaAccountSingleRespDto createAsaAccount(CreateAsaAccountDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-asa-account"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, AsaAccountSingleRespDto.class); + } + + /** + * @summary 批量创建 ASA 账号 + * @description 在某一应用下批量创建 ASA 账号 + **/ + public IsSuccessRespDto createAsaAccountBatch(CreateAsaAccountsBatchDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-asa-accounts-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 更新 ASA 账号 + * @description 更新某个 ASA 账号信息 + **/ + public AsaAccountSingleRespDto updateAsaAccount(UpdateAsaAccountDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-asa-account"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, AsaAccountSingleRespDto.class); + } + + /** + * @summary 获取 ASA 账号列表 + * @description 分页获取某一应用下的 ASA 账号列表 + **/ + public AsaAccountPaginatedRespDto listAsaAccount(ListAsaAccountsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-asa-accounts"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, AsaAccountPaginatedRespDto.class); + } + + /** + * @summary 获取 ASA 账号 + * @description 根据 ASA 账号 ID 获取账号详细信息 + **/ + public AsaAccountSingleRespDto getAsaAccount(GetAsaAccountDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-asa-account"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, AsaAccountSingleRespDto.class); + } + + /** + * @summary 批量获取 ASA 账号 + * @description 根据 ASA 账号 ID 列表批量获取账号详细信息 + **/ + public AsaAccountListRespDto getAsaAccountBatch(GetAsaAccountBatchDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-asa-accounts-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, AsaAccountListRespDto.class); + } + + /** + * @summary 删除 ASA 账号 + * @description 通过 ASA 账号 ID 删除 ASA 账号 + **/ + public IsSuccessRespDto deleteAsaAccount(DeleteAsaAccountDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-asa-account"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 批量删除 ASA 账号 + * @description 通过 ASA 账号 ID 批量删除 ASA 账号 + **/ + public IsSuccessRespDto deleteAsaAccountBatch(DeleteAsaAccountBatchDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-asa-accounts-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 分配 ASA 账号 + * @description 分配 ASA 账号给用户、组织、分组或角色 + **/ + public IsSuccessRespDto assignAsaAccount(AssignAsaAccountsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/assign-asa-account"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 取消分配 ASA 账号 + * @description 取消分配给用户、组织、分组或角色的 ASA 账号 + **/ + public IsSuccessRespDto unassignAsaAccount(AssignAsaAccountsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/unassign-asa-account"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 获取 ASA 账号分配的主体列表 + * @description 根据 ASA 账号 ID 分页获取账号被分配的主体列表 + **/ + public GetAsaAccountAssignedTargetRespDto getAsaAccountAssignedTargets( + GetAsaAccountAssignedTargetsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-asa-account-assigned-targets"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetAsaAccountAssignedTargetRespDto.class); + } + + /** + * @summary 获取主体被分配的 ASA 账号 + * @description 根据主体类型和标识获取直接分配给主体的 ASA 账号 + **/ + public AsaAccountSingleNullableRespDto getAssignedAccount(GetAssignedAccountDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-assigned-account"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, AsaAccountSingleNullableRespDto.class); + } + + /** + * @summary 获取安全配置 + * @description 无需传参获取安全配置 + **/ + public SecuritySettingsRespDto getSecuritySettings() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-security-settings"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, SecuritySettingsRespDto.class); + } + + /** + * @summary 修改安全配置 + * @description 可选安全域、Authing Token 有效时间(秒)、验证码长度、验证码尝试次数、用户修改邮箱的安全策略、用户修改手机号的安全策略、Cookie + * 过期时间设置、是否禁止用户注册、频繁注册检测配置、验证码注册后是否要求用户设置密码、未验证的邮箱登录时是否禁止登录并发送认证邮件、用户自助解锁配置、Authing + * 登录页面是否开启登录账号选择、APP 扫码登录安全配置进行修改安全配置 + **/ + public SecuritySettingsRespDto updateSecuritySettings(UpdateSecuritySettingsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-security-settings"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, SecuritySettingsRespDto.class); + } + + /** + * @summary 获取全局多因素认证配置 + * @description 无需传参获取全局多因素认证配置 + **/ + public MFASettingsRespDto getGlobalMfaSettings() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-global-mfa-settings"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, MFASettingsRespDto.class); + } + + /** + * @summary 修改全局多因素认证配置 + * @description 传入 MFA 认证因素列表进行开启, + **/ + public MFASettingsRespDto updateGlobalMfaSettings(MFASettingsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-global-mfa-settings"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, MFASettingsRespDto.class); + } + + /** + * @summary 创建租户 + **/ + public CreateTenantRespDto createTenant(CreateTenantDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-tenant"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CreateTenantRespDto.class); + } + + /** + * @summary 更新租户数据 + * @description 此接口用于更新租户基本信息。 + **/ + public IsSuccessRespDto updateTenant(UpdateTenantDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-tenant"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 删除租户 + * @description 此接口用于删除租户。 + **/ + public IsSuccessRespDto deleteTenant(DeleteTenantDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-tenant"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 获取/搜索租户列表 + * @description 此接口用于获取租户列表,支持模糊搜索。 + **/ + public TenantListPaginatedRespDto listTenants(ListTenantsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-tenants"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, TenantListPaginatedRespDto.class); + } + + /** + * @summary 获取租户详情 + * @description 根据租户 ID 获取租户详情 + **/ + public TenantSingleRespDto getTenant(GetTenantDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-tenant"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, TenantSingleRespDto.class); + } + + /** + * @summary 导入租户 + * @description 此接口用于 Excel 导入租户。 + **/ + public Object importTenant(ImportTenantDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/import-tenant"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, Object.class); + } + + /** + * @summary 导入租户历史 + * @description 此接口用于 Excel 导入租户的历史查询。 + **/ + public Object importTenantHistory(ImportTenantHistoryDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/import-tenant-history"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, Object.class); + } + + /** + * @summary 导入租户通知用户列表 + * @description 此接口用于查询导入租户通知用户列表。 + **/ + public Object importTenantNotifyUser(ImportTenantNotifyUserDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/import-tenant-notify-user"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, Object.class); + } + + /** + * @summary 导入租户通知邮箱用户 + * @description 此接口用于批量发送邮件通知。 + **/ + public Object sendEmailBatch(SendManyTenantEmailDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/send-email-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, Object.class); + } + + /** + * @summary 导入租户短信通知用户 + * @description 此接口用于批量发送短信通知。 + **/ + public Object sendSmsBatch(SendManyTenantSmsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/send-sms-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, Object.class); + } + + /** + * @summary 获取租户管理员列表 + * @description 此接口用于获取租户成员列表,支持模糊搜索。 + **/ + public TenantUserListPaginatedRespDto listTenantAdmin(ListTenantAdminDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-tenant-admin"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, TenantUserListPaginatedRespDto.class); + } + + /** + * @summary 设置租户管理员 + * @description 此接口用于根据用户 ID 或租户成员 ID 设置租户管理员。 + **/ + public CommonResponseDto setTenantAdmin(RemoveTenantUsersDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/set-tenant-admin"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 取消设置租户管理员 + * @description 此接口用于根据用户 ID 或租户成员 ID 取消设置租户管理员。 + **/ + public CommonResponseDto deleteTenantAdmin(GetTenantUserDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-tenant-admin"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 批量移除租户成员 + * @description 此接口用于根据用户 ID 或租户成员 ID 批量移除租户成员。 + **/ + public CommonResponseDto deleteTenantUser(RemoveTenantUsersDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-tenant-user"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 生成一个邀请租户成员的链接 + * @description 此接口用于生成一个邀请租户成员的链接。appId 为用户注册成功后要访问的应用 ID + **/ + public InviteTenantUsersRespDto generateInviteTenantUserLink( + GenerateInviteTenantUserLink reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/generate-invite-tenant-user-link"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, InviteTenantUsersRespDto.class); + } + + /** + * @summary 获取可访问的租户控制台列表 + * @description 根据用户 ID 获取可访问的租户控制台列表 + **/ + public InviteTenantUserRecordListRespDto listInviteTennatUserRecords( + ListInviteTenantUserRecordsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-invite-tenant-user-records"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, InviteTenantUserRecordListRespDto.class); + } + + /** + * @summary 获取多租户管理员用户列表 + * @description 根据用户池 ID 获取某个用户池内拥有多租户管理权限的用户列表 + **/ + public MultipleTenantAdminPaginatedRespDto listMultipleTenantAdmin( + ListMultipleTenantAdminsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-multiple-tenant-admins"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, MultipleTenantAdminPaginatedRespDto.class); + } + + /** + * @summary 创建多租户管理员用户 + * @description 根据用户 ID 创建一个用户池内拥有多租户管理权限的用户 + **/ + public CommonResponseDto createMultipleTenantAdmin(CreateMultipleTenantAdminDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-multiple-tenant-admin"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 获取多租户管理员用户列表 + * @description 根据用户池 ID 获取某个用户池内拥有多租户管理权限的用户列表 + **/ + public MultipleTenantAdminPaginatedRespDto getMultipleTenantAdmin( + GetMultipleTenantAdminDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-multiple-tenant-admin"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, MultipleTenantAdminPaginatedRespDto.class); + } + + /** + * @summary 更新多租户管理员用户 + * @description 根据用户 ID 更新一个用户池内拥有多租户管理权限的用户的信息 + **/ + public CommonResponseDto updateMultipleTenantAdmin(UpdateMultipleTenantAdminDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-multiple-tenant-admin"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 删除多租户管理员用户 + * @description 根据用户 ID 删除一个用户池内拥有多租户管理权限的用户 + **/ + public CommonResponseDto deleteMultipleTenantAdmin() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-multiple-tenant-admin"); + + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 获取协作管理员用户列表 + * @description 根据用户池 ID 获取某个用户池内拥有协作管理员能力的用户列表 + **/ + public TenantCooperatorPaginatedRespDto listTenantCooperators(ListTenantCooperatorsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-tenant-cooperators"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, TenantCooperatorPaginatedRespDto.class); + } + + /** + * @summary 获取一个协调管理员 + * @description 根据用户池 ID 获取某个协调管理员的列表 + **/ + public TenantCooperatorSingleRespDto getTenantCooperator(GetTenantCooperatorDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-tenant-cooperator"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, TenantCooperatorSingleRespDto.class); + } + + /** + * @summary 获取一个协调管理员拥有的列表 + * @description 根据用户池 ID 获取某个协调管理员的列表 + **/ + public TenantCooperatorSingleRespDto getTenantCooperatorMenu(GetTenantCooperatorMenuDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-tenant-cooperator-menu"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, TenantCooperatorSingleRespDto.class); + } + + /** + * @summary 创建协调管理员 + * @description 创建一个协调管理员 + **/ + public CommonResponseDto createTenantCooperator(CreateTenantCooperatorDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-tenant-cooperator"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 更新协调管理员 + * @description 根据用户 ID 更新一个协调管理员 + **/ + public CommonResponseDto updateTenantCooperator(UpdateTenantCooperatorDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-tenant-cooperator"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 删除协调管理员 + * @description 使用用户 ID 删除一个协调管理员 + **/ + public CommonResponseDto deleteTenantCooperator() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-tenant-cooperator"); + + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 发送邀请租户用户邮件 + * @description 向多个邮箱发送邀请成为租户用户的邮件 + **/ + public CommonResponseDto sendInviteTenantUserEmail(sendInviteTenantUserEmailDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/send-invite-tenant-user-email"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 添加租户成员 + * @description 根据用户 ID 批量添加租户成员 + **/ + public CommonResponseDto addTenantUsers(AddTenantUsersDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/add-tenant-users"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 批量移除租户成员 + * @description 此接口用于根据用户 ID 或租户成员 ID 批量移除租户成员。 + **/ + public CommonResponseDto removeTenantUsers(RemoveTenantUsersDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/remove-tenant-users"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 更新租户成员 + * @description 此接口用于根据用户 ID 或租户成员 ID 更新租户成员。 + **/ + public CommonResponseDto updateTenantUser(UpdateTenantUserDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-tenant-user"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 创建租户成员 + * @description 创建租户成员,邮箱、手机号、用户名必须包含其中一个,邮箱、手机号、用户名、externalId + * 用户池内唯一,此接口将以管理员身份创建用户因此不需要进行手机号验证码检验等安全检测。 + **/ + public TenantUserDto createTenantUser(CreateTenantUserReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-tenant-user"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, TenantUserDto.class); + } + + /** + * @summary 获取/搜索租户成员列表 + * @description 此接口用于获取用户列表,支持模糊搜索,以及通过用户基础字段、用户自定义字段、用户所在部门、用户历史登录应用等维度筛选用户。 + *

+ * ### 模糊搜素示例 + *

+ * 模糊搜索默认会从 `phone`, `email`, `name`, `username`, `nickname` 五个字段对用户进行模糊搜索,你也可以通过设置 + * `options.fuzzySearchOn` 决定模糊匹配的字段范围: + *

+ * ```json { "keywords": "北京", "options": { "fuzzySearchOn": [ "address" ] } } ``` + *

+ * ### 高级搜索示例 + *

+ * 你可以通过 `advancedFilter` 进行高级搜索,高级搜索支持通过用户的基础信息、自定义数据、所在部门、用户来源、登录应用、外部身份源信息等维度对用户进行筛选。 + * **且这些筛选条件可以任意组合。** + *

+ * #### 筛选邮箱中包含 `@example.com` 的用户 + *

+ * 用户邮箱(`email`)为字符串类型,可以进行模糊搜索: + *

+ * ```json { "advancedFilter": [ { "field": "email", "operator": "CONTAINS", "value": + * "@example.com" } ] } ``` + *

+ *

+ * #### 根据用户登录次数筛选 + *

+ * 筛选登录次数大于 10 的用户: + *

+ * ```json { "advancedFilter": [ { "field": "loginsCount", "operator": "GREATER", "value": 10 } ] + * } ``` + *

+ * 筛选登录次数在 10 - 100 次的用户: + *

+ * ```json { "advancedFilter": [ { "field": "loginsCount", "operator": "BETWEEN", "value": [10, + * 100] } ] } ``` + *

+ * #### 根据用户上次登录时间进行筛选 + *

+ * 筛选最近 7 天内登录过的用户: + *

+ * ```json { "advancedFilter": [ { "field": "lastLoginTime", "operator": "GREATER", "value": new + * Date(Date.now() - 7 * 24 * 60 * 60 * 1000) } ] } ``` + *

+ * 筛选在某一段时间内登录过的用户: + *

+ * ```json { "advancedFilter": [ { "field": "lastLoginTime", "operator": "BETWEEN", "value": [ + * Date.now() - 14 * 24 * 60 * 60 * 1000, Date.now() - 7 * 24 * 60 * 60 * 1000 ] } ] } ``` + *

+ * #### 根据用户曾经登录过的应用筛选 + *

+ * 筛选出曾经登录过应用 `appId1` 或者 `appId2` 的用户: + *

+ * ```json { "advancedFilter": [ { "field": "loggedInApps", "operator": "IN", "value": [ "appId1", + * "appId2" ] } ] } ``` + *

+ * #### 根据用户所在部门进行筛选 + *

+ * ```json { "advancedFilter": [ { "field": "department", "operator": "IN", "value": [ { + * "organizationCode": "steamory", "departmentId": "root", "departmentIdType": "department_id", + * "includeChildrenDepartments": true } ] } ] } ``` + **/ + public TenantUserListPaginatedRespDto listTenantUsers(ListTenantUserDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-tenant-users"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, TenantUserListPaginatedRespDto.class); + } + + /** + * @summary 获取单个租户成员 + * @description 根据用户 ID 或租户成员 ID 获取租户成员信息 + **/ + public TenantUserSingleRespDto getTenantUser(GetTenantUserDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-tenant-user"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, TenantUserSingleRespDto.class); + } + + /** + * @summary 租户部门下添加成员 + * @description 通过部门 ID、组织 code,添加部门下成员。 + **/ + public IsSuccessRespDto addTenantDepartmentMembers(AddTenantDepartmentMembersReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/add-tenant-department-members"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 租户部门下删除成员 + * @description 通过部门 ID、组织 code,删除部门下成员。 + **/ + public IsSuccessRespDto removeTenantDepartmentMembers( + RemoveTenantDepartmentMembersReqDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/remove-tenant-department-members"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 创建权限空间 + * @description 创建权限空间, 可以设置权限空间名称、Code 和描述信息。 + **/ + public CreatePermissionNamespaceResponseDto createPermissionNamespace( + CreatePermissionNamespaceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-permission-namespace"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CreatePermissionNamespaceResponseDto.class); + } + + /** + * @summary 批量创建权限空间 + * @description 批量创建权限空间,可以分别设置权限空间名称、Code 和描述信息。 + **/ + public IsSuccessRespDto createPermissionNamespacesBatch( + CreatePermissionNamespacesBatchDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-permission-namespaces-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 获取权限空间详情 + * @description 通过权限空间唯一标志符(Code),获取权限空间详情。 + **/ + public GetPermissionNamespaceResponseDto getPermissionNamespace( + GetPermissionNamespaceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-permission-namespace"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetPermissionNamespaceResponseDto.class); + } + + /** + * @summary 批量获取权限空间详情列表 + * @description 分别通过权限空间唯一标志符(Code),获取权限空间详情。 + **/ + public GetPermissionNamespaceListResponseDto getPermissionNamespacesBatch( + GetPermissionNamespacesBatchDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-permission-namespaces-batch"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetPermissionNamespaceListResponseDto.class); + } + + /** + * @summary 分页获取权限空间列表 + * @description 分页获取权限空间列表。 + **/ + public PermissionNamespaceListPaginatedRespDto listPermissionNamespaces( + ListPermissionNamespacesDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-permission-namespaces"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, PermissionNamespaceListPaginatedRespDto.class); + } + + /** + * @summary 修改权限空间 + * @description 修改权限空间,可以修改权限空间名称、权限空间描述信息以及权限空间新的唯一标志符(Code)。 + **/ + public UpdatePermissionNamespaceResponseDto updatePermissionNamespace( + UpdatePermissionNamespaceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-permission-namespace"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, UpdatePermissionNamespaceResponseDto.class); + } + + /** + * @summary 删除权限空间 + * @description 通过权限空间唯一标志符(Code),删除权限空间信息。 + **/ + public IsSuccessRespDto deletePermissionNamespace(DeletePermissionNamespaceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-permission-namespace"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 批量删除权限空间 + * @description 分别通过权限空间唯一标志符(Code),批量删除权限空间信息。 + **/ + public IsSuccessRespDto deletePermissionNamespacesBatch( + DeletePermissionNamespacesBatchDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-permission-namespaces-batch"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } + + /** + * @summary 校验权限空间 Code 或者名称是否可用 + * @description 通过用户池 ID 和权限空间 Code,或者用户池 ID 和权限空间名称查询是否可用。 + **/ + public PermissionNamespaceCheckExistsRespDto checkPermissionNamespaceExists( + CheckPermissionNamespaceExistsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/check-permission-namespace-exists"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, PermissionNamespaceCheckExistsRespDto.class); + } + + /** + * @summary 分页查询权限空间下所有的角色列表 + * @description 分页查询权限空间下所有的角色列表,分页获取权限空间下所有的角色列表。 + **/ + public PermissionNamespaceRolesListPaginatedRespDto listPermissionNamespaceRoles( + ListPermissionNamespaceRolesDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-permission-namespace-roles"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, PermissionNamespaceRolesListPaginatedRespDto.class); + } + + /** + * @summary 创建数据资源 + * @description 该接口用于创建数据资源,通过数据资源所属权限空间 Code、数据资源名称、数据资源 + * Code、数据资源类型(STRING、ARRAY、TREE)以及数据操作列表进行创建, 通过不同的数据资源类型适配不同的场景。 + *

+ * ### 创建数据资源字符串类型示例 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "resourceName": "字符串资源1", + * "resourceCode": "str1", "type": "STRING", "description": "这是一个数据资源字符串类型创建", "struct":"str1", + * "actions": ["get","read","update"] } ``` + *

+ * ### 创建数据资源数组类型示例 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "resourceName": "数组资源1", + * "resourceCode": "array1", "description": "这是一个数据资源数组类型创建", "type": "ARRAY", "struct":["array1", + * "array2", "array3"], "actions": ["get","read","update"] } ``` + *

+ * ### 创建数据资源树类型示例 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "resourceName": "树资源1", + * "resourceCode": "tree1", "description": "这是一个数据资源树类型创建", "type": "TREE", "struct":[{ "code": + * "tree1", "name": "tree1", "value": "tree1", "children": [{ "code": "tree2", "name": "tree2", + * "value": "tree2", "children": [{ "code": "tree3", "name": "tree3", "value": "tree3" }] }] }], + * "actions": ["get","read","update"] } ``` + **/ + public CreateDataResourceResponseDto createDataResource(CreateDataResourceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-data-resource"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CreateDataResourceResponseDto.class); + } + + /** + * @summary 创建字符串数据资源 + * @description 创建字符串数据资源,通过数据资源所属权限空间 Code、数据资源名称、数据资源 Code、数据资源节点和数据资源权限操作等字段进行创建 + **/ + public CreateStringDataResourceResponseDto createDataResourceByString( + CreateStringDataResourceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-string-data-resource"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CreateStringDataResourceResponseDto.class); + } + + /** + * @summary 创建数组数据资源 + * @description 创建字符串数据资源,通过数据资源所属权限空间 Code、数据资源名称、数据资源 Code、数据资源节点和数据资源权限操作等字段进行创建 + **/ + public CreateArrayDataResourceResponseDto createDataResourceByArray( + CreateArrayDataResourceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-array-data-resource"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CreateArrayDataResourceResponseDto.class); + } + + /** + * @summary 创建树数据资源 + * @description 创建树数据资源,通过数据资源所属权限空间 Code、数据资源名称、数据资源 Code、数据资源节点和数据资源权限操作等字段进行创建 + **/ + public CreateTreeDataResourceResponseDto createDataResourceByTree( + CreateTreeDataResourceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-tree-data-resource"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CreateTreeDataResourceResponseDto.class); + } + + /** + * @summary 获取数据资源列表 + * @description 获取数据资源列表, 可通过数据资源名称、数据资源 Code 和数据资源所属权限空间 Code 列表进行指定筛选。 + **/ + public ListDataResourcesPaginatedRespDto listDataResources(ListDataResourcesDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-data-resources"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, ListDataResourcesPaginatedRespDto.class); + } + + /** + * @summary 获取数据资源信息 + * @description 获取数据资源, 通过数据资源 ID 查询对应的数据资源信息,包含数据资源名称、数据资源 + * Code、数据资源类型(TREE、STRING、ARRAY)、数据资源所属权限空间 ID、数据资源所属权限空间 Code 以及数据资源操作列表等基本信息。 + **/ + public GetDataResourceResponseDto getDataResource(GetDataResourceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-data-resource"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetDataResourceResponseDto.class); + } + + /** + * @summary 修改数据资源 + * @description 修改数据资源, 根据权限空间 Code 和数据资源 Code 查询原始信息,只允许修改数据资源名称、描述和数据资源节点。 + **/ + public UpdateDataResourceResponseDto updateDataResource(UpdateDataResourceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-data-resource"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, UpdateDataResourceResponseDto.class); + } + + /** + * @summary 删除数据资源 + * @description 删除数据资源, 根据数据资源 ID 删除对应的数据资源信息。 + **/ + public CommonResponseDto deleteDataResource(DeleteDataResourceDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-data-resource"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 检查数据资源名称或者 Code 是否可用 + * @description 检查数据资源名称或者 Code 在权限空间内是否有效,通过数据资源名称或者数据资源 Code 以及所属权限空间 Code,判断在指定的权限空间内是否可用。 + *

+ * ### 数据资源 Code 有效示例 + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "resourceCode": "test" } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 0, "data": { "isValid": "true" } } + * ``` + *

+ * ### 数据资源名称有效示例 + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "resourceName": "test" } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 0, "data": { "isValid": "true" } } + * ``` + *

+ * ### 数据资源 Code 无效示例 + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "resourceCode": "test" } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 0, "requestId": + * "934108e5-9fbf-4d24-8da1-c330328abd6c", "data": { "isValid": "false", "message": "data resource + * code already exist" } } ``` + **/ + public CheckParamsDataResourceResponseDto checkDataResourceExists( + CheckDataResourceExistsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/check-data-resource-exists"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, CheckParamsDataResourceResponseDto.class); + } + + /** + * @summary 创建数据策略 + * @description 创建数据策略,通过数据策略名称、数据策略描述以及资源节点列表进行创建,数据策略支持跨多个权限空间进行数据资源创建,并且支持创建时设置数据资源是否具有操作权限。 + *

+ * ```json { "policyName": "示例数据策略", "description": "这是一个示例数据策略", "statementList": [ { "effect": + * "ALLOW", "permissions": [ "examplePermissionNamespaceCode/strResourceCode/exampleAction", + * "examplePermissionNamespaceCode/arrResourceCode/exampleAction", + * "examplePermissionNamespaceCode/treeResourceCode/strutCode1/exampleAction" ] }, { "effect": + * "DENY", "permissions": [ "examplePermissionNamespaceCode/strResourceCode1/exampleAction", + * "examplePermissionNamespaceCode/arrResourceCode1/exampleAction", + * "examplePermissionNamespaceCode/treeResourceCode1/strutCode1/exampleAction" ] } ] } ``` + **/ + public CreateDataPolicyResponseDto createDataPolicy(CreateDataPolicyDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-data-policy"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CreateDataPolicyResponseDto.class); + } + + /** + * @summary 获取数据策略列表 + * @description 分页查询数据策略列表,也可通过关键字搜索数据策略名称或者数据策略 Code 进行模糊查找。 + **/ + public ListDataPoliciesPaginatedRespDto listDataPolices(ListDataPoliciesDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-data-policies"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, ListDataPoliciesPaginatedRespDto.class); + } + + /** + * @summary 获取数据策略简略信息列表 + * @description 分页获取数据策略简略信息列表,通过关键字搜索数据策略名称或者数据策略 Code 进行模糊查找出数据策略 ID、数据策略名称和数据策略描述信息。 + **/ + public ListSimpleDataPoliciesPaginatedRespDto listSimpleDataPolices( + ListSimpleDataPoliciesDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-simple-data-policies"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, ListSimpleDataPoliciesPaginatedRespDto.class); + } + + /** + * @summary 获取数据策略信息 + * @description 获取数据策略信息,通过数据策略 ID 获取对应数据策略信息,包含数据策略 ID、数据策略名称、数据策略描述、数据策略下所有的数据权限列表等信息。 + **/ + public GetDataPolicyResponseDto getDataPolicy(GetDataPolicyDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-data-policy"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetDataPolicyResponseDto.class); + } + + /** + * @summary 修改数据策略 + * @description 修改数据策略,通过数据策略名称、数据策略描述和相关的数据资源等字段修改数据策略信息。 + **/ + public UpdateDataPolicyResponseDto updateDataPolicy(UpdateDataPolicyDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-data-policy"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, UpdateDataPolicyResponseDto.class); + } + + /** + * @summary 删除数据策略 + * @description 删除数据策略,通过数据策略 ID 删除对应的策略,同时也删除数据策略和对应的数据资源等关系数据。 + **/ + public CommonResponseDto deleteDataPolicy(DeleteDataPolicyDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-data-policy"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 校验数据策略名称是否有效 + * @description 通过数据策略名称查询用户池内是否有效。 + **/ + public CheckParamsDataPolicyResponseDto checkDataPolicyExists(CheckDataPolicyExistsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/check-data-policy-exists"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, CheckParamsDataPolicyResponseDto.class); + } + + /** + * @summary 获取数据策略下所有的授权主体的信息 + * @description 获取数据策略下所有的授权主体的信息,通过授权主体类型、数据策略 ID 和数据资源 ID 查找授权主体列表。 + **/ + public ListDataPolicySubjectPaginatedRespDto listDataPolicyTargets( + ListDataPolicyTargetsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-data-policy-targets"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, ListDataPolicySubjectPaginatedRespDto.class); + } + + /** + * @summary 授权数据策略 + * @description 数据策略创建主体授权,通过授权主体和数据策略进行相互授权。 + **/ + public CommonResponseDto authorizeDataPolicies(CreateAuthorizeDataPolicyDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/authorize-data-policies"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 撤销数据策略 + * @description 删除数据策略相关的主体授权,通过授权主体 ID、授权主体类型和数据策略 ID 进行删除。 + **/ + public CommonResponseDto revokeDataPolicy(DeleteAuthorizeDataPolicyDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/revoke-data-policy"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 获取用户权限列表 + * @description 该接口用于用户列表权限查询,可以通过用户 ID 列表进行批量查询权限,也可以通过查询多个用户在同一个权限空间的权限,不同数据资源类型返回相应的资源结果。 + *

+ * ### 查询一个用户拥有的数组资源、字符串资源和树资源权限列表示例 + *

+ * - 入参 + *

+ * ```json { "userIds": [ "6301ceaxxxxxxxxxxx27478" ] } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data": { + * "userPermissionList": [ { "userId": "6301ceaxxxxxxxxxxx27478", "namespaceCode": + * "examplePermissionNamespace", "resourceList": [ { "resourceCode": "strCode", "resourceType": + * "STRING", "strAuthorize": { "value": "示例字符串资源", "actions": [ "read", "post", "get", "write" ] } + * }, { "resourceCode": "arrayCode", "resourceType": "ARRAY", "arrAuthorize": { "values": [ + * "示例数据资源1", "示例数据资源2" ], "actions": [ "read", "post", "get", "write" ] } }, { "resourceCode": + * "treeCode", "resourceType": "TREE", "treeAuthorize": { "authList": [ { "nodePath": + * "/treeChildrenCode/treeChildrenCode1", "nodeActions": [ "read", "get" ], "nodeName": + * "treeChildrenName1", "nodeValue": "treeChildrenValue1" }, { "nodePath": + * "/treeChildrenCode/treeChildrenCode2", "nodeActions": [ "read", "get" ], "nodeName": + * "treeChildrenName2", "nodeValue": "treeChildrenValue2" }, { "nodePath": + * "/treeChildrenCode/treeChildrenCode3", "nodeActions": [ "read" ], "nodeName": + * "treeChildrenName3", "nodeValue": "treeChildrenValue3" } ] } } ] } ] } } ``` + *

+ * ### 查询多个用户权限列表示例 + *

+ * - 入参 + *

+ * ```json { "userIds": [ "6301ceaxxxxxxxxxxx27478", "6121ceaxxxxxxxxxxx27312" ] } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data": { + * "userPermissionList": [ { "userId": "6301ceaxxxxxxxxxxx27478", "namespaceCode": + * "examplePermissionNamespace1", "resourceList": [ { "resourceCode": "strCode", "resourceType": + * "STRING", "strAuthorize": { "value": "示例字符串资源", "actions": [ "read", "post", "get", "write" ] } + * } ] }, { "userId": "6121ceaxxxxxxxxxxx27312", "namespaceCode": "examplePermissionNamespace2", + * "resourceList": [ { "resourceCode": "arrayCode", "resourceType": "ARRAY", "arrAuthorize": { + * "values": [ "示例数组资源1", "示例数组资源2" ], "actions": [ "read", "post", "get", "write" ] } } ] } ] } } + * ``` + *

+ * ### 查询多个用户在多个权限空间下权限列表示例 + *

+ * - 入参 + *

+ * ```json { "userIds": [ "6301ceaxxxxxxxxxxx27478", "6121ceaxxxxxxxxxxx27312" ], + * "namespaceCodes": [ "examplePermissionNamespace1", "examplePermissionNamespace2" ] } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data": { + * "userPermissionList": [ { "userId": "6301ceaxxxxxxxxxxx27478", "namespaceCode": + * "examplePermissionNamespace1", "resourceList": [ { "resourceCode": "strCode1", "resourceType": + * "STRING", "strAuthorize": { "value": "示例字符串资源", "actions": [ "read", "post", "get", "write" ] } + * } ] }, { "userId": "6121ceaxxxxxxxxxxx27312", "namespaceCode": "examplePermissionNamespace2", + * "resourceList": [ { "resourceCode": "arrayCode", "resourceType": "ARRAY", "arrAuthorize": { + * "values": [ "示例数组资源1", "示例数组资源2" ], "actions": [ "read", "post", "get", "write" ] } } ] } ] } } + * ``` + **/ + public GetUserPermissionListRespDto getUserPermissionList(GetUserPermissionListDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-permission-list"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, GetUserPermissionListRespDto.class); + } + + /** + * @summary 判断用户权限 + * @description 该接口用于判断用户权限,通过权限空间 Code、用户 ID、资源操作以及资源列表来判断用户是否对资源拥有操作权限。可选传条件属性参数,默认不开启条件判断。 + *

+ * ### 判断用户对字符串和数组资源权限示例(无条件判断) + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "userId": "63721xxxxxxxxxxxxdde14a3", + * "action": "get", "resources":["strResourceCode1", "arrayResourceCode1"] } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data": { "checkResultList": + * [ { "namespaceCode": "examplePermissionNamespace", "resource": "strResourceCode1", "action": + * "get", "enabled": true }, { "namespaceCode": "examplePermissionNamespace", "resource": + * "arrayResourceCode1", "action": "get", "enabled": true } ] } } ``` + *

+ * ### 判断用户对字符串和数组资源权限示例(开启条件判断) + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "userId": "63721xxxxxxxxxxxxdde14a3", + * "action": "get", "resources": ["strResourceCode1", "arrayResourceCode1"], + * "judgeConditionEnabled": true, "authEnvParams":{ "ip":"110.96.0.0", "city":"北京", + * "province":"北京", "country":"中国", "deviceType":"PC", "systemType":"ios", "browserType":"IE", + * "requestDate":"2022-12-26 17:40:00" } } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data": { "checkResultList": + * [ { "namespaceCode": "examplePermissionNamespace", "resource": "strResourceCode1", "action": + * "get", "enabled": false }, { "namespaceCode": "examplePermissionNamespace", "resource": + * "arrayResourceCode1", "action": "get", "enabled": false } ] } } ``` + *

+ * ### 判断用户对树资源权限示例 + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "userId": "63721xxxxxxxxxxxxdde14a3", + * "action": "get", "resources":["treeResourceCode1/StructCode1/resourceStructChildrenCode1", + * "treeResourceCode2/StructCode1/resourceStructChildrenCode1"] } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "checkResultList": + * [{ "namespaceCode": "examplePermissionNamespace", "action": "get", "resource": + * "treeResourceCode1/StructCode1/resourceStructChildrenCode1", "enabled": true },{ + * "namespaceCode": "examplePermissionNamespace", "action": "get", "resource": + * "treeResourceCode2/StructCode1/resourceStructChildrenCode1", "enabled": true }] } } ``` + **/ + public CheckPermissionRespDto checkPermission(CheckPermissionDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/check-permission"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CheckPermissionRespDto.class); + } + + /** + * @summary 判断外部用户权限 + * @description 判断外部用户权限 + **/ + public CheckExternalUserPermissionRespDto checkExternalUserPermission( + CheckExternalUserPermissionDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/check-external-user-permission"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CheckExternalUserPermissionRespDto.class); + } + + /** + * @summary 获取用户指定资源权限列表 + * @description 该接口主要用于获取用户指定资源的权限列表, 通过权限空间 Code、用户 ID 以及资源列表查询所有权限。 + *

+ * ### 获取用户字符串和数组资源权限示例 + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "userId": "63721xxxxxxxxxxxxdde14a3", + * "resources":["strResourceCode1", "arrayResourceCode1"] } ``` + *

+ * - 出参 + *

+ * ```json { + *

+ * "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "permissionList": [{ + * "namespaceCode": "examplePermissionNamespace", "actions": ["read","get"], "resource": + * "strResourceCode1" },{ "namespaceCode": "examplePermissionNamespace", "actions": + * ["read","update","delete"], "resource": "arrayResourceCode1" }] } } ``` + *

+ * ### 获取用户树资源权限示例 + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "userId": "63721xxxxxxxxxxxxdde14a3", + * "resources":["treeResourceCode1/StructCode1/resourceStructChildrenCode1", + * "treeResourceCode2/StructCode1/resourceStructChildrenCode1"] } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "permissionList": [{ + * "namespaceCode": "examplePermissionNamespace", "actions": ["read", "update", "delete"], + * "resource": "treeResourceCode1/StructCode1/resourceStructChildrenCode1" },{ "namespaceCode": + * "examplePermissionNamespace", "actions": ["read", "get", "delete"], "resource": + * "treeResourceCode2/StructCode1/resourceStructChildrenCode1" }] } } ``` + **/ + public GetUserResourcePermissionListRespDto getUserResourcePermissionList( + GetUserResourcePermissionListDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-resource-permission-list"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, GetUserResourcePermissionListRespDto.class); + } + + /** + * @summary 获取资源被授权的用户列表 + * @description 该接口主要用于获取资源被授权的用户列表,通过权限空间 Code 、资源操作列表以及资源列表查询有权限的用户列表。 + *

+ * ### 获取字符串和数组资源被授权的用户列表示例 + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "actions": ["get", "update", "read"], + * "resources":["strResourceCode1", "arrayResourceCode1"] } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "authUserList": [{ + * "resource": "strResourceCode1", "actionAuthList": [{ "userIds": ["63721xxxxxxxxxxxxdde14a3"], + * "action": "get" },{ "userIds": ["63721xxxxxxxxxxxxdde14a3"], "action": "update" },{ "userIds": + * ["63721xxxxxxxxxxxxdde14a3"], "action": "read" }] },{ "resource": "arrayResourceCode1", + * "actionAuthList": [{ "userIds": ["63721xxxxxxxxxxxxdde14a3"], "action": "get" },{ "userIds": + * ["63721xxxxxxxxxxxxdde14a3"], "action": "update" },{ "userIds": ["63721xxxxxxxxxxxxdde14a3"], + * "action": "read" }] }] } } ``` + *

+ * ### 获取树资源被授权的用户列表示例 + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "actions": ["get", "update", + * "delete"], "resources":["treeResourceCode1/StructCode1/resourceStructChildrenCode1", + * "treeResourceCode2/StructCode1/resourceStructChildrenCode1"] } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "authUserList": [{ + * "resource": "treeResourceCode1/StructCode1/resourceStructChildrenCode1", "actionAuthList": [{ + * "userIds": ["63721xxxxxxxxxxxxdde14a3"], "action": "get" },{ "userIds": + * ["63721xxxxxxxxxxxxdde14a3"], "action": "update" },{ "userIds": ["63721xxxxxxxxxxxxdde14a3"], + * "action": "delete" }] },{ "resource": + * "treeResourceCode2/StructCode1/resourceStructChildrenCode1", "actionAuthList": [{ "userIds": + * ["63721xxxxxxxxxxxxdde14a3"], "action": "get" },{ "userIds": ["63721xxxxxxxxxxxxdde14a3"], + * "action": "update" },{ "userIds": ["63721xxxxxxxxxxxxdde14a3"], "action": "delete" }] }] } } + * ``` + **/ + public ListResourceTargetsRespDto listResourceTargets(ListResourceTargetsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-resource-targets"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, ListResourceTargetsRespDto.class); + } + + /** + * @summary 获取用户授权资源的结构列表 + * @description 该接口主要用于获取用户授权的资源列表,通过权限空间 Code、用户 Id、资源 Code 获取用户资源的授权列表,通过不同的资源类型返回对应资源的授权。 + *

+ * ### 获取用户授权字符串数据资源示例 + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "userId": "63721xxxxxxxxxxxxdde14a3", + * "resourceCode": "exampleStrResourceCode" } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "namespaceCode": + * "exampleNamespaceCode", "resourceCode": "exampleStrResourceCode", "resourceType": "STRING", + * "strResourceAuthAction":{ "value": "strTestValue", "actions": ["get","delete"] } } } ``` + *

+ *

+ * ### 获取用户授权数据数组资源示例 + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "userId": "63721xxxxxxxxxxxxdde14a3", + * "resourceCode": "exampleArrResourceCode" } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "namespaceCode": + * "exampleNamespaceCode", "resourceCode": "exampleArrResourceCode", "resourceType": "ARRAY", + * "arrResourceAuthAction":{ "values": ["arrTestValue1","arrTestValue2","arrTestValue3"], + * "actions": ["get","delete"] } } } ``` + *

+ *

+ * ### 获取用户授权树数据资源示例 + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "userId": "63721xxxxxxxxxxxxdde14a3", + * "resourceCode": "exampleArrResourceCode" } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "namespaceCode": + * "exampleNamespaceCode", "resourceCode": "exampleArrResourceCode", "resourceType": "TREE", + * "treeResourceAuthAction":{ "nodeAuthActionList":[{ "code": "tree11", "name": "tree11", "value": + * "test11Value", "actions": ["get","delete"], "children": [{ "code": "tree111", "name": + * "tree111", "value": "test111Value", "actions": ["update","read"], }] },{ "code": "tree22", + * "name": "tree22", "value": "test22Value", "actions": ["get","delete"] }] } } } ``` + **/ + public GetUserResourceStructRespDto getUserResourceStruct(GetUserResourceStructDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-user-resource-struct"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, GetUserResourceStructRespDto.class); + } + + /** + * @summary 获取外部用户授权资源的结构列表 + * @description 该接口主要用于获取外部用户授权的资源列表,通过权限空间 Code、外部用户 Id、资源 Code + * 获取外部用户资源的授权列表,通过不同的资源类型返回对应资源的授权。 + *

+ *

+ * ### 获取用户授权字符串数据资源示例 + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "externalId": + * "63721xxxxxxxxxxxxdde14a3", "resourceCode": "exampleStrResourceCode" } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "namespaceCode": + * "exampleNamespaceCode", "resourceCode": "exampleStrResourceCode", "resourceType": "STRING", + * "strResourceAuthAction":{ "value": "strTestValue", "actions": ["get","delete"] } } } ``` + *

+ *

+ * ### 获取用户授权数据数组资源示例 + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "externalId": + * "63721xxxxxxxxxxxxdde14a3", "resourceCode": "exampleArrResourceCode" } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "namespaceCode": + * "exampleNamespaceCode", "resourceCode": "exampleArrResourceCode", "resourceType": "ARRAY", + * "arrResourceAuthAction":{ "values": ["arrTestValue1","arrTestValue2","arrTestValue3"], + * "actions": ["get","delete"] } } } ``` + *

+ *

+ * ### 获取用户授权树数据资源示例 + *

+ * - 入参 + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "externalId": + * "63721xxxxxxxxxxxxdde14a3", "resourceCode": "exampleArrResourceCode" } ``` + *

+ * - 出参 + *

+ * ```json { "statusCode": 200, "message": "操作成功", "apiCode": 20001, "data":{ "namespaceCode": + * "exampleNamespaceCode", "resourceCode": "exampleArrResourceCode", "resourceType": "TREE", + * "treeResourceAuthAction":{ "nodeAuthActionList":[{ "code": "tree11", "name": "tree11", "value": + * "test11Value", "actions": ["get","delete"], "children": [{ "code": "tree111", "name": + * "tree111", "value": "test111Value", "actions": ["update","read"], }] },{ "code": "tree22", + * "name": "tree22", "value": "test22Value", "actions": ["get","delete"] }] } } } ``` + **/ + public GetExternalUserResourceStructRespDto getExternalUserResourceStruct( + GetExternalUserResourceStructDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-external-user-resource-struct"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, GetExternalUserResourceStructRespDto.class); + } + + /** + * @summary 判断用户在树资源同层级下的权限 + * @description 该接口主要用于判断用户在树资源同层级下的权限,通过权限空间 Code 、用户 + * ID、资源操作、资源或资源子节点查询用户是否有该树资源同级路径的权限。可选传条件属性参数,默认不开启条件判断。 + *

+ *

+ * ### 判断用户在树资源同层级权限示例(无条件判断) + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "userId": "63721xxxxxxxxxxxxdde14a3", + * "action": "read", "resource": "treeResourceCode/structCode", "resourceNodeCodes": + * ["resourceStructChildrenCode1","resourceStructChildrenCode2","resourceStructChildrenCode3"] } + * ``` + *

+ * ### 判断用户在树资源同层级权限示例(开启条件判断) + *

+ * ```json { "namespaceCode": "examplePermissionNamespace", "userId": "63721xxxxxxxxxxxxdde14a3", + * "action": "read", "resource": "treeResourceCode/structCode", "resourceNodeCodes": + * ["resourceStructChildrenCode1","resourceStructChildrenCode2","resourceStructChildrenCode3"], + * "judgeConditionEnabled": true, "authEnvParams":{ "ip":"110.96.0.0", "city":"北京", + * "province":"北京", "country":"中国", "deviceType":"PC", "systemType":"ios", "browserType":"IE", + * "requestDate":"2022-12-26 17:40:00" } } ``` + **/ + public CheckUserSameLevelPermissionResponseDto checkUserSameLevelPermission( + CheckUserSameLevelPermissionDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/check-user-same-level-permission"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CheckUserSameLevelPermissionResponseDto.class); + } + + /** + * @summary 获取套餐详情 + * @description 获取当前用户池套餐详情。 + **/ + public CostGetCurrentPackageRespDto getCurrentPackageInfo() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-current-package-info"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, CostGetCurrentPackageRespDto.class); + } + + /** + * @summary 获取用量详情 + * @description 获取当前用户池用量详情。 + **/ + public CostGetCurrentUsageRespDto getUsageInfo() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-usage-info"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, CostGetCurrentUsageRespDto.class); + } + + /** + * @summary 获取 MAU 使用记录 + * @description 获取当前用户池 MAU 使用记录 + **/ + public CostGetMauPeriodUsageHistoryRespDto getMauPeriodUsageHistory( + GetMauPeriodUsageHistoryDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-mau-period-usage-history"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, CostGetMauPeriodUsageHistoryRespDto.class); + } + + /** + * @summary 获取所有权益 + * @description 获取当前用户池所有权益 + **/ + public CostGetAllRightItemRespDto getAllRightsItem() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-all-rights-items"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, CostGetAllRightItemRespDto.class); + } + + /** + * @summary 获取订单列表 + * @description 获取当前用户池订单列表 + **/ + public CostGetOrdersRespDto getOrders(GetOrdersDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-orders"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, CostGetOrdersRespDto.class); + } + + /** + * @summary 获取订单详情 + * @description 获取当前用户池订单详情 + **/ + public CostGetOrderDetailRespDto getOrderDetail(GetOrderDetailDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-order-detail"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, CostGetOrderDetailRespDto.class); + } + + /** + * @summary 获取订单支付明细 + * @description 获取当前用户池订单支付明细 + **/ + public CostGetOrderPayDetailRespDto getOrderPayDetail(GetOrderPayDetailDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-order-pay-detail"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, CostGetOrderPayDetailRespDto.class); + } + + /** + * @summary 点击联系我们 + * @description 用户点击联系我们事件 + **/ + public Object costContactClick() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/click-cost-contact"); + + config.setMethod("POST"); + String response = request(config); + return deserialize(response, Object.class); + } + + /** + * @summary 创建自定义事件应用 + * @description 创建自定义事件应用 + **/ + public Object createEventApp(CreateEventAppDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-event-app"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, Object.class); + } + + /** + * @summary 获取事件应用列表 + * @description 获取事件应用列表 + **/ + public EventAppPaginatedRespDto listEventApps() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-event-apps"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, EventAppPaginatedRespDto.class); + } + + /** + * @summary 获取事件列表 + * @description 获取 Authing 服务支持的所有事件列表 + **/ + public OpenEventPaginatedRespDto listEvents(ListEventsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-events"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, OpenEventPaginatedRespDto.class); + } + + /** + * @summary 定义自定义事件 + * @description 在 Authing 事件中心定义自定义事件 + **/ + public CommonResponseDto defineEvent(DefineEventDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/define-event"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 推送自定义事件 + * @description 向 Authing 事件中心推送自定义事件 + **/ + public PubEventRespDto verifyEvent(PubEventDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/pub-event"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, PubEventRespDto.class); + } + + /** + * @summary 认证端推送自定义事件 + * @description 认证端向 Authing 事件中心推送自定义事件 + **/ + public PubEventRespDto pubUserEvent(PubEventDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/pub-userEvent"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, PubEventRespDto.class); + } + + /** + * @summary 获取推送登录请求关联的客户端应用 + * @description 此端点用于在 Authing 令牌 APP 收到推送登录通知时,可检查当前用户登录的应用是否支持对推送登录请求进行授权。 + **/ + public GetPushCodeRelationAppsRespDto getPushLoginRelationApps( + GetPushCodeRelationAppsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-pushlogin-relation-apps"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, GetPushCodeRelationAppsRespDto.class); + } + + /** + * @summary 获取快速认证二维码数据 + * @description 此端点用于在用户个人中心,获取快速认证参数生成二维码,可使用 Authing 令牌 APP 扫码,完成快速认证。**此接口要求具备用户的登录态**。 + **/ + public GeneFastpassQRCodeRespDto geneFastpassQrcodeInfo(SignInFastpassDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/gene-fastpass-qrcode-info"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, GeneFastpassQRCodeRespDto.class); + } + + /** + * @summary 获取快速认证的应用列表 + * @description 此端点用于使用 Authing 令牌 APP 扫「用户个人中心」-「快速认证」二维码后,拉取可快速认证的客户端应用列表。 + **/ + public GetFastpassQRCodeRelationAppsRespDto getFastpassParams(GetFastpassClientAppsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-fastpass-client-apps"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetFastpassQRCodeRelationAppsRespDto.class); + } + + /** + * @summary 查询个人中心「快速认证二维码」的状态 + * @description 按照用户扫码顺序,共分为未扫码、已扫码、已登录、二维码过期以及未知错误五种状态,前端应该通过不同的状态给到用户不同的反馈。 + **/ + public CheckQRCodeStatusRespDto getQrCodeStatus(GetAppLoginQrcodeStatusDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-app-login-qrcode-status"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, CheckQRCodeStatusRespDto.class); + } + + /** + * @summary APP 端扫码登录 + * @description 此端点用于在授权使 APP 成功扫码登录中,对应着在「个人中心」-「快速认证」页面渲染出二维码,终端用户扫码并成功登录的过程。 + **/ + public LoginTokenRespDto qrCodeAppLogin(AppQRCodeLoginDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/qrcode-app-login"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, LoginTokenRespDto.class); + } + + /** + * @summary 创建 Pipeline 函数 + * @description 创建 Pipeline 函数 + **/ + public PipelineFunctionSingleRespDto createPipelineFunction(CreatePipelineFunctionDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-pipeline-function"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, PipelineFunctionSingleRespDto.class); + } + + /** + * @summary 获取 Pipeline 函数详情 + * @description 获取 Pipeline 函数详情 + **/ + public PipelineFunctionSingleRespDto getPipelineFunction(GetPipelineFunctionDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-pipeline-function"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, PipelineFunctionSingleRespDto.class); + } + + /** + * @summary 重新上传 Pipeline 函数 + * @description 当 Pipeline 函数上传失败时,重新上传 Pipeline 函数 + **/ + public PipelineFunctionSingleRespDto reuploadPipelineFunction( + ReUploadPipelineFunctionDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/reupload-pipeline-function"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, PipelineFunctionSingleRespDto.class); + } + + /** + * @summary 修改 Pipeline 函数 + * @description 修改 Pipeline 函数 + **/ + public PipelineFunctionSingleRespDto updatePipelineFunction(UpdatePipelineFunctionDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-pipeline-function"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, PipelineFunctionSingleRespDto.class); + } + + /** + * @summary 修改 Pipeline 函数顺序 + * @description 修改 Pipeline 函数顺序 + **/ + public CommonResponseDto updatePipelineOrder(UpdatePipelineOrderDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-pipeline-order"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 删除 Pipeline 函数 + * @description 删除 Pipeline 函数 + **/ + public CommonResponseDto deletePipelineFunction(DeletePipelineFunctionDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-pipeline-function"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 获取 Pipeline 函数列表 + * @description 获取 Pipeline 函数列表 + **/ + public PipelineFunctionPaginatedRespDto listPipelineFunctions(ListPipelineFunctionsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-pipeline-functions"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, PipelineFunctionPaginatedRespDto.class); + } + + /** + * @summary 获取 Pipeline 日志 + * @description 获取 Pipeline + **/ + public PipelineFunctionPaginatedRespDto getPipelineLogs(GetPipelineLogsDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-pipeline-logs"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, PipelineFunctionPaginatedRespDto.class); + } + + /** + * @summary 创建 Webhook + * @description 你需要指定 Webhook 名称、Webhook 回调地址、请求数据格式、用户真实名称来创建 Webhook。还可选是否启用、请求密钥进行创建 + **/ + public CreateWebhookRespDto createWebhook(CreateWebhookDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-webhook"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CreateWebhookRespDto.class); + } + + /** + * @summary 获取 Webhook 列表 + * @description 获取 Webhook 列表,可选页数、分页大小来获取 + **/ + public GetWebhooksRespDto listWebhooks(ListWebhooksDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-webhooks"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetWebhooksRespDto.class); + } + + /** + * @summary 修改 Webhook 配置 + * @description 需要指定 webhookId,可选 Webhook 名称、Webhook 回调地址、请求数据格式、用户真实名称、是否启用、请求密钥参数进行修改 webhook + **/ + public UpdateWebhooksRespDto updateWebhook(UpdateWebhookDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-webhook"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, UpdateWebhooksRespDto.class); + } + + /** + * @summary 删除 Webhook + * @description 通过指定多个 webhookId,以数组的形式进行 webhook 的删除,如果 webhookId 不存在,不提示报错 + **/ + public DeleteWebhookRespDto deleteWebhook(DeleteWebhookDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-webhook"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, DeleteWebhookRespDto.class); + } + + /** + * @summary 获取 Webhook 日志 + * @description 通过指定 webhookId,可选 page 和 limit 来获取 webhook 日志,如果 webhookId 不存在,不返回报错信息 + **/ + public ListWebhookLogsRespDto getWebhookLogs(ListWebhookLogs reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-webhook-logs"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, ListWebhookLogsRespDto.class); + } + + /** + * @summary 手动触发 Webhook 执行 + * @description 通过指定 webhookId,可选请求头和请求体进行手动触发 webhook 执行 + **/ + public TriggerWebhookRespDto triggerWebhook(TriggerWebhookDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/trigger-webhook"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, TriggerWebhookRespDto.class); + } + + /** + * @summary 获取 Webhook 详情 + * @description 根据指定的 webhookId 获取 webhook 详情 + **/ + public GetWebhookRespDto getWebhook(GetWebhookDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-webhook"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetWebhookRespDto.class); + } + + /** + * @summary 获取 Webhook 事件列表 + * @description 返回事件列表和分类列表 + **/ + public WebhookEventListRespDto getWebhookEventList() { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-webhook-event-list"); + config.setBody(new Object()); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, WebhookEventListRespDto.class); + } + + /** + * @summary 获取协作管理员 AK/SK 列表 + * @description 根据协作管理员 Id 获取协作管理员下所有的 AK/SK 列表 + **/ + public ListAccessKeyResponseDto getAccessKeyList(ListAccessKeyDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/list-access-key"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, ListAccessKeyResponseDto.class); + } + + /** + * @summary 获取协作管理员 AK/SK 详细信息 + * @description 获取协作管理员 AK/SK 详细信息,根据协作管理员 ID 和 accessKeyId 获取对应 AK/SK 的详细信息。 + **/ + public GetAccessKeyResponseDto getAccessKey(GetAccessKeyDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/get-access-key"); + config.setBody(reqDto); + config.setMethod("GET"); + String response = request(config); + return deserialize(response, GetAccessKeyResponseDto.class); + } + + /** + * @summary 创建协作管理员的 AK/SK + * @description 创建协作管理员的 AK/SK,根据协作管理员 ID 生成指定的 AK/SK。 + **/ + public CreateAccessKeyResponseDto createAccessKey(CreateAccessKeyDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/create-access-key"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CreateAccessKeyResponseDto.class); + } + + /** + * @summary 删除协作管理员的 AK/SK + * @description 删除协作管理员的 AK/SK,根据所选择的 AK/SK 的 accessKeyId 进行指定删除。 + **/ + public CommonResponseDto deleteAccessKey(DeleteAccessKeyDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/delete-access-key"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, CommonResponseDto.class); + } + + /** + * @summary 更新一个管理员 AccessKey + * @description 根据 AccessKeyId 更新一个管理员 AccessKey,目前只支持更新 status,status 支持 activated / revoked + **/ + public IsSuccessRespDto updateAccessKey(UpdateAccessKeyDto reqDto) { + AuthingRequestConfig config = new AuthingRequestConfig(); + config.setUrl("/api/v3/update-access-key"); + config.setBody(reqDto); + config.setMethod("POST"); + String response = request(config); + return deserialize(response, IsSuccessRespDto.class); + } } \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/AddTenantDepartmentMembersReqDto.java b/src/main/java/cn/authing/sdk/java/dto/AddTenantDepartmentMembersReqDto.java new file mode 100644 index 00000000..ece3b625 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/AddTenantDepartmentMembersReqDto.java @@ -0,0 +1,106 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class AddTenantDepartmentMembersReqDto { + /** + * 组织 code + */ + @JsonProperty("organizationCode") + private String organizationCode; + /** + * 部门系统 ID(为 Authing 系统自动生成,不可修改) + */ + @JsonProperty("departmentId") + private String departmentId; + /** + * 此次调用中使用的部门 ID 的类型 + */ + @JsonProperty("departmentIdType") + private DepartmentIdType departmentIdType; + /** + * 关联的用户池级别的用户 ID + */ + @JsonProperty("linkUserIds") + private List linkUserIds; + /** + * 租户成员 ID + */ + @JsonProperty("memberIds") + private List memberIds; + /** + * 租户 ID + */ + @JsonProperty("tenantId") + private String tenantId; + + public String getOrganizationCode() { + return organizationCode; + } + public void setOrganizationCode(String organizationCode) { + this.organizationCode = organizationCode; + } + + public String getDepartmentId() { + return departmentId; + } + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } + + public DepartmentIdType getDepartmentIdType() { + return departmentIdType; + } + public void setDepartmentIdType(DepartmentIdType departmentIdType) { + this.departmentIdType = departmentIdType; + } + + public List getLinkUserIds() { + return linkUserIds; + } + public void setLinkUserIds(List linkUserIds) { + this.linkUserIds = linkUserIds; + } + + public List getMemberIds() { + return memberIds; + } + public void setMemberIds(List memberIds) { + this.memberIds = memberIds; + } + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + + /** + * 此次调用中使用的部门 ID 的类型 + */ + public static enum DepartmentIdType { + + @JsonProperty("department_id") + DEPARTMENT_ID("department_id"), + + @JsonProperty("open_department_id") + OPEN_DEPARTMENT_ID("open_department_id"), + ; + + private String value; + + DepartmentIdType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + } + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/AddTenantUsersDto.java b/src/main/java/cn/authing/sdk/java/dto/AddTenantUsersDto.java new file mode 100644 index 00000000..95f5d30b --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/AddTenantUsersDto.java @@ -0,0 +1,35 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class AddTenantUsersDto { + /** + * 关联的用户池级别的用户 ID + */ + @JsonProperty("linkUserIds") + private List linkUserIds; + /** + * 租户 ID + */ + @JsonProperty("tenantId") + private String tenantId; + + public List getLinkUserIds() { + return linkUserIds; + } + public void setLinkUserIds(List linkUserIds) { + this.linkUserIds = linkUserIds; + } + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/AppQRCodeLoginDto.java b/src/main/java/cn/authing/sdk/java/dto/AppQRCodeLoginDto.java new file mode 100644 index 00000000..32073b20 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/AppQRCodeLoginDto.java @@ -0,0 +1,59 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class AppQRCodeLoginDto { + /** + * APP 扫二维码登录: + * - `APP_LOGIN`: APP 扫码登录; + * + */ + @JsonProperty("action") + private Action action; + /** + * 二维码唯一 ID + */ + @JsonProperty("qrcodeId") + private String qrcodeId; + + public Action getAction() { + return action; + } + public void setAction(Action action) { + this.action = action; + } + + public String getQrcodeId() { + return qrcodeId; + } + public void setQrcodeId(String qrcodeId) { + this.qrcodeId = qrcodeId; + } + + + /** + * APP 扫二维码登录: + * - `APP_LOGIN`: APP 扫码登录; + * + */ + public static enum Action { + + @JsonProperty("APP_LOGIN") + APP_LOGIN("APP_LOGIN"), + ; + + private String value; + + Action(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + } + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/ApplicationDto.java b/src/main/java/cn/authing/sdk/java/dto/ApplicationDto.java index a6baca55..96cfdd32 100644 --- a/src/main/java/cn/authing/sdk/java/dto/ApplicationDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/ApplicationDto.java @@ -354,6 +354,9 @@ public static enum AppType { @JsonProperty("api") API("api"), + + @JsonProperty("mini-program") + MINI_PROGRAM("mini-program"), ; private String value; diff --git a/src/main/java/cn/authing/sdk/java/dto/ApplicationEnabledExtIdpConnDto.java b/src/main/java/cn/authing/sdk/java/dto/ApplicationEnabledExtIdpConnDto.java index dc751bed..c4b62a71 100644 --- a/src/main/java/cn/authing/sdk/java/dto/ApplicationEnabledExtIdpConnDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/ApplicationEnabledExtIdpConnDto.java @@ -203,6 +203,18 @@ public static enum ExtIdpType { @JsonProperty("welink") WELINK("welink"), + + @JsonProperty("huawei") + HUAWEI("huawei"), + + @JsonProperty("honor") + HONOR("honor"), + + @JsonProperty("xiaomi") + XIAOMI("xiaomi"), + + @JsonProperty("aws") + AWS("aws"), ; private String value; @@ -248,6 +260,9 @@ public static enum ExtIdpConnType { @JsonProperty("facebook") FACEBOOK("facebook"), + @JsonProperty("facebook:mobile") + FACEBOOK_MOBILE("facebook:mobile"), + @JsonProperty("twitter") TWITTER("twitter"), @@ -284,6 +299,9 @@ public static enum ExtIdpConnType { @JsonProperty("qq") QQ("qq"), + @JsonProperty("qq:mobile") + QQ_MOBILE("qq:mobile"), + @JsonProperty("wechatwork:corp:qrconnect") WECHATWORK_CORP_QRCONNECT("wechatwork:corp:qrconnect"), @@ -302,12 +320,18 @@ public static enum ExtIdpConnType { @JsonProperty("dingtalk") DINGTALK("dingtalk"), + @JsonProperty("dingtalk:mobile") + DINGTALK_MOBILE("dingtalk:mobile"), + @JsonProperty("dingtalk:provider") DINGTALK_PROVIDER("dingtalk:provider"), @JsonProperty("weibo") WEIBO("weibo"), + @JsonProperty("weibo:mobile") + WEIBO_MOBILE("weibo:mobile"), + @JsonProperty("apple") APPLE("apple"), @@ -317,6 +341,9 @@ public static enum ExtIdpConnType { @JsonProperty("baidu") BAIDU("baidu"), + @JsonProperty("baidu:mobile") + BAIDU_MOBILE("baidu:mobile"), + @JsonProperty("lark-internal") LARK_INTERNAL("lark-internal"), @@ -329,6 +356,9 @@ public static enum ExtIdpConnType { @JsonProperty("linkedin") LINKEDIN("linkedin"), + @JsonProperty("linkedin:mobile") + LINKEDIN_MOBILE("linkedin:mobile"), + @JsonProperty("slack") SLACK("slack"), @@ -349,6 +379,18 @@ public static enum ExtIdpConnType { @JsonProperty("ad-kerberos") AD_KERBEROS("ad-kerberos"), + + @JsonProperty("huawei") + HUAWEI("huawei"), + + @JsonProperty("honor") + HONOR("honor"), + + @JsonProperty("xiaomi") + XIAOMI("xiaomi"), + + @JsonProperty("aws") + AWS("aws"), ; private String value; diff --git a/src/main/java/cn/authing/sdk/java/dto/ApplicationSimpleInfoDto.java b/src/main/java/cn/authing/sdk/java/dto/ApplicationSimpleInfoDto.java index 1679126b..5ccb9c25 100644 --- a/src/main/java/cn/authing/sdk/java/dto/ApplicationSimpleInfoDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/ApplicationSimpleInfoDto.java @@ -107,6 +107,9 @@ public static enum AppType { @JsonProperty("api") API("api"), + + @JsonProperty("mini-program") + MINI_PROGRAM("mini-program"), ; private String value; diff --git a/src/main/java/cn/authing/sdk/java/dto/AuthenticationCredentialDto.java b/src/main/java/cn/authing/sdk/java/dto/AuthenticationCredentialDto.java new file mode 100644 index 00000000..a1921dd9 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/AuthenticationCredentialDto.java @@ -0,0 +1,60 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.AuthenticatorAssertionResponseDto; + +public class AuthenticationCredentialDto { + /** + * Base64URL 编码的凭证 ID + */ + @JsonProperty("id") + private String id; + /** + * 原始凭证 ID + */ + @JsonProperty("rawId") + private String rawId; + /** + * 固定值,'public-key' + */ + @JsonProperty("response") + private AuthenticatorAssertionResponseDto response; + /** + * 固定值,'public-key' + */ + @JsonProperty("type") + private String type; + + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + public String getRawId() { + return rawId; + } + public void setRawId(String rawId) { + this.rawId = rawId; + } + + public AuthenticatorAssertionResponseDto getResponse() { + return response; + } + public void setResponse(AuthenticatorAssertionResponseDto response) { + this.response = response; + } + + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/AuthenticationOptionsDto.java b/src/main/java/cn/authing/sdk/java/dto/AuthenticationOptionsDto.java new file mode 100644 index 00000000..ed04ab36 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/AuthenticationOptionsDto.java @@ -0,0 +1,36 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.PublicKeyCredentialRequestOptionsDto; + +public class AuthenticationOptionsDto { + /** + * 认证器认证参数 + */ + @JsonProperty("authenticationOptions") + private PublicKeyCredentialRequestOptionsDto authenticationOptions; + /** + * ticket 需回传,用作向服务器发起验证从认证器获得的认证结果 + */ + @JsonProperty("ticket") + private String ticket; + + public PublicKeyCredentialRequestOptionsDto getAuthenticationOptions() { + return authenticationOptions; + } + public void setAuthenticationOptions(PublicKeyCredentialRequestOptionsDto authenticationOptions) { + this.authenticationOptions = authenticationOptions; + } + + public String getTicket() { + return ticket; + } + public void setTicket(String ticket) { + this.ticket = ticket; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/AuthenticatorAssertionResponseDto.java b/src/main/java/cn/authing/sdk/java/dto/AuthenticatorAssertionResponseDto.java new file mode 100644 index 00000000..2e0f4316 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/AuthenticatorAssertionResponseDto.java @@ -0,0 +1,59 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class AuthenticatorAssertionResponseDto { + /** + * 认证器信息,包含认证状态、签名计数等 + */ + @JsonProperty("authenticatorData") + private String authenticatorData; + /** + * 客户端数据,包含 origin(即凭证请求来源)、挑战码等信息 + */ + @JsonProperty("clientDataJSON") + private String clientDataJSON; + /** + * 认证器签名 + */ + @JsonProperty("signature") + private String signature; + /** + * 创建凭证时的用户 ID + */ + @JsonProperty("userHandle") + private String userHandle; + + public String getAuthenticatorData() { + return authenticatorData; + } + public void setAuthenticatorData(String authenticatorData) { + this.authenticatorData = authenticatorData; + } + + public String getClientDataJSON() { + return clientDataJSON; + } + public void setClientDataJSON(String clientDataJSON) { + this.clientDataJSON = clientDataJSON; + } + + public String getSignature() { + return signature; + } + public void setSignature(String signature) { + this.signature = signature; + } + + public String getUserHandle() { + return userHandle; + } + public void setUserHandle(String userHandle) { + this.userHandle = userHandle; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/AuthenticatorAttestationResponseDto.java b/src/main/java/cn/authing/sdk/java/dto/AuthenticatorAttestationResponseDto.java new file mode 100644 index 00000000..b46920ff --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/AuthenticatorAttestationResponseDto.java @@ -0,0 +1,35 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class AuthenticatorAttestationResponseDto { + /** + * CBOR 编码的认证器数据,包含凭证公钥、凭证 ID、签名、签名计数等信息 + */ + @JsonProperty("attestationObject") + private String attestationObject; + /** + * 客户端数据,包含 origin(即凭证请求来源)、挑战等信息 + */ + @JsonProperty("clientDataJSON") + private String clientDataJSON; + + public String getAttestationObject() { + return attestationObject; + } + public void setAttestationObject(String attestationObject) { + this.attestationObject = attestationObject; + } + + public String getClientDataJSON() { + return clientDataJSON; + } + public void setClientDataJSON(String clientDataJSON) { + this.clientDataJSON = clientDataJSON; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/BindByAccountIdInputApi.java b/src/main/java/cn/authing/sdk/java/dto/BindByAccountIdInputApi.java new file mode 100644 index 00000000..03b70e6b --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/BindByAccountIdInputApi.java @@ -0,0 +1,47 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class BindByAccountIdInputApi { + /** + * 中间态键 + */ + @JsonProperty("key") + private String key; + /** + * 操作编码 + */ + @JsonProperty("action") + private String action; + /** + * 账号 ID + */ + @JsonProperty("accountId") + private String accountId; + + public String getKey() { + return key; + } + public void setKey(String key) { + this.key = key; + } + + public String getAction() { + return action; + } + public void setAction(String action) { + this.action = action; + } + + public String getAccountId() { + return accountId; + } + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/BindByAccountInputApi.java b/src/main/java/cn/authing/sdk/java/dto/BindByAccountInputApi.java new file mode 100644 index 00000000..ab1bc81b --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/BindByAccountInputApi.java @@ -0,0 +1,59 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class BindByAccountInputApi { + /** + * 中间态键 + */ + @JsonProperty("key") + private String key; + /** + * 操作编码 + */ + @JsonProperty("action") + private String action; + /** + * 账号密码 + */ + @JsonProperty("password") + private String password; + /** + * 账号(手机/邮箱/用户名) + */ + @JsonProperty("account") + private String account; + + public String getKey() { + return key; + } + public void setKey(String key) { + this.key = key; + } + + public String getAction() { + return action; + } + public void setAction(String action) { + this.action = action; + } + + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + public String getAccount() { + return account; + } + public void setAccount(String account) { + this.account = account; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/BindByAccountsInputApi.java b/src/main/java/cn/authing/sdk/java/dto/BindByAccountsInputApi.java new file mode 100644 index 00000000..69ce500a --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/BindByAccountsInputApi.java @@ -0,0 +1,47 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class BindByAccountsInputApi { + /** + * 中间态键 + */ + @JsonProperty("key") + private String key; + /** + * 操作编码 + */ + @JsonProperty("action") + private String action; + /** + * 账号 ID + */ + @JsonProperty("account") + private String account; + + public String getKey() { + return key; + } + public void setKey(String key) { + this.key = key; + } + + public String getAction() { + return action; + } + public void setAction(String action) { + this.action = action; + } + + public String getAccount() { + return account; + } + public void setAccount(String account) { + this.account = account; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/BindByEmailCodeInputApi.java b/src/main/java/cn/authing/sdk/java/dto/BindByEmailCodeInputApi.java new file mode 100644 index 00000000..f5a7da8b --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/BindByEmailCodeInputApi.java @@ -0,0 +1,59 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class BindByEmailCodeInputApi { + /** + * 中间态键 + */ + @JsonProperty("key") + private String key; + /** + * 操作编码 + */ + @JsonProperty("action") + private String action; + /** + * 邮箱验证码(四位:1234;六位:123456) + */ + @JsonProperty("code") + private String code; + /** + * 邮箱 + */ + @JsonProperty("email") + private String email; + + public String getKey() { + return key; + } + public void setKey(String key) { + this.key = key; + } + + public String getAction() { + return action; + } + public void setAction(String action) { + this.action = action; + } + + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/BindByPhoneCodeInputApi.java b/src/main/java/cn/authing/sdk/java/dto/BindByPhoneCodeInputApi.java new file mode 100644 index 00000000..48343836 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/BindByPhoneCodeInputApi.java @@ -0,0 +1,71 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class BindByPhoneCodeInputApi { + /** + * 中间态键 + */ + @JsonProperty("key") + private String key; + /** + * 操作编码 + */ + @JsonProperty("action") + private String action; + /** + * 手机验证码(四位:1234;六位:123456) + */ + @JsonProperty("code") + private String code; + /** + * 手机号 + */ + @JsonProperty("phone") + private String phone; + /** + * 国家码(标准格式:加号“+”加国家码数字;当前校验兼容历史用户输入习惯。例,中国国家码标准格式为「+86」,历史用户输入记录中存在「86、086、0086」等格式) + */ + @JsonProperty("phoneCountryCode") + private String phoneCountryCode; + + public String getKey() { + return key; + } + public void setKey(String key) { + this.key = key; + } + + public String getAction() { + return action; + } + public void setAction(String action) { + this.action = action; + } + + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } + + public String getPhoneCountryCode() { + return phoneCountryCode; + } + public void setPhoneCountryCode(String phoneCountryCode) { + this.phoneCountryCode = phoneCountryCode; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/BindByRegiserInputApi.java b/src/main/java/cn/authing/sdk/java/dto/BindByRegiserInputApi.java new file mode 100644 index 00000000..085b5dcd --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/BindByRegiserInputApi.java @@ -0,0 +1,35 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class BindByRegiserInputApi { + /** + * 中间态键 + */ + @JsonProperty("key") + private String key; + /** + * 操作编码 + */ + @JsonProperty("action") + private String action; + + public String getKey() { + return key; + } + public void setKey(String key) { + this.key = key; + } + + public String getAction() { + return action; + } + public void setAction(String action) { + this.action = action; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/ChangePushCodeStatusDto.java b/src/main/java/cn/authing/sdk/java/dto/ChangePushCodeStatusDto.java new file mode 100644 index 00000000..d0fb1562 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/ChangePushCodeStatusDto.java @@ -0,0 +1,64 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class ChangePushCodeStatusDto { + /** + * 修改推送码状态的动作: + * - `CONFIRM`: 修改推送码状态为已授权; + * - `CANCEL`: 修改推送码状态为已取消; + * + */ + @JsonProperty("action") + private Action action; + /** + * 推送码(推送登录唯一 ID) + */ + @JsonProperty("pushCodeId") + private String pushCodeId; + + public Action getAction() { + return action; + } + public void setAction(Action action) { + this.action = action; + } + + public String getPushCodeId() { + return pushCodeId; + } + public void setPushCodeId(String pushCodeId) { + this.pushCodeId = pushCodeId; + } + + + /** + * 修改推送码状态的动作: + * - `CONFIRM`: 修改推送码状态为已授权; + * - `CANCEL`: 修改推送码状态为已取消; + * + */ + public static enum Action { + + @JsonProperty("CONFIRM") + CONFIRM("CONFIRM"), + + @JsonProperty("CANCEL") + CANCEL("CANCEL"), + ; + + private String value; + + Action(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + } + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/CheckDeviceCredentialIdDto.java b/src/main/java/cn/authing/sdk/java/dto/CheckDeviceCredentialIdDto.java new file mode 100644 index 00000000..706a3a22 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/CheckDeviceCredentialIdDto.java @@ -0,0 +1,11 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class CheckDeviceCredentialIdDto { + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/CheckPushCodeStatusDataDto.java b/src/main/java/cn/authing/sdk/java/dto/CheckPushCodeStatusDataDto.java new file mode 100644 index 00000000..8176c24a --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/CheckPushCodeStatusDataDto.java @@ -0,0 +1,68 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.LoginTokenResponseDataDto; + +public class CheckPushCodeStatusDataDto { + /** + * 推送码状态。按照推送登录顺序,共分为 PUSHED(已推送)、AUTHORIZED(用户已授权)、CANCELLED(取消授权)、EXPIRED(推送登录过期)以及 ERROR(未知错误)五种状态。 + */ + @JsonProperty("status") + private Status status; + /** + * 当推送码状态为已授权,此数据才会返回。 + */ + @JsonProperty("tokenSet") + private LoginTokenResponseDataDto tokenSet; + + public Status getStatus() { + return status; + } + public void setStatus(Status status) { + this.status = status; + } + + public LoginTokenResponseDataDto getTokenSet() { + return tokenSet; + } + public void setTokenSet(LoginTokenResponseDataDto tokenSet) { + this.tokenSet = tokenSet; + } + + + /** + * 推送码状态。按照推送登录顺序,共分为 PUSHED(已推送)、AUTHORIZED(用户已授权)、CANCELLED(取消授权)、EXPIRED(推送登录过期)以及 ERROR(未知错误)五种状态。 + */ + public static enum Status { + + @JsonProperty("PUSHED") + PUSHED("PUSHED"), + + @JsonProperty("AUTHORIZED") + AUTHORIZED("AUTHORIZED"), + + @JsonProperty("CANCELLED") + CANCELLED("CANCELLED"), + + @JsonProperty("EXPIRED") + EXPIRED("EXPIRED"), + + @JsonProperty("ERROR") + ERROR("ERROR"), + ; + + private String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + } + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/CheckPushCodeStatusRespDto.java b/src/main/java/cn/authing/sdk/java/dto/CheckPushCodeStatusRespDto.java new file mode 100644 index 00000000..2da477ad --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/CheckPushCodeStatusRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.CheckPushCodeStatusDataDto; + +public class CheckPushCodeStatusRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private CheckPushCodeStatusDataDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public CheckPushCodeStatusDataDto getData() { + return data; + } + public void setData(CheckPushCodeStatusDataDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/CheckPushcodeStatusDto.java b/src/main/java/cn/authing/sdk/java/dto/CheckPushcodeStatusDto.java new file mode 100644 index 00000000..af652e70 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/CheckPushcodeStatusDto.java @@ -0,0 +1,23 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class CheckPushcodeStatusDto { + /** + * 推送码(推送登录唯一 ID) + */ + @JsonProperty("pushCodeId") + private String pushCodeId; + + public String getPushCodeId() { + return pushCodeId; + } + public void setPushCodeId(String pushCodeId) { + this.pushCodeId = pushCodeId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/CheckResourcePermissionsRespDto.java b/src/main/java/cn/authing/sdk/java/dto/CheckResourcePermissionsRespDto.java index da9d4acd..48c5c496 100644 --- a/src/main/java/cn/authing/sdk/java/dto/CheckResourcePermissionsRespDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/CheckResourcePermissionsRespDto.java @@ -21,6 +21,11 @@ public class CheckResourcePermissionsRespDto { */ @JsonProperty("apiCode") private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; /** * 响应数据 */ @@ -48,6 +53,13 @@ public void setApiCode(Integer apiCode) { this.apiCode = apiCode; } + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + public CheckResourcePermissionDataDto getData() { return data; } diff --git a/src/main/java/cn/authing/sdk/java/dto/CreateApplicationDto.java b/src/main/java/cn/authing/sdk/java/dto/CreateApplicationDto.java index 1ae8d631..9e0826be 100644 --- a/src/main/java/cn/authing/sdk/java/dto/CreateApplicationDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/CreateApplicationDto.java @@ -294,6 +294,9 @@ public static enum AppType { @JsonProperty("api") API("api"), + + @JsonProperty("mini-program") + MINI_PROGRAM("mini-program"), ; private String value; diff --git a/src/main/java/cn/authing/sdk/java/dto/CreateApplicationRespDataDto.java b/src/main/java/cn/authing/sdk/java/dto/CreateApplicationRespDataDto.java index 7236ed2a..3e11b2a8 100644 --- a/src/main/java/cn/authing/sdk/java/dto/CreateApplicationRespDataDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/CreateApplicationRespDataDto.java @@ -354,6 +354,9 @@ public static enum AppType { @JsonProperty("api") API("api"), + + @JsonProperty("mini-program") + MINI_PROGRAM("mini-program"), ; private String value; diff --git a/src/main/java/cn/authing/sdk/java/dto/CreateDepartmentReqDto.java b/src/main/java/cn/authing/sdk/java/dto/CreateDepartmentReqDto.java index 1247d0f7..9459061e 100644 --- a/src/main/java/cn/authing/sdk/java/dto/CreateDepartmentReqDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/CreateDepartmentReqDto.java @@ -56,6 +56,11 @@ public class CreateDepartmentReqDto { */ @JsonProperty("departmentIdType") private DepartmentIdType departmentIdType; + /** + * 岗位 id 列表 + */ + @JsonProperty("postIdList") + private String postIdList; /** * 租户 ID */ @@ -132,6 +137,13 @@ public void setDepartmentIdType(DepartmentIdType departmentIdType) { this.departmentIdType = departmentIdType; } + public String getPostIdList() { + return postIdList; + } + public void setPostIdList(String postIdList) { + this.postIdList = postIdList; + } + public String getTenantId() { return tenantId; } diff --git a/src/main/java/cn/authing/sdk/java/dto/CreateEventAppDto.java b/src/main/java/cn/authing/sdk/java/dto/CreateEventAppDto.java new file mode 100644 index 00000000..a61252ad --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/CreateEventAppDto.java @@ -0,0 +1,47 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class CreateEventAppDto { + /** + * 应用 logo + */ + @JsonProperty("logo") + private String logo; + /** + * 应用名称 + */ + @JsonProperty("name") + private String name; + /** + * 应用唯一标志 + */ + @JsonProperty("identifier") + private String identifier; + + public String getLogo() { + return logo; + } + public void setLogo(String logo) { + this.logo = logo; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public String getIdentifier() { + return identifier; + } + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/CreateExtIdpConnDto.java b/src/main/java/cn/authing/sdk/java/dto/CreateExtIdpConnDto.java index 60e7b694..b39cd9da 100644 --- a/src/main/java/cn/authing/sdk/java/dto/CreateExtIdpConnDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/CreateExtIdpConnDto.java @@ -135,6 +135,9 @@ public static enum Type { @JsonProperty("facebook") FACEBOOK("facebook"), + @JsonProperty("facebook:mobile") + FACEBOOK_MOBILE("facebook:mobile"), + @JsonProperty("twitter") TWITTER("twitter"), @@ -171,6 +174,9 @@ public static enum Type { @JsonProperty("qq") QQ("qq"), + @JsonProperty("qq:mobile") + QQ_MOBILE("qq:mobile"), + @JsonProperty("wechatwork:corp:qrconnect") WECHATWORK_CORP_QRCONNECT("wechatwork:corp:qrconnect"), @@ -189,12 +195,18 @@ public static enum Type { @JsonProperty("dingtalk") DINGTALK("dingtalk"), + @JsonProperty("dingtalk:mobile") + DINGTALK_MOBILE("dingtalk:mobile"), + @JsonProperty("dingtalk:provider") DINGTALK_PROVIDER("dingtalk:provider"), @JsonProperty("weibo") WEIBO("weibo"), + @JsonProperty("weibo:mobile") + WEIBO_MOBILE("weibo:mobile"), + @JsonProperty("apple") APPLE("apple"), @@ -204,6 +216,9 @@ public static enum Type { @JsonProperty("baidu") BAIDU("baidu"), + @JsonProperty("baidu:mobile") + BAIDU_MOBILE("baidu:mobile"), + @JsonProperty("lark-internal") LARK_INTERNAL("lark-internal"), @@ -216,6 +231,9 @@ public static enum Type { @JsonProperty("linkedin") LINKEDIN("linkedin"), + @JsonProperty("linkedin:mobile") + LINKEDIN_MOBILE("linkedin:mobile"), + @JsonProperty("slack") SLACK("slack"), @@ -236,6 +254,18 @@ public static enum Type { @JsonProperty("ad-kerberos") AD_KERBEROS("ad-kerberos"), + + @JsonProperty("huawei") + HUAWEI("huawei"), + + @JsonProperty("honor") + HONOR("honor"), + + @JsonProperty("xiaomi") + XIAOMI("xiaomi"), + + @JsonProperty("aws") + AWS("aws"), ; private String value; diff --git a/src/main/java/cn/authing/sdk/java/dto/CreateExtIdpDto.java b/src/main/java/cn/authing/sdk/java/dto/CreateExtIdpDto.java index 3e6e5775..c2ba8f44 100644 --- a/src/main/java/cn/authing/sdk/java/dto/CreateExtIdpDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/CreateExtIdpDto.java @@ -131,6 +131,18 @@ public static enum Type { @JsonProperty("welink") WELINK("welink"), + + @JsonProperty("huawei") + HUAWEI("huawei"), + + @JsonProperty("honor") + HONOR("honor"), + + @JsonProperty("xiaomi") + XIAOMI("xiaomi"), + + @JsonProperty("aws") + AWS("aws"), ; private String value; diff --git a/src/main/java/cn/authing/sdk/java/dto/CreateIdentityDto.java b/src/main/java/cn/authing/sdk/java/dto/CreateIdentityDto.java index 2e4e97ea..f2279202 100644 --- a/src/main/java/cn/authing/sdk/java/dto/CreateIdentityDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/CreateIdentityDto.java @@ -248,6 +248,18 @@ public static enum Provider { @JsonProperty("welink") WELINK("welink"), + + @JsonProperty("huawei") + HUAWEI("huawei"), + + @JsonProperty("honor") + HONOR("honor"), + + @JsonProperty("xiaomi") + XIAOMI("xiaomi"), + + @JsonProperty("aws") + AWS("aws"), ; private String value; diff --git a/src/main/java/cn/authing/sdk/java/dto/CreateMultipleTenantAdminDto.java b/src/main/java/cn/authing/sdk/java/dto/CreateMultipleTenantAdminDto.java new file mode 100644 index 00000000..9ca587d7 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/CreateMultipleTenantAdminDto.java @@ -0,0 +1,71 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class CreateMultipleTenantAdminDto { + /** + * 租户 ID + */ + @JsonProperty("tenantIds") + private List tenantIds; + /** + * 用户 ID + */ + @JsonProperty("userId") + private String userId; + /** + * 是否授权 + */ + @JsonProperty("apiAuthorized") + private Boolean apiAuthorized; + /** + * SMS 通知 + */ + @JsonProperty("sendPhoneNotification") + private Boolean sendPhoneNotification; + /** + * Email 通知 + */ + @JsonProperty("sendEmailNotification") + private Boolean sendEmailNotification; + + public List getTenantIds() { + return tenantIds; + } + public void setTenantIds(List tenantIds) { + this.tenantIds = tenantIds; + } + + public String getUserId() { + return userId; + } + public void setUserId(String userId) { + this.userId = userId; + } + + public Boolean getApiAuthorized() { + return apiAuthorized; + } + public void setApiAuthorized(Boolean apiAuthorized) { + this.apiAuthorized = apiAuthorized; + } + + public Boolean getSendPhoneNotification() { + return sendPhoneNotification; + } + public void setSendPhoneNotification(Boolean sendPhoneNotification) { + this.sendPhoneNotification = sendPhoneNotification; + } + + public Boolean getSendEmailNotification() { + return sendEmailNotification; + } + public void setSendEmailNotification(Boolean sendEmailNotification) { + this.sendEmailNotification = sendEmailNotification; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/CreateOrganizationReqDto.java b/src/main/java/cn/authing/sdk/java/dto/CreateOrganizationReqDto.java index dd11c26b..37c9d5dd 100644 --- a/src/main/java/cn/authing/sdk/java/dto/CreateOrganizationReqDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/CreateOrganizationReqDto.java @@ -36,6 +36,11 @@ public class CreateOrganizationReqDto { */ @JsonProperty("tenantId") private String tenantId; + /** + * 岗位 id 列表 + */ + @JsonProperty("postIdList") + private String postIdList; public String getOrganizationName() { return organizationName; @@ -79,6 +84,13 @@ public void setTenantId(String tenantId) { this.tenantId = tenantId; } + public String getPostIdList() { + return postIdList; + } + public void setPostIdList(String postIdList) { + this.postIdList = postIdList; + } + } \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/CreatePostDto.java b/src/main/java/cn/authing/sdk/java/dto/CreatePostDto.java new file mode 100644 index 00000000..199c2feb --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/CreatePostDto.java @@ -0,0 +1,59 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class CreatePostDto { + /** + * 分组 code + */ + @JsonProperty("code") + private String code; + /** + * 分组名称 + */ + @JsonProperty("name") + private String name; + /** + * 分组描述 + */ + @JsonProperty("description") + private String description; + /** + * 部门 id 列表 + */ + @JsonProperty("departmentIdList") + private String departmentIdList; + + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + public String getDepartmentIdList() { + return departmentIdList; + } + public void setDepartmentIdList(String departmentIdList) { + this.departmentIdList = departmentIdList; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/CreatePostRespDto.java b/src/main/java/cn/authing/sdk/java/dto/CreatePostRespDto.java new file mode 100644 index 00000000..b65ff5ed --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/CreatePostRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.PostInfoDto; + +public class CreatePostRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private PostInfoDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public PostInfoDto getData() { + return data; + } + public void setData(PostInfoDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/CreateTenantCooperatorDto.java b/src/main/java/cn/authing/sdk/java/dto/CreateTenantCooperatorDto.java new file mode 100644 index 00000000..3a50a73a --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/CreateTenantCooperatorDto.java @@ -0,0 +1,71 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class CreateTenantCooperatorDto { + /** + * 策略 + */ + @JsonProperty("policies") + private List policies; + /** + * 用户 ID + */ + @JsonProperty("userId") + private String userId; + /** + * 是否授权 API + */ + @JsonProperty("apiAuthorized") + private Boolean apiAuthorized; + /** + * SMS 通知 + */ + @JsonProperty("sendPhoneNotification") + private Boolean sendPhoneNotification; + /** + * Email 通知 + */ + @JsonProperty("sendEmailNotification") + private Boolean sendEmailNotification; + + public List getPolicies() { + return policies; + } + public void setPolicies(List policies) { + this.policies = policies; + } + + public String getUserId() { + return userId; + } + public void setUserId(String userId) { + this.userId = userId; + } + + public Boolean getApiAuthorized() { + return apiAuthorized; + } + public void setApiAuthorized(Boolean apiAuthorized) { + this.apiAuthorized = apiAuthorized; + } + + public Boolean getSendPhoneNotification() { + return sendPhoneNotification; + } + public void setSendPhoneNotification(Boolean sendPhoneNotification) { + this.sendPhoneNotification = sendPhoneNotification; + } + + public Boolean getSendEmailNotification() { + return sendEmailNotification; + } + public void setSendEmailNotification(Boolean sendEmailNotification) { + this.sendEmailNotification = sendEmailNotification; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/CreateTenantDto.java b/src/main/java/cn/authing/sdk/java/dto/CreateTenantDto.java new file mode 100644 index 00000000..fe14c545 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/CreateTenantDto.java @@ -0,0 +1,83 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class CreateTenantDto { + /** + * 租户名 + */ + @JsonProperty("name") + private String name; + /** + * 租户关联的应用 ID + */ + @JsonProperty("appIds") + private List appIds; + /** + * 租户 logo + */ + @JsonProperty("logo") + private List logo; + /** + * 租户描述 + */ + @JsonProperty("description") + private String description; + /** + * 用户被租户拒绝登录时显示的提示文案 + */ + @JsonProperty("rejectHint") + private String rejectHint; + /** + * 租户来源的应用 ID,该值不存在时代表租户来源为 Authing 控制台 + */ + @JsonProperty("sourceAppId") + private String sourceAppId; + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public List getAppIds() { + return appIds; + } + public void setAppIds(List appIds) { + this.appIds = appIds; + } + + public List getLogo() { + return logo; + } + public void setLogo(List logo) { + this.logo = logo; + } + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + public String getRejectHint() { + return rejectHint; + } + public void setRejectHint(String rejectHint) { + this.rejectHint = rejectHint; + } + + public String getSourceAppId() { + return sourceAppId; + } + public void setSourceAppId(String sourceAppId) { + this.sourceAppId = sourceAppId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/CreateTenantRespDto.java b/src/main/java/cn/authing/sdk/java/dto/CreateTenantRespDto.java new file mode 100644 index 00000000..3dad86a6 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/CreateTenantRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.TenantDto; + +public class CreateTenantRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private TenantDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public TenantDto getData() { + return data; + } + public void setData(TenantDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/CreateTenantUserOptionsDto.java b/src/main/java/cn/authing/sdk/java/dto/CreateTenantUserOptionsDto.java new file mode 100644 index 00000000..cbc9b773 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/CreateTenantUserOptionsDto.java @@ -0,0 +1,93 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class CreateTenantUserOptionsDto { + /** + * 该参数一般在迁移旧有用户数据到 Authing 的时候会设置。开启这个开关,password 字段会直接写入 Authing 数据库,Authing 不会再次加密此字段。如果你的密码不是明文存储,你应该保持开启,并编写密码函数计算。 + */ + @JsonProperty("keepPassword") + private Boolean keepPassword; + /** + * 是否自动生成密码 + */ + @JsonProperty("autoGeneratePassword") + private Boolean autoGeneratePassword; + /** + * 是否强制要求用户在第一次的时候重置密码 + */ + @JsonProperty("resetPasswordOnFirstLogin") + private Boolean resetPasswordOnFirstLogin; + /** + * 密码加密类型,支持使用 RSA256 和国密 SM2 算法进行加密。默认为 `none` 不加密。 + * - `none`: 不对密码进行加密,使用明文进行传输。 + * - `rsa`: 使用 RSA256 算法对密码进行加密,需要使用 Authing 服务的 RSA 公钥进行加密,请阅读**介绍**部分了解如何获取 Authing 服务的 RSA256 公钥。 + * - `sm2`: 使用 [国密 SM2 算法](https://baike.baidu.com/item/SM2/15081831) 对密码进行加密,需要使用 Authing 服务的 SM2 公钥进行加密,请阅读**介绍**部分了解如何获取 Authing 服务的 SM2 公钥。 + * + */ + @JsonProperty("passwordEncryptType") + private PasswordEncryptType passwordEncryptType; + + public Boolean getKeepPassword() { + return keepPassword; + } + public void setKeepPassword(Boolean keepPassword) { + this.keepPassword = keepPassword; + } + + public Boolean getAutoGeneratePassword() { + return autoGeneratePassword; + } + public void setAutoGeneratePassword(Boolean autoGeneratePassword) { + this.autoGeneratePassword = autoGeneratePassword; + } + + public Boolean getResetPasswordOnFirstLogin() { + return resetPasswordOnFirstLogin; + } + public void setResetPasswordOnFirstLogin(Boolean resetPasswordOnFirstLogin) { + this.resetPasswordOnFirstLogin = resetPasswordOnFirstLogin; + } + + public PasswordEncryptType getPasswordEncryptType() { + return passwordEncryptType; + } + public void setPasswordEncryptType(PasswordEncryptType passwordEncryptType) { + this.passwordEncryptType = passwordEncryptType; + } + + + /** + * 密码加密类型,支持使用 RSA256 和国密 SM2 算法进行加密。默认为 `none` 不加密。 + * - `none`: 不对密码进行加密,使用明文进行传输。 + * - `rsa`: 使用 RSA256 算法对密码进行加密,需要使用 Authing 服务的 RSA 公钥进行加密,请阅读**介绍**部分了解如何获取 Authing 服务的 RSA256 公钥。 + * - `sm2`: 使用 [国密 SM2 算法](https://baike.baidu.com/item/SM2/15081831) 对密码进行加密,需要使用 Authing 服务的 SM2 公钥进行加密,请阅读**介绍**部分了解如何获取 Authing 服务的 SM2 公钥。 + * + */ + public static enum PasswordEncryptType { + + @JsonProperty("sm2") + SM2("sm2"), + + @JsonProperty("rsa") + RSA("rsa"), + + @JsonProperty("none") + NONE("none"), + ; + + private String value; + + PasswordEncryptType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + } + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/CreateTenantUserReqDto.java b/src/main/java/cn/authing/sdk/java/dto/CreateTenantUserReqDto.java new file mode 100644 index 00000000..6b38db18 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/CreateTenantUserReqDto.java @@ -0,0 +1,322 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.CreateTenantUserOptionsDto; + +public class CreateTenantUserReqDto { + /** + * 租户 ID + */ + @JsonProperty("tenantId") + private String tenantId; + /** + * 性别: + * - `M`: 男性,`male` + * - `F`: 女性,`female` + * - `U`: 未知,`unknown` + * + */ + @JsonProperty("gender") + private Gender gender; + /** + * 邮箱,不区分大小写 + */ + @JsonProperty("email") + private String email; + /** + * 手机号,不带区号。如果是国外手机号,请在 phoneCountryCode 参数中指定区号。 + */ + @JsonProperty("phone") + private String phone; + /** + * 手机区号,中国大陆手机号可不填。Authing 短信服务暂不内置支持国际手机号,你需要在 Authing 控制台配置对应的国际短信服务。完整的手机区号列表可参阅 https://en.wikipedia.org/wiki/List_of_country_calling_codes。 + */ + @JsonProperty("phoneCountryCode") + private String phoneCountryCode; + /** + * 用户名,用户池内唯一 + */ + @JsonProperty("username") + private String username; + /** + * 用户真实名称,不具备唯一性 + */ + @JsonProperty("name") + private String name; + /** + * 昵称 + */ + @JsonProperty("nickname") + private String nickname; + /** + * 头像链接 + */ + @JsonProperty("photo") + private String photo; + /** + * 出生日期 + */ + @JsonProperty("birthdate") + private String birthdate; + /** + * 所在国家 + */ + @JsonProperty("country") + private String country; + /** + * 所在省份 + */ + @JsonProperty("province") + private String province; + /** + * 所在城市 + */ + @JsonProperty("city") + private String city; + /** + * 所处地址 + */ + @JsonProperty("address") + private String address; + /** + * 所处街道地址 + */ + @JsonProperty("streetAddress") + private String streetAddress; + /** + * 邮政编码号 + */ + @JsonProperty("postalCode") + private String postalCode; + /** + * 名 + */ + @JsonProperty("givenName") + private String givenName; + /** + * 姓 + */ + @JsonProperty("familyName") + private String familyName; + /** + * 中间名 + */ + @JsonProperty("middleName") + private String middleName; + /** + * Preferred Username + */ + @JsonProperty("preferredUsername") + private String preferredUsername; + /** + * 用户密码。我们使用 HTTPS 协议对密码进行安全传输,可以在一定程度上保证安全性。如果你还需要更高级别的安全性,我们还支持 RSA256 和国密 SM2 两种方式对密码进行加密。详情见 `passwordEncryptType` 参数。 + */ + @JsonProperty("password") + private String password; + /** + * 加密用户密码的盐 + */ + @JsonProperty("salt") + private String salt; + /** + * 可选参数 + */ + @JsonProperty("options") + private CreateTenantUserOptionsDto options; + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public Gender getGender() { + return gender; + } + public void setGender(Gender gender) { + this.gender = gender; + } + + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } + + public String getPhoneCountryCode() { + return phoneCountryCode; + } + public void setPhoneCountryCode(String phoneCountryCode) { + this.phoneCountryCode = phoneCountryCode; + } + + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public String getNickname() { + return nickname; + } + public void setNickname(String nickname) { + this.nickname = nickname; + } + + public String getPhoto() { + return photo; + } + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getBirthdate() { + return birthdate; + } + public void setBirthdate(String birthdate) { + this.birthdate = birthdate; + } + + public String getCountry() { + return country; + } + public void setCountry(String country) { + this.country = country; + } + + public String getProvince() { + return province; + } + public void setProvince(String province) { + this.province = province; + } + + public String getCity() { + return city; + } + public void setCity(String city) { + this.city = city; + } + + public String getAddress() { + return address; + } + public void setAddress(String address) { + this.address = address; + } + + public String getStreetAddress() { + return streetAddress; + } + public void setStreetAddress(String streetAddress) { + this.streetAddress = streetAddress; + } + + public String getPostalCode() { + return postalCode; + } + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + + public String getGivenName() { + return givenName; + } + public void setGivenName(String givenName) { + this.givenName = givenName; + } + + public String getFamilyName() { + return familyName; + } + public void setFamilyName(String familyName) { + this.familyName = familyName; + } + + public String getMiddleName() { + return middleName; + } + public void setMiddleName(String middleName) { + this.middleName = middleName; + } + + public String getPreferredUsername() { + return preferredUsername; + } + public void setPreferredUsername(String preferredUsername) { + this.preferredUsername = preferredUsername; + } + + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + public String getSalt() { + return salt; + } + public void setSalt(String salt) { + this.salt = salt; + } + + public CreateTenantUserOptionsDto getOptions() { + return options; + } + public void setOptions(CreateTenantUserOptionsDto options) { + this.options = options; + } + + + /** + * 性别: + * - `M`: 男性,`male` + * - `F`: 女性,`female` + * - `U`: 未知,`unknown` + * + */ + public static enum Gender { + + @JsonProperty("M") + M("M"), + + @JsonProperty("F") + F("F"), + + @JsonProperty("U") + U("U"), + ; + + private String value; + + Gender(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + } + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/DefineEventDto.java b/src/main/java/cn/authing/sdk/java/dto/DefineEventDto.java new file mode 100644 index 00000000..903b9a4b --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/DefineEventDto.java @@ -0,0 +1,35 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class DefineEventDto { + /** + * 事件描述 + */ + @JsonProperty("eventDescription") + private String eventDescription; + /** + * 事件类型 + */ + @JsonProperty("eventType") + private String eventType; + + public String getEventDescription() { + return eventDescription; + } + public void setEventDescription(String eventDescription) { + this.eventDescription = eventDescription; + } + + public String getEventType() { + return eventType; + } + public void setEventType(String eventType) { + this.eventType = eventType; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/DeleteTenantDto.java b/src/main/java/cn/authing/sdk/java/dto/DeleteTenantDto.java new file mode 100644 index 00000000..5ef6dbc9 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/DeleteTenantDto.java @@ -0,0 +1,23 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class DeleteTenantDto { + /** + * 租户 ID + */ + @JsonProperty("tenantId") + private String tenantId; + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/DepartmentDto.java b/src/main/java/cn/authing/sdk/java/dto/DepartmentDto.java index 0aa7cefc..81a45ede 100644 --- a/src/main/java/cn/authing/sdk/java/dto/DepartmentDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/DepartmentDto.java @@ -81,6 +81,11 @@ public class DepartmentDto { */ @JsonProperty("customData") private Object customData; + /** + * 岗位 id 列表 + */ + @JsonProperty("postIdList") + private String postIdList; public String getOrganizationCode() { return organizationCode; @@ -187,6 +192,13 @@ public void setCustomData(Object customData) { this.customData = customData; } + public String getPostIdList() { + return postIdList; + } + public void setPostIdList(String postIdList) { + this.postIdList = postIdList; + } + } \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/EventAppDto.java b/src/main/java/cn/authing/sdk/java/dto/EventAppDto.java new file mode 100644 index 00000000..72cb9c55 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/EventAppDto.java @@ -0,0 +1,47 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class EventAppDto { + /** + * 唯一标识 + */ + @JsonProperty("identifier") + private String identifier; + /** + * 应用名称 + */ + @JsonProperty("name") + private String name; + /** + * 应用 logo + */ + @JsonProperty("logo") + private String logo; + + public String getIdentifier() { + return identifier; + } + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public String getLogo() { + return logo; + } + public void setLogo(String logo) { + this.logo = logo; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/EventAppPaginatedRespDto.java b/src/main/java/cn/authing/sdk/java/dto/EventAppPaginatedRespDto.java new file mode 100644 index 00000000..1e19dfe6 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/EventAppPaginatedRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.EventAppPagingDto; + +public class EventAppPaginatedRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private EventAppPagingDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public EventAppPagingDto getData() { + return data; + } + public void setData(EventAppPagingDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/EventAppPagingDto.java b/src/main/java/cn/authing/sdk/java/dto/EventAppPagingDto.java new file mode 100644 index 00000000..20481735 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/EventAppPagingDto.java @@ -0,0 +1,36 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.EventAppDto; + +public class EventAppPagingDto { + /** + * 记录总数 + */ + @JsonProperty("totalCount") + private Integer totalCount; + /** + * 数据列表 + */ + @JsonProperty("list") + private List list; + + public Integer getTotalCount() { + return totalCount; + } + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public List getList() { + return list; + } + public void setList(List list) { + this.list = list; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/ExtIdpConnDetail.java b/src/main/java/cn/authing/sdk/java/dto/ExtIdpConnDetail.java index 96117824..cbbb6c7d 100644 --- a/src/main/java/cn/authing/sdk/java/dto/ExtIdpConnDetail.java +++ b/src/main/java/cn/authing/sdk/java/dto/ExtIdpConnDetail.java @@ -147,6 +147,9 @@ public static enum Type { @JsonProperty("facebook") FACEBOOK("facebook"), + @JsonProperty("facebook:mobile") + FACEBOOK_MOBILE("facebook:mobile"), + @JsonProperty("twitter") TWITTER("twitter"), @@ -183,6 +186,9 @@ public static enum Type { @JsonProperty("qq") QQ("qq"), + @JsonProperty("qq:mobile") + QQ_MOBILE("qq:mobile"), + @JsonProperty("wechatwork:corp:qrconnect") WECHATWORK_CORP_QRCONNECT("wechatwork:corp:qrconnect"), @@ -201,12 +207,18 @@ public static enum Type { @JsonProperty("dingtalk") DINGTALK("dingtalk"), + @JsonProperty("dingtalk:mobile") + DINGTALK_MOBILE("dingtalk:mobile"), + @JsonProperty("dingtalk:provider") DINGTALK_PROVIDER("dingtalk:provider"), @JsonProperty("weibo") WEIBO("weibo"), + @JsonProperty("weibo:mobile") + WEIBO_MOBILE("weibo:mobile"), + @JsonProperty("apple") APPLE("apple"), @@ -216,6 +228,9 @@ public static enum Type { @JsonProperty("baidu") BAIDU("baidu"), + @JsonProperty("baidu:mobile") + BAIDU_MOBILE("baidu:mobile"), + @JsonProperty("lark-internal") LARK_INTERNAL("lark-internal"), @@ -228,6 +243,9 @@ public static enum Type { @JsonProperty("linkedin") LINKEDIN("linkedin"), + @JsonProperty("linkedin:mobile") + LINKEDIN_MOBILE("linkedin:mobile"), + @JsonProperty("slack") SLACK("slack"), @@ -248,6 +266,18 @@ public static enum Type { @JsonProperty("ad-kerberos") AD_KERBEROS("ad-kerberos"), + + @JsonProperty("huawei") + HUAWEI("huawei"), + + @JsonProperty("honor") + HONOR("honor"), + + @JsonProperty("xiaomi") + XIAOMI("xiaomi"), + + @JsonProperty("aws") + AWS("aws"), ; private String value; diff --git a/src/main/java/cn/authing/sdk/java/dto/ExtIdpInfoDto.java b/src/main/java/cn/authing/sdk/java/dto/ExtIdpInfoDto.java index 6de660bf..43528d69 100644 --- a/src/main/java/cn/authing/sdk/java/dto/ExtIdpInfoDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/ExtIdpInfoDto.java @@ -215,6 +215,18 @@ public static enum Type { @JsonProperty("welink") WELINK("welink"), + + @JsonProperty("huawei") + HUAWEI("huawei"), + + @JsonProperty("honor") + HONOR("honor"), + + @JsonProperty("xiaomi") + XIAOMI("xiaomi"), + + @JsonProperty("aws") + AWS("aws"), ; private String value; diff --git a/src/main/java/cn/authing/sdk/java/dto/FastpassQRCodeRelationAppDto.java b/src/main/java/cn/authing/sdk/java/dto/FastpassQRCodeRelationAppDto.java new file mode 100644 index 00000000..a93e9e7e --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/FastpassQRCodeRelationAppDto.java @@ -0,0 +1,47 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class FastpassQRCodeRelationAppDto { + /** + * 应用 ID + */ + @JsonProperty("id") + private String id; + /** + * 应用名称 + */ + @JsonProperty("name") + private String name; + /** + * 应用 logo + */ + @JsonProperty("logo") + private String logo; + + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public String getLogo() { + return logo; + } + public void setLogo(String logo) { + this.logo = logo; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/FastpassUserInfoDto.java b/src/main/java/cn/authing/sdk/java/dto/FastpassUserInfoDto.java new file mode 100644 index 00000000..75263e40 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/FastpassUserInfoDto.java @@ -0,0 +1,47 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class FastpassUserInfoDto { + /** + * 用户 ID + */ + @JsonProperty("id") + private String id; + /** + * 用户名称 + */ + @JsonProperty("displayName") + private String displayName; + /** + * 用户头像地址 + */ + @JsonProperty("photo") + private String photo; + + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + public String getDisplayName() { + return displayName; + } + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public String getPhoto() { + return photo; + } + public void setPhoto(String photo) { + this.photo = photo; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GeneFastpassQRCodeInfoDto.java b/src/main/java/cn/authing/sdk/java/dto/GeneFastpassQRCodeInfoDto.java new file mode 100644 index 00000000..55f28b3d --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GeneFastpassQRCodeInfoDto.java @@ -0,0 +1,84 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.FastpassUserInfoDto; + +public class GeneFastpassQRCodeInfoDto { + /** + * 二维码使用场景。 + */ + @JsonProperty("scene") + private String scene; + /** + * 二维码唯一 ID,可以通过此唯一 ID 查询二维码状态。 + */ + @JsonProperty("qrcodeId") + private String qrcodeId; + /** + * 服务接口 Host 地址 + */ + @JsonProperty("apiHost") + private String apiHost; + /** + * 用户信息 + */ + @JsonProperty("user") + private FastpassUserInfoDto user; + /** + * 当前用户生成二维码时登录的应用 ID + */ + @JsonProperty("appId") + private String appId; + /** + * 用户池信息 + */ + @JsonProperty("userpool") + private FastpassUserInfoDto userpool; + + public String getScene() { + return scene; + } + public void setScene(String scene) { + this.scene = scene; + } + + public String getQrcodeId() { + return qrcodeId; + } + public void setQrcodeId(String qrcodeId) { + this.qrcodeId = qrcodeId; + } + + public String getApiHost() { + return apiHost; + } + public void setApiHost(String apiHost) { + this.apiHost = apiHost; + } + + public FastpassUserInfoDto getUser() { + return user; + } + public void setUser(FastpassUserInfoDto user) { + this.user = user; + } + + public String getAppId() { + return appId; + } + public void setAppId(String appId) { + this.appId = appId; + } + + public FastpassUserInfoDto getUserpool() { + return userpool; + } + public void setUserpool(FastpassUserInfoDto userpool) { + this.userpool = userpool; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GeneFastpassQRCodeRespDto.java b/src/main/java/cn/authing/sdk/java/dto/GeneFastpassQRCodeRespDto.java new file mode 100644 index 00000000..ff44b151 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GeneFastpassQRCodeRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.GeneFastpassQRCodeInfoDto; + +public class GeneFastpassQRCodeRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private GeneFastpassQRCodeInfoDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public GeneFastpassQRCodeInfoDto getData() { + return data; + } + public void setData(GeneFastpassQRCodeInfoDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GenePushCodeDataDto.java b/src/main/java/cn/authing/sdk/java/dto/GenePushCodeDataDto.java new file mode 100644 index 00000000..aecdd3a1 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GenePushCodeDataDto.java @@ -0,0 +1,35 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class GenePushCodeDataDto { + /** + * 推送码(推送登录唯一 ID),可以通过此唯一 ID 查询推送码状态。 + */ + @JsonProperty("pushCodeId") + private String pushCodeId; + /** + * 推送码 `${expireTime}` 秒后过期,如 120 秒后过期。 + */ + @JsonProperty("expireTime") + private Integer expireTime; + + public String getPushCodeId() { + return pushCodeId; + } + public void setPushCodeId(String pushCodeId) { + this.pushCodeId = pushCodeId; + } + + public Integer getExpireTime() { + return expireTime; + } + public void setExpireTime(Integer expireTime) { + this.expireTime = expireTime; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GenePushCodeRespDto.java b/src/main/java/cn/authing/sdk/java/dto/GenePushCodeRespDto.java new file mode 100644 index 00000000..19a84824 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GenePushCodeRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.GenePushCodeDataDto; + +public class GenePushCodeRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private GenePushCodeDataDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public GenePushCodeDataDto getData() { + return data; + } + public void setData(GenePushCodeDataDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GenerateInviteTenantUserLink.java b/src/main/java/cn/authing/sdk/java/dto/GenerateInviteTenantUserLink.java new file mode 100644 index 00000000..9be0ac01 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GenerateInviteTenantUserLink.java @@ -0,0 +1,59 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class GenerateInviteTenantUserLink { + /** + * 链接有效期 + */ + @JsonProperty("validityTerm") + private String validityTerm; + /** + * 要邀请的用户邮箱 + */ + @JsonProperty("emails") + private List emails; + /** + * 应用 ID + */ + @JsonProperty("appId") + private String appId; + /** + * 租户 ID + */ + @JsonProperty("tenantId") + private String tenantId; + + public String getValidityTerm() { + return validityTerm; + } + public void setValidityTerm(String validityTerm) { + this.validityTerm = validityTerm; + } + + public List getEmails() { + return emails; + } + public void setEmails(List emails) { + this.emails = emails; + } + + public String getAppId() { + return appId; + } + public void setAppId(String appId) { + this.appId = appId; + } + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetAppLoginQrcodeStatusDto.java b/src/main/java/cn/authing/sdk/java/dto/GetAppLoginQrcodeStatusDto.java new file mode 100644 index 00000000..781ce6c5 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GetAppLoginQrcodeStatusDto.java @@ -0,0 +1,23 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class GetAppLoginQrcodeStatusDto { + /** + * 二维码唯一 ID + */ + @JsonProperty("qrcodeId") + private String qrcodeId; + + public String getQrcodeId() { + return qrcodeId; + } + public void setQrcodeId(String qrcodeId) { + this.qrcodeId = qrcodeId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetAuthenticationOptionsRespDto.java b/src/main/java/cn/authing/sdk/java/dto/GetAuthenticationOptionsRespDto.java new file mode 100644 index 00000000..53501489 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GetAuthenticationOptionsRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.AuthenticationOptionsDto; + +public class GetAuthenticationOptionsRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private AuthenticationOptionsDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public AuthenticationOptionsDto getData() { + return data; + } + public void setData(AuthenticationOptionsDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetFastpassClientAppsDto.java b/src/main/java/cn/authing/sdk/java/dto/GetFastpassClientAppsDto.java new file mode 100644 index 00000000..aade335f --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GetFastpassClientAppsDto.java @@ -0,0 +1,29 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class GetFastpassClientAppsDto { + @JsonProperty("qrcodeId") + private String qrcodeId; + @JsonProperty("appId") + private String appId; + + public String getQrcodeId() { + return qrcodeId; + } + public void setQrcodeId(String qrcodeId) { + this.qrcodeId = qrcodeId; + } + + public String getAppId() { + return appId; + } + public void setAppId(String appId) { + this.appId = appId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetFastpassQRCodeRelationAppsDto.java b/src/main/java/cn/authing/sdk/java/dto/GetFastpassQRCodeRelationAppsDto.java new file mode 100644 index 00000000..ff7e0763 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GetFastpassQRCodeRelationAppsDto.java @@ -0,0 +1,24 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.FastpassQRCodeRelationAppDto; + +public class GetFastpassQRCodeRelationAppsDto { + /** + * 关联的客户端应用信息 + */ + @JsonProperty("relationApps") + private List relationApps; + + public List getRelationApps() { + return relationApps; + } + public void setRelationApps(List relationApps) { + this.relationApps = relationApps; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetFastpassQRCodeRelationAppsRespDto.java b/src/main/java/cn/authing/sdk/java/dto/GetFastpassQRCodeRelationAppsRespDto.java new file mode 100644 index 00000000..f299359c --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GetFastpassQRCodeRelationAppsRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.GetFastpassQRCodeRelationAppsDto; + +public class GetFastpassQRCodeRelationAppsRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private GetFastpassQRCodeRelationAppsDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public GetFastpassQRCodeRelationAppsDto getData() { + return data; + } + public void setData(GetFastpassQRCodeRelationAppsDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetMultipleTenantAdminDto.java b/src/main/java/cn/authing/sdk/java/dto/GetMultipleTenantAdminDto.java new file mode 100644 index 00000000..ddc2137c --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GetMultipleTenantAdminDto.java @@ -0,0 +1,23 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class GetMultipleTenantAdminDto { + /** + * 用户 ID + */ + @JsonProperty("userId") + private String userId; + + public String getUserId() { + return userId; + } + public void setUserId(String userId) { + this.userId = userId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetPostByIdListDto.java b/src/main/java/cn/authing/sdk/java/dto/GetPostByIdListDto.java new file mode 100644 index 00000000..4f3b46de --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GetPostByIdListDto.java @@ -0,0 +1,23 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class GetPostByIdListDto { + /** + * 部门 id 列表 + */ + @JsonProperty("idList") + private String idList; + + public String getIdList() { + return idList; + } + public void setIdList(String idList) { + this.idList = idList; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetPostDto.java b/src/main/java/cn/authing/sdk/java/dto/GetPostDto.java new file mode 100644 index 00000000..0bae41e9 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GetPostDto.java @@ -0,0 +1,23 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class GetPostDto { + /** + * 岗位 code + */ + @JsonProperty("code") + private String code; + + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetPushCodeRelationAppsDataDto.java b/src/main/java/cn/authing/sdk/java/dto/GetPushCodeRelationAppsDataDto.java new file mode 100644 index 00000000..91dc0198 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GetPushCodeRelationAppsDataDto.java @@ -0,0 +1,23 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class GetPushCodeRelationAppsDataDto { + /** + * 发起推送登录的应用关联的客户端应用数据 + */ + @JsonProperty("appIds") + private List appIds; + + public List getAppIds() { + return appIds; + } + public void setAppIds(List appIds) { + this.appIds = appIds; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetPushCodeRelationAppsDto.java b/src/main/java/cn/authing/sdk/java/dto/GetPushCodeRelationAppsDto.java new file mode 100644 index 00000000..2cd5047e --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GetPushCodeRelationAppsDto.java @@ -0,0 +1,35 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class GetPushCodeRelationAppsDto { + /** + * 发起推送登录的应用 ID + */ + @JsonProperty("appId") + private String appId; + /** + * 推送码(推送登录唯一 ID) + */ + @JsonProperty("pushCodeId") + private String pushCodeId; + + public String getAppId() { + return appId; + } + public void setAppId(String appId) { + this.appId = appId; + } + + public String getPushCodeId() { + return pushCodeId; + } + public void setPushCodeId(String pushCodeId) { + this.pushCodeId = pushCodeId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetPushCodeRelationAppsRespDto.java b/src/main/java/cn/authing/sdk/java/dto/GetPushCodeRelationAppsRespDto.java new file mode 100644 index 00000000..491aab93 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GetPushCodeRelationAppsRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.GetPushCodeRelationAppsDataDto; + +public class GetPushCodeRelationAppsRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private GetPushCodeRelationAppsDataDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public GetPushCodeRelationAppsDataDto getData() { + return data; + } + public void setData(GetPushCodeRelationAppsDataDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetRegistrationOptionsRespDto.java b/src/main/java/cn/authing/sdk/java/dto/GetRegistrationOptionsRespDto.java new file mode 100644 index 00000000..0a835f35 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GetRegistrationOptionsRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.RegistrationOptionsDto; + +public class GetRegistrationOptionsRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private RegistrationOptionsDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public RegistrationOptionsDto getData() { + return data; + } + public void setData(RegistrationOptionsDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetTenantCooperatorDto.java b/src/main/java/cn/authing/sdk/java/dto/GetTenantCooperatorDto.java new file mode 100644 index 00000000..b5dd1a60 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GetTenantCooperatorDto.java @@ -0,0 +1,23 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class GetTenantCooperatorDto { + /** + * 用户 ID + */ + @JsonProperty("userId") + private String userId; + + public String getUserId() { + return userId; + } + public void setUserId(String userId) { + this.userId = userId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetTenantCooperatorMenuDto.java b/src/main/java/cn/authing/sdk/java/dto/GetTenantCooperatorMenuDto.java new file mode 100644 index 00000000..a693a6ec --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GetTenantCooperatorMenuDto.java @@ -0,0 +1,23 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class GetTenantCooperatorMenuDto { + /** + * 用户 ID + */ + @JsonProperty("userId") + private String userId; + + public String getUserId() { + return userId; + } + public void setUserId(String userId) { + this.userId = userId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetTenantDto.java b/src/main/java/cn/authing/sdk/java/dto/GetTenantDto.java new file mode 100644 index 00000000..c3066ffa --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GetTenantDto.java @@ -0,0 +1,71 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class GetTenantDto { + /** + * 租户 ID + */ + @JsonProperty("tenantId") + private String tenantId; + /** + * 是否增加返回租户成员统计 + */ + @JsonProperty("withMembersCount") + private Boolean withMembersCount; + /** + * 增加返回租户关联应用简单信息 + */ + @JsonProperty("withAppDetail") + private Boolean withAppDetail; + /** + * 增加返回租户下创建者简单信息 + */ + @JsonProperty("withCreatorDetail") + private Boolean withCreatorDetail; + /** + * 增加返回租户来源应用简单信息 + */ + @JsonProperty("withSourceAppDetail") + private Boolean withSourceAppDetail; + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public Boolean getWithMembersCount() { + return withMembersCount; + } + public void setWithMembersCount(Boolean withMembersCount) { + this.withMembersCount = withMembersCount; + } + + public Boolean getWithAppDetail() { + return withAppDetail; + } + public void setWithAppDetail(Boolean withAppDetail) { + this.withAppDetail = withAppDetail; + } + + public Boolean getWithCreatorDetail() { + return withCreatorDetail; + } + public void setWithCreatorDetail(Boolean withCreatorDetail) { + this.withCreatorDetail = withCreatorDetail; + } + + public Boolean getWithSourceAppDetail() { + return withSourceAppDetail; + } + public void setWithSourceAppDetail(Boolean withSourceAppDetail) { + this.withSourceAppDetail = withSourceAppDetail; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetTenantUserDto.java b/src/main/java/cn/authing/sdk/java/dto/GetTenantUserDto.java new file mode 100644 index 00000000..3b074171 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GetTenantUserDto.java @@ -0,0 +1,47 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class GetTenantUserDto { + /** + * 租户 ID + */ + @JsonProperty("tenantId") + private String tenantId; + /** + * 关联的用户池级别的用户 ID + */ + @JsonProperty("linkUserId") + private String linkUserId; + /** + * 租户成员 ID + */ + @JsonProperty("memberId") + private String memberId; + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getLinkUserId() { + return linkUserId; + } + public void setLinkUserId(String linkUserId) { + this.linkUserId = linkUserId; + } + + public String getMemberId() { + return memberId; + } + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourceListRespDto.java b/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourceListRespDto.java index 01890f93..412fd5e0 100644 --- a/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourceListRespDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourceListRespDto.java @@ -21,6 +21,11 @@ public class GetUserAuthResourceListRespDto { */ @JsonProperty("apiCode") private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; /** * 响应数据 */ @@ -48,6 +53,13 @@ public void setApiCode(Integer apiCode) { this.apiCode = apiCode; } + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + public GetUserAuthResourceListDataDto getData() { return data; } diff --git a/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourcePermissionList.java b/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourcePermissionList.java index c73b9a2d..6c4836ab 100644 --- a/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourcePermissionList.java +++ b/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourcePermissionList.java @@ -1,44 +1,47 @@ package cn.authing.sdk.java.dto; -import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + public class GetUserAuthResourcePermissionList { - /** - * 权限空间 code - */ - @JsonProperty("namespaceCode") - private String namespaceCode; - /** - * 数据资源权限操作列表 - */ - @JsonProperty("actions") - private List actions; - /** - * 资源路径 - */ - @JsonProperty("resource") - private String resource; - - public String getNamespaceCode() { - return namespaceCode; - } - public void setNamespaceCode(String namespaceCode) { - this.namespaceCode = namespaceCode; - } - - public List getActions() { - return actions; - } - public void setActions(List actions) { - this.actions = actions; - } - - public String getResource() { - return resource; - } - public void setResource(String resource) { - this.resource = resource; - } - -} + /** + * 当前应用 Id + */ + @JsonProperty("namespaceCode") + private String namespaceCode; + /** + * 数据资源权限操作列表 + */ + @JsonProperty("actions") + private List actions; + /** + * 数据资源路径 + */ + @JsonProperty("resource") + private String resource; + + public String getNamespaceCode() { + return namespaceCode; + } + public void setNamespaceCode(String namespaceCode) { + this.namespaceCode = namespaceCode; + } + + public List getActions() { + return actions; + } + public void setActions(List actions) { + this.actions = actions; + } + + public String getResource() { + return resource; + } + public void setResource(String resource) { + this.resource = resource; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourcePermissionListDataDto.java b/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourcePermissionListDataDto.java index 4ebe71de..989dec40 100644 --- a/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourcePermissionListDataDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourcePermissionListDataDto.java @@ -1,22 +1,24 @@ package cn.authing.sdk.java.dto; -import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.GetUserAuthResourcePermissionList; public class GetUserAuthResourcePermissionListDataDto { + /** + * 权限列表 + */ + @JsonProperty("permissionList") + private List permissionList; + public List getPermissionList() { + return permissionList; + } + public void setPermissionList(List permissionList) { + this.permissionList = permissionList; + } - /** - * 用户权限列表 - */ - @JsonProperty("userPermissionList") - private List permissionList; - public List getUserPermissionList() { - return permissionList; - } - public void setUserPermissionList(List userPermissionList) { - this.permissionList = userPermissionList; - } -} +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourcePermissionListDto.java b/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourcePermissionListDto.java index e65a7764..990d4351 100644 --- a/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourcePermissionListDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourcePermissionListDto.java @@ -1,20 +1,23 @@ package cn.authing.sdk.java.dto; -import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + public class GetUserAuthResourcePermissionListDto { - /** - * 树数据资源路径列表, - */ - @JsonProperty("resources") - private List resources; - public List getResources() { - return resources; - } - public void setResources(List resources) { - this.resources = resources; - } + /** + * 数据资源路径列表,**树资源需到具体树节点** + */ + @JsonProperty("resources") + private List resources; + + public List getResources() { + return resources; + } + public void setResources(List resources) { + this.resources = resources; + } + -} +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourcePermissionListRespDto.java b/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourcePermissionListRespDto.java index 2d54572e..5f9b5d78 100644 --- a/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourcePermissionListRespDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourcePermissionListRespDto.java @@ -1,55 +1,72 @@ package cn.authing.sdk.java.dto; +import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; +import cn.authing.sdk.java.dto.GetUserAuthResourcePermissionListDataDto; + public class GetUserAuthResourcePermissionListRespDto { - /** - * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 - */ - @JsonProperty("statusCode") - private Integer statusCode; - /** - * 描述信息 - */ - @JsonProperty("message") - private String message; - /** - * 细分错误码,可通过此错误码得到具体的错误类型。 - */ - @JsonProperty("apiCode") - private Integer apiCode; - /** - * 响应数据 - */ - @JsonProperty("data") - private GetUserAuthResourcePermissionListDataDto data; - - public Integer getStatusCode() { - return statusCode; - } - public void setStatusCode(Integer statusCode) { - this.statusCode = statusCode; - } - - public String getMessage() { - return message; - } - public void setMessage(String message) { - this.message = message; - } - - public Integer getApiCode() { - return apiCode; - } - public void setApiCode(Integer apiCode) { - this.apiCode = apiCode; - } - - public GetUserAuthResourcePermissionListDataDto getData() { - return data; - } - public void setData(GetUserAuthResourcePermissionListDataDto data) { - this.data = data; - } - -} + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private GetUserAuthResourcePermissionListDataDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public GetUserAuthResourcePermissionListDataDto getData() { + return data; + } + public void setData(GetUserAuthResourcePermissionListDataDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourceStructDataDto.java b/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourceStructDataDto.java index b8658fb0..52cab4cf 100644 --- a/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourceStructDataDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourceStructDataDto.java @@ -1,113 +1,118 @@ package cn.authing.sdk.java.dto; -import cn.authing.sdk.java.dto.GetUserResourceStructDataDto.ResourceType; +import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; +import cn.authing.sdk.java.dto.ArrResourceAuthAction; +import cn.authing.sdk.java.dto.StrResourceAuthAction; +import cn.authing.sdk.java.dto.TreeResourceAuthAction; + public class GetUserAuthResourceStructDataDto { - /** - * 权限空间 Code - */ - @JsonProperty("namespaceCode") - private String namespaceCode; - /** - * 数据资源 Code - */ - @JsonProperty("resourceCode") - private String resourceCode; - /** - * 数据资源类型,目前支持树结构(TREE)、字符串(STRING)、数组(ARRAY)三种类型,根据不同的类型返回不同的结构。 - * - `STRING`: 字符串类型结果 StrResourceAuthAction - * - `ARRAY`: 数组类型 ArrResourceAuthAction - * - `TREE`: 树类型 TreeResourceAuthAction - */ - @JsonProperty("resourceType") - private GetUserResourceStructDataDto.ResourceType resourceType; - /** - * 字符串资源授权 - */ - @JsonProperty("strResourceAuthAction") - private StrResourceAuthAction strResourceAuthAction; - /** - * 数组资源授权 - */ - @JsonProperty("arrResourceAuthAction") - private ArrResourceAuthAction arrResourceAuthAction; - /** - * 树资源授权 - */ - @JsonProperty("treeResourceAuthAction") - private TreeResourceAuthAction treeResourceAuthAction; - - public String getNamespaceCode() { - return namespaceCode; - } - public void setNamespaceCode(String namespaceCode) { - this.namespaceCode = namespaceCode; - } - - public String getResourceCode() { - return resourceCode; - } - public void setResourceCode(String resourceCode) { - this.resourceCode = resourceCode; - } - - public GetUserResourceStructDataDto.ResourceType getResourceType() { - return resourceType; - } - public void setResourceType(GetUserResourceStructDataDto.ResourceType resourceType) { - this.resourceType = resourceType; - } - - public StrResourceAuthAction getStrResourceAuthAction() { - return strResourceAuthAction; - } - public void setStrResourceAuthAction(StrResourceAuthAction strResourceAuthAction) { - this.strResourceAuthAction = strResourceAuthAction; - } - - public ArrResourceAuthAction getArrResourceAuthAction() { - return arrResourceAuthAction; - } - public void setArrResourceAuthAction(ArrResourceAuthAction arrResourceAuthAction) { - this.arrResourceAuthAction = arrResourceAuthAction; - } - - public TreeResourceAuthAction getTreeResourceAuthAction() { - return treeResourceAuthAction; - } - public void setTreeResourceAuthAction(TreeResourceAuthAction treeResourceAuthAction) { - this.treeResourceAuthAction = treeResourceAuthAction; - } - - - /** - * 数据资源类型,目前支持树结构(TREE)、字符串(STRING)、数组(ARRAY)三种类型,根据不同的类型返回不同的结构。 - * - `STRING`: 字符串类型结果 StrResourceAuthAction - * - `ARRAY`: 数组类型 ArrResourceAuthAction - * - `TREE`: 树类型 TreeResourceAuthAction - */ - public static enum ResourceType { - - @JsonProperty("TREE") - TREE("TREE"), - - @JsonProperty("STRING") - STRING("STRING"), - - @JsonProperty("ARRAY") - ARRAY("ARRAY"), - ; - - private String value; - - ResourceType(String value) { - this.value = value; + /** + * 权限空间 Code + */ + @JsonProperty("namespaceCode") + private String namespaceCode; + /** + * 数据资源 Code + */ + @JsonProperty("resourceCode") + private String resourceCode; + /** + * 数据资源类型,目前支持树结构(TREE)、字符串(STRING)、数组(ARRAY)三种类型,根据不同的类型返回不同的结构。 + * - `STRING`: 字符串类型结果 StrResourceAuthAction + * - `ARRAY`: 数组类型 ArrResourceAuthAction + * - `TREE`: 树类型 TreeResourceAuthAction + */ + @JsonProperty("resourceType") + private ResourceType resourceType; + /** + * 字符串资源授权 + */ + @JsonProperty("strResourceAuthAction") + private StrResourceAuthAction strResourceAuthAction; + /** + * 数组资源授权 + */ + @JsonProperty("arrResourceAuthAction") + private ArrResourceAuthAction arrResourceAuthAction; + /** + * 树资源授权 + */ + @JsonProperty("treeResourceAuthAction") + private TreeResourceAuthAction treeResourceAuthAction; + + public String getNamespaceCode() { + return namespaceCode; + } + public void setNamespaceCode(String namespaceCode) { + this.namespaceCode = namespaceCode; } - public String getValue() { - return value; + public String getResourceCode() { + return resourceCode; } - } + public void setResourceCode(String resourceCode) { + this.resourceCode = resourceCode; + } + + public ResourceType getResourceType() { + return resourceType; + } + public void setResourceType(ResourceType resourceType) { + this.resourceType = resourceType; + } + + public StrResourceAuthAction getStrResourceAuthAction() { + return strResourceAuthAction; + } + public void setStrResourceAuthAction(StrResourceAuthAction strResourceAuthAction) { + this.strResourceAuthAction = strResourceAuthAction; + } + + public ArrResourceAuthAction getArrResourceAuthAction() { + return arrResourceAuthAction; + } + public void setArrResourceAuthAction(ArrResourceAuthAction arrResourceAuthAction) { + this.arrResourceAuthAction = arrResourceAuthAction; + } + + public TreeResourceAuthAction getTreeResourceAuthAction() { + return treeResourceAuthAction; + } + public void setTreeResourceAuthAction(TreeResourceAuthAction treeResourceAuthAction) { + this.treeResourceAuthAction = treeResourceAuthAction; + } + + + /** + * 数据资源类型,目前支持树结构(TREE)、字符串(STRING)、数组(ARRAY)三种类型,根据不同的类型返回不同的结构。 + * - `STRING`: 字符串类型结果 StrResourceAuthAction + * - `ARRAY`: 数组类型 ArrResourceAuthAction + * - `TREE`: 树类型 TreeResourceAuthAction + */ + public static enum ResourceType { + + @JsonProperty("TREE") + TREE("TREE"), + + @JsonProperty("STRING") + STRING("STRING"), + + @JsonProperty("ARRAY") + ARRAY("ARRAY"), + ; + + private String value; + + ResourceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + } + -} +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourceStructDto.java b/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourceStructDto.java index 8dc0f3d7..30b43987 100644 --- a/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourceStructDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourceStructDto.java @@ -1,19 +1,23 @@ package cn.authing.sdk.java.dto; +import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; + public class GetUserAuthResourceStructDto { - /** - * 数据资源 Code - */ - @JsonProperty("resource") - private String resource; + /** + * 数据资源 Code + */ + @JsonProperty("resource") + private String resource; + + public String getResource() { + return resource; + } + public void setResource(String resource) { + this.resource = resource; + } + - public String getResource() { - return resource; - } - public void setResource(String resource) { - this.resource = resource; - } -} +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourceStructRespDto.java b/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourceStructRespDto.java index 97bbaa7e..f6551423 100644 --- a/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourceStructRespDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/GetUserAuthResourceStructRespDto.java @@ -1,55 +1,72 @@ package cn.authing.sdk.java.dto; +import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; +import cn.authing.sdk.java.dto.GetUserAuthResourceStructDataDto; + public class GetUserAuthResourceStructRespDto { - /** - * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 - */ - @JsonProperty("statusCode") - private Integer statusCode; - /** - * 描述信息 - */ - @JsonProperty("message") - private String message; - /** - * 细分错误码,可通过此错误码得到具体的错误类型。 - */ - @JsonProperty("apiCode") - private Integer apiCode; - /** - * 响应数据 - */ - @JsonProperty("data") - private GetUserAuthResourceStructDataDto data; - - public Integer getStatusCode() { - return statusCode; - } - public void setStatusCode(Integer statusCode) { - this.statusCode = statusCode; - } - - public String getMessage() { - return message; - } - public void setMessage(String message) { - this.message = message; - } - - public Integer getApiCode() { - return apiCode; - } - public void setApiCode(Integer apiCode) { - this.apiCode = apiCode; - } - - public GetUserAuthResourceStructDataDto getData() { - return data; - } - public void setData(GetUserAuthResourceStructDataDto data) { - this.data = data; - } - -} + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private GetUserAuthResourceStructDataDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public GetUserAuthResourceStructDataDto getData() { + return data; + } + public void setData(GetUserAuthResourceStructDataDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/GetUserPostDto.java b/src/main/java/cn/authing/sdk/java/dto/GetUserPostDto.java new file mode 100644 index 00000000..eec88f55 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/GetUserPostDto.java @@ -0,0 +1,23 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class GetUserPostDto { + /** + * 用户 id + */ + @JsonProperty("userId") + private String userId; + + public String getUserId() { + return userId; + } + public void setUserId(String userId) { + this.userId = userId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/IdentityDto.java b/src/main/java/cn/authing/sdk/java/dto/IdentityDto.java index cf3944fa..c11bdb84 100644 --- a/src/main/java/cn/authing/sdk/java/dto/IdentityDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/IdentityDto.java @@ -260,6 +260,18 @@ public static enum Provider { @JsonProperty("welink") WELINK("welink"), + + @JsonProperty("huawei") + HUAWEI("huawei"), + + @JsonProperty("honor") + HONOR("honor"), + + @JsonProperty("xiaomi") + XIAOMI("xiaomi"), + + @JsonProperty("aws") + AWS("aws"), ; private String value; diff --git a/src/main/java/cn/authing/sdk/java/dto/ImportTenantDto.java b/src/main/java/cn/authing/sdk/java/dto/ImportTenantDto.java new file mode 100644 index 00000000..a1543b3e --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/ImportTenantDto.java @@ -0,0 +1,23 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class ImportTenantDto { + /** + * excel path 地址 + */ + @JsonProperty("excelUrl") + private String excelUrl; + + public String getExcelUrl() { + return excelUrl; + } + public void setExcelUrl(String excelUrl) { + this.excelUrl = excelUrl; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/ImportTenantHistoryDto.java b/src/main/java/cn/authing/sdk/java/dto/ImportTenantHistoryDto.java new file mode 100644 index 00000000..df299e96 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/ImportTenantHistoryDto.java @@ -0,0 +1,35 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class ImportTenantHistoryDto { + /** + * 页码 + */ + @JsonProperty("page") + private String page; + /** + * 每页获取的数据量 + */ + @JsonProperty("limit") + private String limit; + + public String getPage() { + return page; + } + public void setPage(String page) { + this.page = page; + } + + public String getLimit() { + return limit; + } + public void setLimit(String limit) { + this.limit = limit; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/ImportTenantNotifyUserDto.java b/src/main/java/cn/authing/sdk/java/dto/ImportTenantNotifyUserDto.java new file mode 100644 index 00000000..7a4a5dda --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/ImportTenantNotifyUserDto.java @@ -0,0 +1,47 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class ImportTenantNotifyUserDto { + /** + * 导入记录 id + */ + @JsonProperty("importId") + private String importId; + /** + * 页码 + */ + @JsonProperty("page") + private String page; + /** + * 每页获取的数据量 + */ + @JsonProperty("limit") + private String limit; + + public String getImportId() { + return importId; + } + public void setImportId(String importId) { + this.importId = importId; + } + + public String getPage() { + return page; + } + public void setPage(String page) { + this.page = page; + } + + public String getLimit() { + return limit; + } + public void setLimit(String limit) { + this.limit = limit; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/InviteTenantUserRecord.java b/src/main/java/cn/authing/sdk/java/dto/InviteTenantUserRecord.java new file mode 100644 index 00000000..6fffa219 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/InviteTenantUserRecord.java @@ -0,0 +1,83 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class InviteTenantUserRecord { + /** + * 邀请记录编号 + */ + @JsonProperty("recordId") + private Integer recordId; + /** + * 邀请账号 + */ + @JsonProperty("inviteAccount") + private String inviteAccount; + /** + * 账号激活状态 + */ + @JsonProperty("verifiedStatus") + private String verifiedStatus; + /** + * 邀请链接 + */ + @JsonProperty("inviteLink") + private String inviteLink; + /** + * 创建时间 + */ + @JsonProperty("createdAt") + private String createdAt; + /** + * 账号激活时间 + */ + @JsonProperty("activatedAt") + private String activatedAt; + + public Integer getRecordId() { + return recordId; + } + public void setRecordId(Integer recordId) { + this.recordId = recordId; + } + + public String getInviteAccount() { + return inviteAccount; + } + public void setInviteAccount(String inviteAccount) { + this.inviteAccount = inviteAccount; + } + + public String getVerifiedStatus() { + return verifiedStatus; + } + public void setVerifiedStatus(String verifiedStatus) { + this.verifiedStatus = verifiedStatus; + } + + public String getInviteLink() { + return inviteLink; + } + public void setInviteLink(String inviteLink) { + this.inviteLink = inviteLink; + } + + public String getCreatedAt() { + return createdAt; + } + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public String getActivatedAt() { + return activatedAt; + } + public void setActivatedAt(String activatedAt) { + this.activatedAt = activatedAt; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/InviteTenantUserRecordListDto.java b/src/main/java/cn/authing/sdk/java/dto/InviteTenantUserRecordListDto.java new file mode 100644 index 00000000..2e1e5067 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/InviteTenantUserRecordListDto.java @@ -0,0 +1,36 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.InviteTenantUserRecord; + +public class InviteTenantUserRecordListDto { + /** + * 记录总数 + */ + @JsonProperty("totalCount") + private Integer totalCount; + /** + * 邀请用户历史记录 + */ + @JsonProperty("list") + private List list; + + public Integer getTotalCount() { + return totalCount; + } + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public List getList() { + return list; + } + public void setList(List list) { + this.list = list; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/InviteTenantUserRecordListRespDto.java b/src/main/java/cn/authing/sdk/java/dto/InviteTenantUserRecordListRespDto.java new file mode 100644 index 00000000..78c87871 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/InviteTenantUserRecordListRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.InviteTenantUserRecordListDto; + +public class InviteTenantUserRecordListRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private InviteTenantUserRecordListDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public InviteTenantUserRecordListDto getData() { + return data; + } + public void setData(InviteTenantUserRecordListDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/InviteTenantUsersDto.java b/src/main/java/cn/authing/sdk/java/dto/InviteTenantUsersDto.java new file mode 100644 index 00000000..d16ded17 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/InviteTenantUsersDto.java @@ -0,0 +1,37 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.errorEmailMsg; +import cn.authing.sdk.java.dto.InviteTenantUserRecord; + +public class InviteTenantUsersDto { + /** + * 错误的邮箱提示 + */ + @JsonProperty("errMsgs") + private List errMsgs; + /** + * 邀请用户信息返回值 + */ + @JsonProperty("list") + private List list; + + public List getErrMsgs() { + return errMsgs; + } + public void setErrMsgs(List errMsgs) { + this.errMsgs = errMsgs; + } + + public List getList() { + return list; + } + public void setList(List list) { + this.list = list; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/InviteTenantUsersRespDto.java b/src/main/java/cn/authing/sdk/java/dto/InviteTenantUsersRespDto.java new file mode 100644 index 00000000..67e21cb0 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/InviteTenantUsersRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.InviteTenantUsersDto; + +public class InviteTenantUsersRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private InviteTenantUsersDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public InviteTenantUsersDto getData() { + return data; + } + public void setData(InviteTenantUsersDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/ListDeviceCredentialDto.java b/src/main/java/cn/authing/sdk/java/dto/ListDeviceCredentialDto.java new file mode 100644 index 00000000..904ed12e --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/ListDeviceCredentialDto.java @@ -0,0 +1,11 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class ListDeviceCredentialDto { + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/ListEventsDto.java b/src/main/java/cn/authing/sdk/java/dto/ListEventsDto.java new file mode 100644 index 00000000..3ec3962f --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/ListEventsDto.java @@ -0,0 +1,47 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class ListEventsDto { + /** + * 当前页数,从 1 开始 + */ + @JsonProperty("page") + private Integer page; + /** + * 每页数目,最大不能超过 50,默认为 10 + */ + @JsonProperty("limit") + private Integer limit; + /** + * 应用类型 + */ + @JsonProperty("app") + private String app; + + public Integer getPage() { + return page; + } + public void setPage(Integer page) { + this.page = page; + } + + public Integer getLimit() { + return limit; + } + public void setLimit(Integer limit) { + this.limit = limit; + } + + public String getApp() { + return app; + } + public void setApp(String app) { + this.app = app; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/ListInviteTenantUserRecordsDto.java b/src/main/java/cn/authing/sdk/java/dto/ListInviteTenantUserRecordsDto.java new file mode 100644 index 00000000..af17b041 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/ListInviteTenantUserRecordsDto.java @@ -0,0 +1,47 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class ListInviteTenantUserRecordsDto { + /** + * 搜索关键字 + */ + @JsonProperty("keywords") + private String keywords; + /** + * 页码 + */ + @JsonProperty("page") + private String page; + /** + * 每页获取的数据量 + */ + @JsonProperty("limit") + private String limit; + + public String getKeywords() { + return keywords; + } + public void setKeywords(String keywords) { + this.keywords = keywords; + } + + public String getPage() { + return page; + } + public void setPage(String page) { + this.page = page; + } + + public String getLimit() { + return limit; + } + public void setLimit(String limit) { + this.limit = limit; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/ListMultipleTenantAdminsDto.java b/src/main/java/cn/authing/sdk/java/dto/ListMultipleTenantAdminsDto.java new file mode 100644 index 00000000..7b3de56f --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/ListMultipleTenantAdminsDto.java @@ -0,0 +1,47 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class ListMultipleTenantAdminsDto { + /** + * 搜索关键字 + */ + @JsonProperty("keywords") + private String keywords; + /** + * 页码 + */ + @JsonProperty("page") + private String page; + /** + * 每页获取的数据量 + */ + @JsonProperty("limit") + private String limit; + + public String getKeywords() { + return keywords; + } + public void setKeywords(String keywords) { + this.keywords = keywords; + } + + public String getPage() { + return page; + } + public void setPage(String page) { + this.page = page; + } + + public String getLimit() { + return limit; + } + public void setLimit(String limit) { + this.limit = limit; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/ListPostDto.java b/src/main/java/cn/authing/sdk/java/dto/ListPostDto.java new file mode 100644 index 00000000..1ee81fa2 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/ListPostDto.java @@ -0,0 +1,59 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class ListPostDto { + /** + * 搜索岗位 code 或名称 + */ + @JsonProperty("keywords") + private String keywords; + /** + * 是否统计岗位关联的部门数和用户数 + */ + @JsonProperty("skipCount") + private Boolean skipCount; + /** + * 当前页数,从 1 开始 + */ + @JsonProperty("page") + private Integer page; + /** + * 每页数目,最大不能超过 50,默认为 10 + */ + @JsonProperty("limit") + private Integer limit; + + public String getKeywords() { + return keywords; + } + public void setKeywords(String keywords) { + this.keywords = keywords; + } + + public Boolean getSkipCount() { + return skipCount; + } + public void setSkipCount(Boolean skipCount) { + this.skipCount = skipCount; + } + + public Integer getPage() { + return page; + } + public void setPage(Integer page) { + this.page = page; + } + + public Integer getLimit() { + return limit; + } + public void setLimit(Integer limit) { + this.limit = limit; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/ListTenantAdminDto.java b/src/main/java/cn/authing/sdk/java/dto/ListTenantAdminDto.java new file mode 100644 index 00000000..e1edae7a --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/ListTenantAdminDto.java @@ -0,0 +1,59 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class ListTenantAdminDto { + /** + * 租户 ID + */ + @JsonProperty("tenantId") + private String tenantId; + /** + * 搜索关键字 + */ + @JsonProperty("keywords") + private String keywords; + /** + * 页码 + */ + @JsonProperty("page") + private String page; + /** + * 每页获取的数据量 + */ + @JsonProperty("limit") + private String limit; + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getKeywords() { + return keywords; + } + public void setKeywords(String keywords) { + this.keywords = keywords; + } + + public String getPage() { + return page; + } + public void setPage(String page) { + this.page = page; + } + + public String getLimit() { + return limit; + } + public void setLimit(String limit) { + this.limit = limit; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/ListTenantCooperatorsDto.java b/src/main/java/cn/authing/sdk/java/dto/ListTenantCooperatorsDto.java new file mode 100644 index 00000000..40d06e5d --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/ListTenantCooperatorsDto.java @@ -0,0 +1,59 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class ListTenantCooperatorsDto { + /** + * 搜索关键字 + */ + @JsonProperty("keywords") + private String keywords; + /** + * 是否外部 + */ + @JsonProperty("external") + private Boolean external; + /** + * 页码 + */ + @JsonProperty("page") + private String page; + /** + * 每页获取的数据量 + */ + @JsonProperty("limit") + private String limit; + + public String getKeywords() { + return keywords; + } + public void setKeywords(String keywords) { + this.keywords = keywords; + } + + public Boolean getExternal() { + return external; + } + public void setExternal(Boolean external) { + this.external = external; + } + + public String getPage() { + return page; + } + public void setPage(String page) { + this.page = page; + } + + public String getLimit() { + return limit; + } + public void setLimit(String limit) { + this.limit = limit; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/ListTenantUserDto.java b/src/main/java/cn/authing/sdk/java/dto/ListTenantUserDto.java new file mode 100644 index 00000000..108e404f --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/ListTenantUserDto.java @@ -0,0 +1,48 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.ListTenantUsersOptionsDto; + +public class ListTenantUserDto { + /** + * 租户 ID + */ + @JsonProperty("tenantId") + private String tenantId; + /** + * 搜索关键字 + */ + @JsonProperty("keywords") + private String keywords; + /** + * 可选项 + */ + @JsonProperty("options") + private ListTenantUsersOptionsDto options; + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getKeywords() { + return keywords; + } + public void setKeywords(String keywords) { + this.keywords = keywords; + } + + public ListTenantUsersOptionsDto getOptions() { + return options; + } + public void setOptions(ListTenantUsersOptionsDto options) { + this.options = options; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/ListTenantUsersOptionsDto.java b/src/main/java/cn/authing/sdk/java/dto/ListTenantUsersOptionsDto.java new file mode 100644 index 00000000..1fa88ca9 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/ListTenantUsersOptionsDto.java @@ -0,0 +1,24 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.PaginationDto; + +public class ListTenantUsersOptionsDto { + /** + * 分页配置 + */ + @JsonProperty("pagination") + private PaginationDto pagination; + + public PaginationDto getPagination() { + return pagination; + } + public void setPagination(PaginationDto pagination) { + this.pagination = pagination; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/ListTenantsDto.java b/src/main/java/cn/authing/sdk/java/dto/ListTenantsDto.java new file mode 100644 index 00000000..031ecba0 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/ListTenantsDto.java @@ -0,0 +1,95 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class ListTenantsDto { + /** + * 搜索关键字 + */ + @JsonProperty("keywords") + private String keywords; + /** + * 是否增加返回租户成员统计 + */ + @JsonProperty("withMembersCount") + private Boolean withMembersCount; + /** + * 增加返回租户下 app 简单信息 + */ + @JsonProperty("withAppDetail") + private Boolean withAppDetail; + /** + * 增加返回租户下创建者简单信息 + */ + @JsonProperty("withCreatorDetail") + private Boolean withCreatorDetail; + /** + * 增加返回租户下来源 app 简单信息 + */ + @JsonProperty("withSourceAppDetail") + private Boolean withSourceAppDetail; + /** + * 页码 + */ + @JsonProperty("page") + private String page; + /** + * 每页获取的数据量 + */ + @JsonProperty("limit") + private String limit; + + public String getKeywords() { + return keywords; + } + public void setKeywords(String keywords) { + this.keywords = keywords; + } + + public Boolean getWithMembersCount() { + return withMembersCount; + } + public void setWithMembersCount(Boolean withMembersCount) { + this.withMembersCount = withMembersCount; + } + + public Boolean getWithAppDetail() { + return withAppDetail; + } + public void setWithAppDetail(Boolean withAppDetail) { + this.withAppDetail = withAppDetail; + } + + public Boolean getWithCreatorDetail() { + return withCreatorDetail; + } + public void setWithCreatorDetail(Boolean withCreatorDetail) { + this.withCreatorDetail = withCreatorDetail; + } + + public Boolean getWithSourceAppDetail() { + return withSourceAppDetail; + } + public void setWithSourceAppDetail(Boolean withSourceAppDetail) { + this.withSourceAppDetail = withSourceAppDetail; + } + + public String getPage() { + return page; + } + public void setPage(String page) { + this.page = page; + } + + public String getLimit() { + return limit; + } + public void setLimit(String limit) { + this.limit = limit; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/ListUsersAdvancedFilterItemDto.java b/src/main/java/cn/authing/sdk/java/dto/ListUsersAdvancedFilterItemDto.java index a9e7775e..40834bc1 100644 --- a/src/main/java/cn/authing/sdk/java/dto/ListUsersAdvancedFilterItemDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/ListUsersAdvancedFilterItemDto.java @@ -31,7 +31,7 @@ public class ListUsersAdvancedFilterItemDto { * - `formatted`: 格式化的地址 * - `signedUp`: 注册时间 * - `locale`: 语言信息 - * - `lastLoginTime`: 上次登录时间,为日期类型 + * - `lastLogin`: 上次登录时间,为时间戳类型 * - `loginsCount`: 登录次数,为数字类型 * - `lastLoginApp`: 上次登录的应用 ID * - `userSource`: 用户来源,具体使用见示例 diff --git a/src/main/java/cn/authing/sdk/java/dto/MultipleTenantAdminDto.java b/src/main/java/cn/authing/sdk/java/dto/MultipleTenantAdminDto.java new file mode 100644 index 00000000..53b0bce0 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/MultipleTenantAdminDto.java @@ -0,0 +1,83 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class MultipleTenantAdminDto { + /** + * 用户唯一 ID + */ + @JsonProperty("userId") + private String userId; + /** + * 用户名称 + */ + @JsonProperty("name") + private String name; + /** + * 用户手机号 + */ + @JsonProperty("phone") + private String phone; + /** + * 用户邮箱 + */ + @JsonProperty("email") + private String email; + /** + * 授权 API + */ + @JsonProperty("apiAuthorized") + private Boolean apiAuthorized; + /** + * 最后登录时间 + */ + @JsonProperty("lastLogin") + private String lastLogin; + + public String getUserId() { + return userId; + } + public void setUserId(String userId) { + this.userId = userId; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } + + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + public Boolean getApiAuthorized() { + return apiAuthorized; + } + public void setApiAuthorized(Boolean apiAuthorized) { + this.apiAuthorized = apiAuthorized; + } + + public String getLastLogin() { + return lastLogin; + } + public void setLastLogin(String lastLogin) { + this.lastLogin = lastLogin; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/MultipleTenantAdminListPagingDto.java b/src/main/java/cn/authing/sdk/java/dto/MultipleTenantAdminListPagingDto.java new file mode 100644 index 00000000..1db3b9c5 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/MultipleTenantAdminListPagingDto.java @@ -0,0 +1,36 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.MultipleTenantAdminDto; + +public class MultipleTenantAdminListPagingDto { + /** + * 记录总数 + */ + @JsonProperty("totalCount") + private Integer totalCount; + /** + * 响应数据 + */ + @JsonProperty("list") + private List list; + + public Integer getTotalCount() { + return totalCount; + } + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public List getList() { + return list; + } + public void setList(List list) { + this.list = list; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/MultipleTenantAdminPaginatedRespDto.java b/src/main/java/cn/authing/sdk/java/dto/MultipleTenantAdminPaginatedRespDto.java new file mode 100644 index 00000000..76f0fa73 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/MultipleTenantAdminPaginatedRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.MultipleTenantAdminListPagingDto; + +public class MultipleTenantAdminPaginatedRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private MultipleTenantAdminListPagingDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public MultipleTenantAdminListPagingDto getData() { + return data; + } + public void setData(MultipleTenantAdminListPagingDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/OpenEventDto.java b/src/main/java/cn/authing/sdk/java/dto/OpenEventDto.java new file mode 100644 index 00000000..f10c10d3 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/OpenEventDto.java @@ -0,0 +1,71 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class OpenEventDto { + /** + * 事件 ID + */ + @JsonProperty("id") + private String id; + /** + * 事件标志 + */ + @JsonProperty("code") + private String code; + /** + * 事件 Topic + */ + @JsonProperty("topic") + private String topic; + /** + * 事件名称 + */ + @JsonProperty("name") + private String name; + /** + * 事件描述 + */ + @JsonProperty("desc") + private String desc; + + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + + public String getTopic() { + return topic; + } + public void setTopic(String topic) { + this.topic = topic; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public String getDesc() { + return desc; + } + public void setDesc(String desc) { + this.desc = desc; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/OpenEventPaginatedRespDto.java b/src/main/java/cn/authing/sdk/java/dto/OpenEventPaginatedRespDto.java new file mode 100644 index 00000000..f3ace2e8 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/OpenEventPaginatedRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.OpenEventPagingDto; + +public class OpenEventPaginatedRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private OpenEventPagingDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public OpenEventPagingDto getData() { + return data; + } + public void setData(OpenEventPagingDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/OpenEventPagingDto.java b/src/main/java/cn/authing/sdk/java/dto/OpenEventPagingDto.java new file mode 100644 index 00000000..a11acadf --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/OpenEventPagingDto.java @@ -0,0 +1,36 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.OpenEventDto; + +public class OpenEventPagingDto { + /** + * 记录总数 + */ + @JsonProperty("totalCount") + private Integer totalCount; + /** + * 数据列表 + */ + @JsonProperty("list") + private List list; + + public Integer getTotalCount() { + return totalCount; + } + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public List getList() { + return list; + } + public void setList(List list) { + this.list = list; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/OrganizationDto.java b/src/main/java/cn/authing/sdk/java/dto/OrganizationDto.java index b348ca7c..840c4d5a 100644 --- a/src/main/java/cn/authing/sdk/java/dto/OrganizationDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/OrganizationDto.java @@ -76,6 +76,11 @@ public class OrganizationDto { */ @JsonProperty("tenantId") private String tenantId; + /** + * 岗位 id 列表 + */ + @JsonProperty("postIdList") + private String postIdList; public String getOrganizationCode() { return organizationCode; @@ -175,6 +180,13 @@ public void setTenantId(String tenantId) { this.tenantId = tenantId; } + public String getPostIdList() { + return postIdList; + } + public void setPostIdList(String postIdList) { + this.postIdList = postIdList; + } + } \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/PostDto.java b/src/main/java/cn/authing/sdk/java/dto/PostDto.java new file mode 100644 index 00000000..ccdfbd67 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/PostDto.java @@ -0,0 +1,47 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class PostDto { + /** + * 分组 code + */ + @JsonProperty("code") + private String code; + /** + * 分组名称 + */ + @JsonProperty("name") + private String name; + /** + * 分组描述 + */ + @JsonProperty("description") + private String description; + + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/PostInfoDto.java b/src/main/java/cn/authing/sdk/java/dto/PostInfoDto.java new file mode 100644 index 00000000..c2706015 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/PostInfoDto.java @@ -0,0 +1,59 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class PostInfoDto { + /** + * 分组 code + */ + @JsonProperty("code") + private String code; + /** + * 分组名称 + */ + @JsonProperty("name") + private String name; + /** + * 分组描述 + */ + @JsonProperty("description") + private String description; + /** + * 岗位关联部门数 + */ + @JsonProperty("departmentIdList") + private List departmentIdList; + + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + public List getDepartmentIdList() { + return departmentIdList; + } + public void setDepartmentIdList(List departmentIdList) { + this.departmentIdList = departmentIdList; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/PostItemDto.java b/src/main/java/cn/authing/sdk/java/dto/PostItemDto.java new file mode 100644 index 00000000..bc79e856 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/PostItemDto.java @@ -0,0 +1,71 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class PostItemDto { + /** + * 分组 code + */ + @JsonProperty("code") + private String code; + /** + * 分组名称 + */ + @JsonProperty("name") + private String name; + /** + * 分组描述 + */ + @JsonProperty("description") + private String description; + /** + * 岗位关联用户数,只有在 skipCount 不为 true 时才存在 + */ + @JsonProperty("userCount") + private Integer userCount; + /** + * 岗位关联部门数,只有在 skipCount 不为 true 时才存在 + */ + @JsonProperty("departmentCount") + private Integer departmentCount; + + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + public Integer getUserCount() { + return userCount; + } + public void setUserCount(Integer userCount) { + this.userCount = userCount; + } + + public Integer getDepartmentCount() { + return departmentCount; + } + public void setDepartmentCount(Integer departmentCount) { + this.departmentCount = departmentCount; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/PostPaginatedRespDto.java b/src/main/java/cn/authing/sdk/java/dto/PostPaginatedRespDto.java new file mode 100644 index 00000000..4c892fa1 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/PostPaginatedRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.PostPagingDto; + +public class PostPaginatedRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private PostPagingDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public PostPagingDto getData() { + return data; + } + public void setData(PostPagingDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/PostPagingDto.java b/src/main/java/cn/authing/sdk/java/dto/PostPagingDto.java new file mode 100644 index 00000000..ef9cda80 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/PostPagingDto.java @@ -0,0 +1,36 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.PostItemDto; + +public class PostPagingDto { + /** + * 记录总数 + */ + @JsonProperty("totalCount") + private Integer totalCount; + /** + * 响应数据 + */ + @JsonProperty("list") + private List list; + + public Integer getTotalCount() { + return totalCount; + } + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public List getList() { + return list; + } + public void setList(List list) { + this.list = list; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/PostRespDto.java b/src/main/java/cn/authing/sdk/java/dto/PostRespDto.java new file mode 100644 index 00000000..e832254f --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/PostRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.PostDto; + +public class PostRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private PostDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public PostDto getData() { + return data; + } + public void setData(PostDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/PubEventDto.java b/src/main/java/cn/authing/sdk/java/dto/PubEventDto.java new file mode 100644 index 00000000..c42154e1 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/PubEventDto.java @@ -0,0 +1,35 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class PubEventDto { + /** + * 事件类型 + */ + @JsonProperty("eventType") + private String eventType; + /** + * 事件体 + */ + @JsonProperty("eventData") + private Object eventData; + + public String getEventType() { + return eventType; + } + public void setEventType(String eventType) { + this.eventType = eventType; + } + + public Object getEventData() { + return eventData; + } + public void setEventData(Object eventData) { + this.eventData = eventData; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/PubEventRespDataDto.java b/src/main/java/cn/authing/sdk/java/dto/PubEventRespDataDto.java new file mode 100644 index 00000000..c8749c9b --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/PubEventRespDataDto.java @@ -0,0 +1,35 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class PubEventRespDataDto { + /** + * 发送是否成功 + */ + @JsonProperty("success") + private Boolean success; + /** + * 发送失败的错误提示 + */ + @JsonProperty("errMsg") + private Boolean errMsg; + + public Boolean getSuccess() { + return success; + } + public void setSuccess(Boolean success) { + this.success = success; + } + + public Boolean getErrMsg() { + return errMsg; + } + public void setErrMsg(Boolean errMsg) { + this.errMsg = errMsg; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/PubEventRespDto.java b/src/main/java/cn/authing/sdk/java/dto/PubEventRespDto.java new file mode 100644 index 00000000..8fd34d49 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/PubEventRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.PubEventRespDataDto; + +public class PubEventRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private PubEventRespDataDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public PubEventRespDataDto getData() { + return data; + } + public void setData(PubEventRespDataDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialCreationOptionsDto.java b/src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialCreationOptionsDto.java new file mode 100644 index 00000000..5fc826d9 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialCreationOptionsDto.java @@ -0,0 +1,87 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.PublicKeyCredentialDescriptorDto; +import cn.authing.sdk.java.dto.PublicKeyCredentialParametersDto; +import cn.authing.sdk.java.dto.PublicKeyCredentialRpEntityDto; +import cn.authing.sdk.java.dto.PublicKeyCredentialUserEntityDto; + +public class PublicKeyCredentialCreationOptionsDto { + /** + * 挑战码, base64Url 编码 + */ + @JsonProperty("challenge") + private String challenge; + /** + * 用于标识要排除的凭证,可以避免同一个用户多次注册同一个认证器 + */ + @JsonProperty("excludeCredentials") + private List excludeCredentials; + /** + * 算法列表,指明信赖方接受哪些签名算法 + */ + @JsonProperty("pubKeyCredParams") + private List pubKeyCredParams; + /** + * 信赖方信息 + */ + @JsonProperty("rp") + private PublicKeyCredentialRpEntityDto rp; + /** + * 超时时间(毫秒值) + */ + @JsonProperty("timeout") + private Integer timeout; + /** + * 用户信息 + */ + @JsonProperty("user") + private PublicKeyCredentialUserEntityDto user; + + public String getChallenge() { + return challenge; + } + public void setChallenge(String challenge) { + this.challenge = challenge; + } + + public List getExcludeCredentials() { + return excludeCredentials; + } + public void setExcludeCredentials(List excludeCredentials) { + this.excludeCredentials = excludeCredentials; + } + + public List getPubKeyCredParams() { + return pubKeyCredParams; + } + public void setPubKeyCredParams(List pubKeyCredParams) { + this.pubKeyCredParams = pubKeyCredParams; + } + + public PublicKeyCredentialRpEntityDto getRp() { + return rp; + } + public void setRp(PublicKeyCredentialRpEntityDto rp) { + this.rp = rp; + } + + public Integer getTimeout() { + return timeout; + } + public void setTimeout(Integer timeout) { + this.timeout = timeout; + } + + public PublicKeyCredentialUserEntityDto getUser() { + return user; + } + public void setUser(PublicKeyCredentialUserEntityDto user) { + this.user = user; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialDescriptorDto.java b/src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialDescriptorDto.java new file mode 100644 index 00000000..915aca8f --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialDescriptorDto.java @@ -0,0 +1,52 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class PublicKeyCredentialDescriptorDto { + /** + * 允许的凭证 ID + */ + @JsonProperty("id") + private String id; + /** + * 凭证所需的认证器与用户代理的通信方式: + * - `ble`: 可以通过蓝牙连接的认证器 + * - `internal`: 平台内置的、无法移除的认证器 + * - `nfc`: 可以通过 NFC 连接的认证器 + * - `usb`: 可以通过 USB 连接的认证器 + * + */ + @JsonProperty("transports") + private List transports; + /** + * 固定值,public-key + */ + @JsonProperty("type") + private String type; + + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + public List getTransports() { + return transports; + } + public void setTransports(List transports) { + this.transports = transports; + } + + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialParametersDto.java b/src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialParametersDto.java new file mode 100644 index 00000000..aaea3f99 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialParametersDto.java @@ -0,0 +1,35 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class PublicKeyCredentialParametersDto { + /** + * 一个负整数,用于标明算法 + */ + @JsonProperty("alg") + private Integer alg; + /** + * 固定值,public-key + */ + @JsonProperty("type") + private String type; + + public Integer getAlg() { + return alg; + } + public void setAlg(Integer alg) { + this.alg = alg; + } + + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialRequestOptionsDto.java b/src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialRequestOptionsDto.java new file mode 100644 index 00000000..8ad9ea3d --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialRequestOptionsDto.java @@ -0,0 +1,60 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.PublicKeyCredentialDescriptorDto; + +public class PublicKeyCredentialRequestOptionsDto { + /** + * 挑战码, base64Url 编码 + */ + @JsonProperty("challenge") + private String challenge; + /** + * 认证器认证参数 + */ + @JsonProperty("allowCredentials") + private List allowCredentials; + /** + * 信赖方 ID,和注册认证器时一致 + */ + @JsonProperty("rpId") + private String rpId; + /** + * 超时时间(毫秒值) + */ + @JsonProperty("timeout") + private Integer timeout; + + public String getChallenge() { + return challenge; + } + public void setChallenge(String challenge) { + this.challenge = challenge; + } + + public List getAllowCredentials() { + return allowCredentials; + } + public void setAllowCredentials(List allowCredentials) { + this.allowCredentials = allowCredentials; + } + + public String getRpId() { + return rpId; + } + public void setRpId(String rpId) { + this.rpId = rpId; + } + + public Integer getTimeout() { + return timeout; + } + public void setTimeout(Integer timeout) { + this.timeout = timeout; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialRpEntityDto.java b/src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialRpEntityDto.java new file mode 100644 index 00000000..6fe567bf --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialRpEntityDto.java @@ -0,0 +1,35 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class PublicKeyCredentialRpEntityDto { + /** + * 信赖方 domain + */ + @JsonProperty("id") + private String id; + /** + * 信赖方名称 + */ + @JsonProperty("name") + private String name; + + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialUserEntityDto.java b/src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialUserEntityDto.java new file mode 100644 index 00000000..7f4215d5 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/PublicKeyCredentialUserEntityDto.java @@ -0,0 +1,47 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class PublicKeyCredentialUserEntityDto { + /** + * 用户 ID + */ + @JsonProperty("id") + private String id; + /** + * 用户名 + */ + @JsonProperty("name") + private String name; + /** + * 用于显示的用户名称 + */ + @JsonProperty("displayName") + private String displayName; + + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public String getDisplayName() { + return displayName; + } + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/RegistrationCredentialDto.java b/src/main/java/cn/authing/sdk/java/dto/RegistrationCredentialDto.java new file mode 100644 index 00000000..d7e02e33 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/RegistrationCredentialDto.java @@ -0,0 +1,77 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.AuthenticatorAttestationResponseDto; + +public class RegistrationCredentialDto { + /** + * Base64URL 编码的凭证 ID + */ + @JsonProperty("id") + private String id; + /** + * 原始凭证 ID + */ + @JsonProperty("rawId") + private String rawId; + /** + * 供信赖方以供验证与注册的对象 + */ + @JsonProperty("response") + private AuthenticatorAttestationResponseDto response; + /** + * 可选参数,凭证所需的认证器与用户代理的通信方式: + * - `ble`: 可以通过蓝牙连接的认证器 + * - `internal`: 平台内置的、无法移除的认证器 + * - `nfc`: 可以通过 NFC 连接的认证器 + * - `usb`: 可以通过 USB 连接的认证器 + * + */ + @JsonProperty("transports") + private List transports; + /** + * 固定值,'public-key' + */ + @JsonProperty("type") + private String type; + + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + public String getRawId() { + return rawId; + } + public void setRawId(String rawId) { + this.rawId = rawId; + } + + public AuthenticatorAttestationResponseDto getResponse() { + return response; + } + public void setResponse(AuthenticatorAttestationResponseDto response) { + this.response = response; + } + + public List getTransports() { + return transports; + } + public void setTransports(List transports) { + this.transports = transports; + } + + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/RegistrationOptionsDto.java b/src/main/java/cn/authing/sdk/java/dto/RegistrationOptionsDto.java new file mode 100644 index 00000000..5024ecce --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/RegistrationOptionsDto.java @@ -0,0 +1,36 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.PublicKeyCredentialCreationOptionsDto; + +public class RegistrationOptionsDto { + /** + * 认证器生成公钥凭证的参数 + */ + @JsonProperty("registrationOptions") + private PublicKeyCredentialCreationOptionsDto registrationOptions; + /** + * ticket 需回传,用作向服务器发起验证从认证器获得的创建凭证时的结果 + */ + @JsonProperty("ticket") + private String ticket; + + public PublicKeyCredentialCreationOptionsDto getRegistrationOptions() { + return registrationOptions; + } + public void setRegistrationOptions(PublicKeyCredentialCreationOptionsDto registrationOptions) { + this.registrationOptions = registrationOptions; + } + + public String getTicket() { + return ticket; + } + public void setTicket(String ticket) { + this.ticket = ticket; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/RemoveDeviceCredentialDto.java b/src/main/java/cn/authing/sdk/java/dto/RemoveDeviceCredentialDto.java new file mode 100644 index 00000000..9704891c --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/RemoveDeviceCredentialDto.java @@ -0,0 +1,11 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class RemoveDeviceCredentialDto { + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/RemovePostDto.java b/src/main/java/cn/authing/sdk/java/dto/RemovePostDto.java new file mode 100644 index 00000000..241d768f --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/RemovePostDto.java @@ -0,0 +1,23 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class RemovePostDto { + /** + * 分组 code + */ + @JsonProperty("code") + private String code; + + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/RemoveTenantDepartmentMembersReqDto.java b/src/main/java/cn/authing/sdk/java/dto/RemoveTenantDepartmentMembersReqDto.java new file mode 100644 index 00000000..8717b238 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/RemoveTenantDepartmentMembersReqDto.java @@ -0,0 +1,106 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class RemoveTenantDepartmentMembersReqDto { + /** + * 组织 code + */ + @JsonProperty("organizationCode") + private String organizationCode; + /** + * 部门系统 ID(为 Authing 系统自动生成,不可修改) + */ + @JsonProperty("departmentId") + private String departmentId; + /** + * 此次调用中使用的部门 ID 的类型 + */ + @JsonProperty("departmentIdType") + private DepartmentIdType departmentIdType; + /** + * 关联的用户池级别的用户 ID + */ + @JsonProperty("linkUserIds") + private List linkUserIds; + /** + * 租户成员 ID + */ + @JsonProperty("memberIds") + private List memberIds; + /** + * 租户 ID + */ + @JsonProperty("tenantId") + private String tenantId; + + public String getOrganizationCode() { + return organizationCode; + } + public void setOrganizationCode(String organizationCode) { + this.organizationCode = organizationCode; + } + + public String getDepartmentId() { + return departmentId; + } + public void setDepartmentId(String departmentId) { + this.departmentId = departmentId; + } + + public DepartmentIdType getDepartmentIdType() { + return departmentIdType; + } + public void setDepartmentIdType(DepartmentIdType departmentIdType) { + this.departmentIdType = departmentIdType; + } + + public List getLinkUserIds() { + return linkUserIds; + } + public void setLinkUserIds(List linkUserIds) { + this.linkUserIds = linkUserIds; + } + + public List getMemberIds() { + return memberIds; + } + public void setMemberIds(List memberIds) { + this.memberIds = memberIds; + } + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + + /** + * 此次调用中使用的部门 ID 的类型 + */ + public static enum DepartmentIdType { + + @JsonProperty("department_id") + DEPARTMENT_ID("department_id"), + + @JsonProperty("open_department_id") + OPEN_DEPARTMENT_ID("open_department_id"), + ; + + private String value; + + DepartmentIdType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + } + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/RemoveTenantUsersDto.java b/src/main/java/cn/authing/sdk/java/dto/RemoveTenantUsersDto.java new file mode 100644 index 00000000..87869ab6 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/RemoveTenantUsersDto.java @@ -0,0 +1,47 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class RemoveTenantUsersDto { + /** + * 租户 ID + */ + @JsonProperty("tenantId") + private String tenantId; + /** + * 关联的用户池级别的用户 ID + */ + @JsonProperty("linkUserIds") + private List linkUserIds; + /** + * 租户成员 ID + */ + @JsonProperty("memberIds") + private List memberIds; + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public List getLinkUserIds() { + return linkUserIds; + } + public void setLinkUserIds(List linkUserIds) { + this.linkUserIds = linkUserIds; + } + + public List getMemberIds() { + return memberIds; + } + public void setMemberIds(List memberIds) { + this.memberIds = memberIds; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/SendManyTenantEmailDto.java b/src/main/java/cn/authing/sdk/java/dto/SendManyTenantEmailDto.java new file mode 100644 index 00000000..7283d386 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/SendManyTenantEmailDto.java @@ -0,0 +1,48 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.SendTenantEmailDto; + +public class SendManyTenantEmailDto { + /** + * 管理员名 + */ + @JsonProperty("adminName") + private String adminName; + /** + * 导入 id + */ + @JsonProperty("importId") + private Integer importId; + /** + * 需要邮件通知的管理员 + */ + @JsonProperty("users") + private List users; + + public String getAdminName() { + return adminName; + } + public void setAdminName(String adminName) { + this.adminName = adminName; + } + + public Integer getImportId() { + return importId; + } + public void setImportId(Integer importId) { + this.importId = importId; + } + + public List getUsers() { + return users; + } + public void setUsers(List users) { + this.users = users; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/SendManyTenantSmsDto.java b/src/main/java/cn/authing/sdk/java/dto/SendManyTenantSmsDto.java new file mode 100644 index 00000000..ee5f3549 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/SendManyTenantSmsDto.java @@ -0,0 +1,48 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.SendTenantSmsDto; + +public class SendManyTenantSmsDto { + /** + * 管理员名 + */ + @JsonProperty("adminName") + private String adminName; + /** + * 导入 id + */ + @JsonProperty("importId") + private Integer importId; + /** + * 需要短信通知的管理员 + */ + @JsonProperty("users") + private List users; + + public String getAdminName() { + return adminName; + } + public void setAdminName(String adminName) { + this.adminName = adminName; + } + + public Integer getImportId() { + return importId; + } + public void setImportId(Integer importId) { + this.importId = importId; + } + + public List getUsers() { + return users; + } + public void setUsers(List users) { + this.users = users; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/SendTenantEmailDto.java b/src/main/java/cn/authing/sdk/java/dto/SendTenantEmailDto.java new file mode 100644 index 00000000..ee552a0a --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/SendTenantEmailDto.java @@ -0,0 +1,83 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class SendTenantEmailDto { + /** + * 管理员名字 + */ + @JsonProperty("adminName") + private String adminName; + /** + * 用户名 + */ + @JsonProperty("userName") + private String userName; + /** + * 管理员邮箱 + */ + @JsonProperty("email") + private String email; + /** + * 租户域名 + */ + @JsonProperty("identifier") + private String identifier; + /** + * 租户 id + */ + @JsonProperty("tenantId") + private String tenantId; + /** + * 租户名 + */ + @JsonProperty("tenantName") + private String tenantName; + + public String getAdminName() { + return adminName; + } + public void setAdminName(String adminName) { + this.adminName = adminName; + } + + public String getUserName() { + return userName; + } + public void setUserName(String userName) { + this.userName = userName; + } + + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + public String getIdentifier() { + return identifier; + } + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getTenantName() { + return tenantName; + } + public void setTenantName(String tenantName) { + this.tenantName = tenantName; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/SendTenantSmsDto.java b/src/main/java/cn/authing/sdk/java/dto/SendTenantSmsDto.java new file mode 100644 index 00000000..d232b6fe --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/SendTenantSmsDto.java @@ -0,0 +1,95 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class SendTenantSmsDto { + /** + * 管理员名字 + */ + @JsonProperty("adminName") + private String adminName; + /** + * 用户名 + */ + @JsonProperty("userName") + private String userName; + /** + * 用户唯一标识 + */ + @JsonProperty("identifier") + private String identifier; + /** + * 管理员手机 + */ + @JsonProperty("phone") + private String phone; + /** + * 管理员手机地区号 + */ + @JsonProperty("phoneCountryCode") + private String phoneCountryCode; + /** + * 租户 id + */ + @JsonProperty("tenantId") + private String tenantId; + /** + * 租户名 + */ + @JsonProperty("tenantName") + private String tenantName; + + public String getAdminName() { + return adminName; + } + public void setAdminName(String adminName) { + this.adminName = adminName; + } + + public String getUserName() { + return userName; + } + public void setUserName(String userName) { + this.userName = userName; + } + + public String getIdentifier() { + return identifier; + } + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } + + public String getPhoneCountryCode() { + return phoneCountryCode; + } + public void setPhoneCountryCode(String phoneCountryCode) { + this.phoneCountryCode = phoneCountryCode; + } + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getTenantName() { + return tenantName; + } + public void setTenantName(String tenantName) { + this.tenantName = tenantName; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/SignInByBaiduPayloadDto.java b/src/main/java/cn/authing/sdk/java/dto/SignInByBaiduPayloadDto.java new file mode 100644 index 00000000..97840935 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/SignInByBaiduPayloadDto.java @@ -0,0 +1,35 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class SignInByBaiduPayloadDto { + /** + * 百度移动端社会化登录获取到的授权码 `code`。和属性 `access_token` 任选一个参数。两个都不为空,则优先使用授权码 `code` 参数。 + */ + @JsonProperty("code") + private String code; + /** + * 百度移动端社会化登录获取到的授权访问凭证 `access_token`。和属性 `code` 任选一个参数。两个都不为空,则优先使用授权码 `code` 参数。 + */ + @JsonProperty("access_token") + private String accessToken; + + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + + public String getAccessToken() { + return accessToken; + } + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/SignInByDingTalkPayloadDto.java b/src/main/java/cn/authing/sdk/java/dto/SignInByDingTalkPayloadDto.java new file mode 100644 index 00000000..14fc8f71 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/SignInByDingTalkPayloadDto.java @@ -0,0 +1,35 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class SignInByDingTalkPayloadDto { + /** + * 钉钉移动端社会化登录获取到的 code + */ + @JsonProperty("code") + private String code; + /** + * 如果钉钉移动端社会化登录获取到的 `code` 需要调用 `sns/getuserinfo_bycode` 接口获取授权用户的个人信息,则参数 `isSnsCode` 传 `true`, 否则将通过 `code` 换取 `accessToken` 再获取用户信息 + */ + @JsonProperty("isSnsCode") + private Boolean isSnsCode; + + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + + public Boolean getIsSnsCode() { + return isSnsCode; + } + public void setIsSnsCode(Boolean isSnsCode) { + this.isSnsCode = isSnsCode; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/SignInByFacebookPayloadDto.java b/src/main/java/cn/authing/sdk/java/dto/SignInByFacebookPayloadDto.java new file mode 100644 index 00000000..7b035d56 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/SignInByFacebookPayloadDto.java @@ -0,0 +1,23 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class SignInByFacebookPayloadDto { + /** + * Facebook 移动端社会化登录获取到的 access_token + */ + @JsonProperty("access_token") + private String accessToken; + + public String getAccessToken() { + return accessToken; + } + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/SignInByLinkedInPayloadDto.java b/src/main/java/cn/authing/sdk/java/dto/SignInByLinkedInPayloadDto.java new file mode 100644 index 00000000..b092800f --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/SignInByLinkedInPayloadDto.java @@ -0,0 +1,23 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class SignInByLinkedInPayloadDto { + /** + * LinkedIn 移动端社会化登录获取到的 code + */ + @JsonProperty("code") + private String code; + + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/SignInByPushDto.java b/src/main/java/cn/authing/sdk/java/dto/SignInByPushDto.java new file mode 100644 index 00000000..4f7cacbf --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/SignInByPushDto.java @@ -0,0 +1,36 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.SignInByPushOptionsDto; + +public class SignInByPushDto { + /** + * 用户账号(用户名/手机号/邮箱) + */ + @JsonProperty("account") + private String account; + /** + * 可选参数 + */ + @JsonProperty("options") + private SignInByPushOptionsDto options; + + public String getAccount() { + return account; + } + public void setAccount(String account) { + this.account = account; + } + + public SignInByPushOptionsDto getOptions() { + return options; + } + public void setOptions(SignInByPushOptionsDto options) { + this.options = options; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/SignInByPushOptionsDto.java b/src/main/java/cn/authing/sdk/java/dto/SignInByPushOptionsDto.java new file mode 100644 index 00000000..308ca553 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/SignInByPushOptionsDto.java @@ -0,0 +1,58 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class SignInByPushOptionsDto { + /** + * 需要请求的权限,必须包含 openid。如果需要获取手机号和 email 需要包含 phone email;如果需要 refresh_token 需要包含 offline_access。多个 scope 请用空格分隔。id_token 解码后的内容中会包含这些 scope 对应的用户信息相关的字段。 + * - `openid`: 必须包含。 + * - `profile`: 返回 birthdate,family_name,gender,given_name,locale,middle_name,name,nickname,picture,preferred_username,profile,updated_at,website,zoneinfo 字段。 + * - `username`: 返回 username。 + * - `email`: 返回 email,email_verified。 + * - `phone`: 返回 phone_number, phone_number_verified。 + * - `offline_access`: 如果存在此参数,token 接口会返回 refresh_token 字段。 + * - `roles`: 返回用户的角色列表。 + * - `external_id`: 用户在原有系统的用户 ID。 + * - `extended_fields`: 返回用户的扩展字段信息,内容为一个对象,key 为扩展字段名,value 为扩展字段值。 + * - `tenant_id`: 返回用户的租户 ID。 + * + */ + @JsonProperty("scope") + private String scope; + /** + * 额外请求上下文,将会传递到认证前和认证后的 [Pipeline](https://docs.authing.cn/v2/guides/pipeline/) 的 `context` 对象中。了解[如何在 Pipeline 的 `context` 参数中获取传入的额外 context](https://docs.authing.cn/v2/guides/pipeline/context-object.html)。 + */ + @JsonProperty("context") + private String context; + /** + * 设置额外的用户自定义数据,你需要先在 Authing 控制台[配置自定义数据](https://docs.authing.cn/v2/guides/users/user-defined-field/)。 + */ + @JsonProperty("customData") + private Object customData; + + public String getScope() { + return scope; + } + public void setScope(String scope) { + this.scope = scope; + } + + public String getContext() { + return context; + } + public void setContext(String context) { + this.context = context; + } + + public Object getCustomData() { + return customData; + } + public void setCustomData(Object customData) { + this.customData = customData; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/SignInByQQPayloadDto.java b/src/main/java/cn/authing/sdk/java/dto/SignInByQQPayloadDto.java new file mode 100644 index 00000000..12584992 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/SignInByQQPayloadDto.java @@ -0,0 +1,23 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class SignInByQQPayloadDto { + /** + * QQ 移动端社会化登录获取到的 access_token + */ + @JsonProperty("access_token") + private String accessToken; + + public String getAccessToken() { + return accessToken; + } + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/SignInByWebAuthnOptionsDto.java b/src/main/java/cn/authing/sdk/java/dto/SignInByWebAuthnOptionsDto.java new file mode 100644 index 00000000..acc07294 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/SignInByWebAuthnOptionsDto.java @@ -0,0 +1,58 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class SignInByWebAuthnOptionsDto { + /** + * 需要请求的权限,必须包含 openid。如果需要获取手机号和 email 需要包含 phone email;如果需要 refresh_token 需要包含 offline_access。多个 scope 请用空格分隔。id_token 解码后的内容中会包含这些 scope 对应的用户信息相关的字段。 + * - `openid`: 必须包含。 + * - `profile`: 返回 birthdate,family_name,gender,given_name,locale,middle_name,name,nickname,picture,preferred_username,profile,updated_at,website,zoneinfo 字段。 + * - `username`: 返回 username。 + * - `email`: 返回 email,email_verified。 + * - `phone`: 返回 phone_number, phone_number_verified。 + * - `offline_access`: 如果存在此参数,token 接口会返回 refresh_token 字段。 + * - `roles`: 返回用户的角色列表。 + * - `external_id`: 用户在原有系统的用户 ID。 + * - `extended_fields`: 返回用户的扩展字段信息,内容为一个对象,key 为扩展字段名,value 为扩展字段值。 + * - `tenant_id`: 返回用户的租户 ID。 + * + */ + @JsonProperty("scope") + private String scope; + /** + * 额外请求上下文,将会传递到认证前和认证后的 [Pipeline](https://docs.authing.cn/v2/guides/pipeline/) 的 `context` 对象中。了解[如何在 Pipeline 的 `context` 参数中获取传入的额外 context](https://docs.authing.cn/v2/guides/pipeline/context-object.html)。 + */ + @JsonProperty("context") + private String context; + /** + * 设置额外的用户自定义数据,你需要先在 Authing 控制台[配置自定义数据](https://docs.authing.cn/v2/guides/users/user-defined-field/)。 + */ + @JsonProperty("customData") + private Object customData; + + public String getScope() { + return scope; + } + public void setScope(String scope) { + this.scope = scope; + } + + public String getContext() { + return context; + } + public void setContext(String context) { + this.context = context; + } + + public Object getCustomData() { + return customData; + } + public void setCustomData(Object customData) { + this.customData = customData; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/SignInByWechatMiniProgramCodeAndPhonePayloadDto.java b/src/main/java/cn/authing/sdk/java/dto/SignInByWechatMiniProgramCodeAndPhonePayloadDto.java new file mode 100644 index 00000000..ffec47c7 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/SignInByWechatMiniProgramCodeAndPhonePayloadDto.java @@ -0,0 +1,37 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.SignInByWechatMiniProgramCodePayloadDto; +import cn.authing.sdk.java.dto.SignInByWechatMiniProgramPhoneInfoPayloadDto; + +public class SignInByWechatMiniProgramCodeAndPhonePayloadDto { + /** + * 微信小程序使用 code 登录相关数据,必填 + */ + @JsonProperty("wxLoginInfo") + private SignInByWechatMiniProgramCodePayloadDto wxLoginInfo; + /** + * 必填,微信小程序用户授权使用手机号登录相关数据。如果是新用户注册到用户池,手机号将会同步更新到用户信息;如果用户池用户已存在,若用户没有绑定过手机号且从小程序授权的手机号未被绑定过,将会把手机号更新到用户信息上。 + */ + @JsonProperty("wxPhoneInfo") + private SignInByWechatMiniProgramPhoneInfoPayloadDto wxPhoneInfo; + + public SignInByWechatMiniProgramCodePayloadDto getWxLoginInfo() { + return wxLoginInfo; + } + public void setWxLoginInfo(SignInByWechatMiniProgramCodePayloadDto wxLoginInfo) { + this.wxLoginInfo = wxLoginInfo; + } + + public SignInByWechatMiniProgramPhoneInfoPayloadDto getWxPhoneInfo() { + return wxPhoneInfo; + } + public void setWxPhoneInfo(SignInByWechatMiniProgramPhoneInfoPayloadDto wxPhoneInfo) { + this.wxPhoneInfo = wxPhoneInfo; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/SignInByWechatMiniProgramPhoneInfoPayloadDto.java b/src/main/java/cn/authing/sdk/java/dto/SignInByWechatMiniProgramPhoneInfoPayloadDto.java new file mode 100644 index 00000000..42c9e416 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/SignInByWechatMiniProgramPhoneInfoPayloadDto.java @@ -0,0 +1,23 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class SignInByWechatMiniProgramPhoneInfoPayloadDto { + /** + * 小程序获取用户手机号返回的 `code` + */ + @JsonProperty("code") + private String code; + + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/SignInByWeiboPayloadDto.java b/src/main/java/cn/authing/sdk/java/dto/SignInByWeiboPayloadDto.java new file mode 100644 index 00000000..148820c8 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/SignInByWeiboPayloadDto.java @@ -0,0 +1,23 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class SignInByWeiboPayloadDto { + /** + * 新浪微博移动端社会化登录获取到的 access_token + */ + @JsonProperty("access_token") + private String accessToken; + + public String getAccessToken() { + return accessToken; + } + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/SignInFastpassDto.java b/src/main/java/cn/authing/sdk/java/dto/SignInFastpassDto.java new file mode 100644 index 00000000..029a8173 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/SignInFastpassDto.java @@ -0,0 +1,24 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.SignInFastpassOptionsDto; + +public class SignInFastpassDto { + /** + * 可选参数 + */ + @JsonProperty("options") + private SignInFastpassOptionsDto options; + + public SignInFastpassOptionsDto getOptions() { + return options; + } + public void setOptions(SignInFastpassOptionsDto options) { + this.options = options; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/SignInFastpassOptionsDto.java b/src/main/java/cn/authing/sdk/java/dto/SignInFastpassOptionsDto.java new file mode 100644 index 00000000..654621d6 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/SignInFastpassOptionsDto.java @@ -0,0 +1,58 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class SignInFastpassOptionsDto { + /** + * 需要请求的权限,必须包含 openid。如果需要获取手机号和 email 需要包含 phone email;如果需要 refresh_token 需要包含 offline_access。多个 scope 请用空格分隔。id_token 解码后的内容中会包含这些 scope 对应的用户信息相关的字段。 + * - `openid`: 必须包含。 + * - `profile`: 返回 birthdate,family_name,gender,given_name,locale,middle_name,name,nickname,picture,preferred_username,profile,updated_at,website,zoneinfo 字段。 + * - `username`: 返回 username。 + * - `email`: 返回 email,email_verified。 + * - `phone`: 返回 phone_number, phone_number_verified。 + * - `offline_access`: 如果存在此参数,token 接口会返回 refresh_token 字段。 + * - `roles`: 返回用户的角色列表。 + * - `external_id`: 用户在原有系统的用户 ID。 + * - `extended_fields`: 返回用户的扩展字段信息,内容为一个对象,key 为扩展字段名,value 为扩展字段值。 + * - `tenant_id`: 返回用户的租户 ID。 + * + */ + @JsonProperty("scope") + private String scope; + /** + * 额外请求上下文,将会传递到认证前和认证后的 [Pipeline](https://docs.authing.cn/v2/guides/pipeline/) 的 `context` 对象中。了解[如何在 Pipeline 的 `context` 参数中获取传入的额外 context](https://docs.authing.cn/v2/guides/pipeline/context-object.html)。 + */ + @JsonProperty("context") + private String context; + /** + * 设置额外的用户自定义数据,你需要先在 Authing 控制台[配置自定义数据](https://docs.authing.cn/v2/guides/users/user-defined-field/)。 + */ + @JsonProperty("customData") + private Object customData; + + public String getScope() { + return scope; + } + public void setScope(String scope) { + this.scope = scope; + } + + public String getContext() { + return context; + } + public void setContext(String context) { + this.context = context; + } + + public Object getCustomData() { + return customData; + } + public void setCustomData(Object customData) { + this.customData = customData; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/SigninByMobileDto.java b/src/main/java/cn/authing/sdk/java/dto/SigninByMobileDto.java index 840fb74a..2c7e3c95 100644 --- a/src/main/java/cn/authing/sdk/java/dto/SigninByMobileDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/SigninByMobileDto.java @@ -5,15 +5,22 @@ import cn.authing.sdk.java.dto.SignInByAlipayPayloadDto; import cn.authing.sdk.java.dto.SignInByApplePayloadDto; +import cn.authing.sdk.java.dto.SignInByBaiduPayloadDto; +import cn.authing.sdk.java.dto.SignInByDingTalkPayloadDto; +import cn.authing.sdk.java.dto.SignInByFacebookPayloadDto; import cn.authing.sdk.java.dto.SignInByGooglePayloadDto; import cn.authing.sdk.java.dto.SignInByLarkInternalPayloadDto; import cn.authing.sdk.java.dto.SignInByLarkPublicPayloadDto; +import cn.authing.sdk.java.dto.SignInByLinkedInPayloadDto; import cn.authing.sdk.java.dto.SignInByMobileOptionsDto; +import cn.authing.sdk.java.dto.SignInByQQPayloadDto; +import cn.authing.sdk.java.dto.SignInByWechatMiniProgramCodeAndPhonePayloadDto; import cn.authing.sdk.java.dto.SignInByWechatMiniProgramCodePayloadDto; import cn.authing.sdk.java.dto.SignInByWechatMiniProgramPhonePayloadDto; import cn.authing.sdk.java.dto.SignInByWechatPayloadDto; import cn.authing.sdk.java.dto.SignInByWechatworkAgencyPayloadDto; import cn.authing.sdk.java.dto.SignInByWechatworkDto; +import cn.authing.sdk.java.dto.SignInByWeiboPayloadDto; import cn.authing.sdk.java.dto.SignInByYidunPayloadDto; public class SigninByMobileDto { @@ -34,7 +41,14 @@ public class SigninByMobileDto { * - `yidun`: 网易易盾一键登录 * - `wechat_mini_program_code`: 微信小程序使用 code 登录 * - `wechat_mini_program_phone `: 微信小程序使用手机号登录 + * - `wechat_mini_program_code_and_phone `: 微信小程序使用 code 和手机号登录 * - `google`: Google 移动端社会化登录 + * - `facebook`: Facebook 移动端社会化登录 + * - `qq`: QQ 移动端社会化登录 + * - `weibo`: 新浪微博移动端社会化登录 + * - `baidu`: 百度移动端社会化登录 + * - `linkedin`: LinkedIn 移动端社会化登录 + * - `dingtalk`: 钉钉移动端社会化登录 * */ @JsonProperty("connection") @@ -89,11 +103,46 @@ public class SigninByMobileDto { */ @JsonProperty("wechatMiniProgramPhonePayload") private SignInByWechatMiniProgramPhonePayloadDto wechatMiniProgramPhonePayload; + /** + * 微信小程序使用 code 和手机号登录相关数据,当 `connection` 为 `wechat_mini_program_code_and_phone` 的时候必填。 + */ + @JsonProperty("wechatMiniProgramCodeAndPhonePayload") + private SignInByWechatMiniProgramCodeAndPhonePayloadDto wechatMiniProgramCodeAndPhonePayload; /** * Google 移动端社会化登录数据,当 `connection` 为 `google` 的时候必填。 */ @JsonProperty("googlePayload") private SignInByGooglePayloadDto googlePayload; + /** + * Facebook 移动端社会化登录数据,当 `connection` 为 `facebook` 的时候必填。 + */ + @JsonProperty("facebookPayload") + private SignInByFacebookPayloadDto facebookPayload; + /** + * QQ 移动端社会化登录数据,当 `connection` 为 `qq` 的时候必填。 + */ + @JsonProperty("qqPayload") + private SignInByQQPayloadDto qqPayload; + /** + * 新浪微博移动端社会化登录数据,当 `connection` 为 `weibo` 的时候必填。 + */ + @JsonProperty("weiboPayload") + private SignInByWeiboPayloadDto weiboPayload; + /** + * 百度移动端社会化登录数据,当 `connection` 为 `baidu` 的时候必填,且 `baiduPayload` 的属性 `code` 和 `access_token` 必选其一,优先使用 `code` 值作为授权登录方式。 + */ + @JsonProperty("baiduPayload") + private SignInByBaiduPayloadDto baiduPayload; + /** + * LinkedIn 移动端社会化登录数据,当 `connection` 为 `linkedin` 的时候必填。 + */ + @JsonProperty("linkedInPayload") + private SignInByLinkedInPayloadDto linkedInPayload; + /** + * 钉钉移动端社会化登录数据,当 `connection` 为 `dingtalk` 的时候必填。 + */ + @JsonProperty("dingTalkPayload") + private SignInByDingTalkPayloadDto dingTalkPayload; /** * 可选参数 */ @@ -194,6 +243,13 @@ public void setWechatMiniProgramPhonePayload(SignInByWechatMiniProgramPhonePaylo this.wechatMiniProgramPhonePayload = wechatMiniProgramPhonePayload; } + public SignInByWechatMiniProgramCodeAndPhonePayloadDto getWechatMiniProgramCodeAndPhonePayload() { + return wechatMiniProgramCodeAndPhonePayload; + } + public void setWechatMiniProgramCodeAndPhonePayload(SignInByWechatMiniProgramCodeAndPhonePayloadDto wechatMiniProgramCodeAndPhonePayload) { + this.wechatMiniProgramCodeAndPhonePayload = wechatMiniProgramCodeAndPhonePayload; + } + public SignInByGooglePayloadDto getGooglePayload() { return googlePayload; } @@ -201,6 +257,48 @@ public void setGooglePayload(SignInByGooglePayloadDto googlePayload) { this.googlePayload = googlePayload; } + public SignInByFacebookPayloadDto getFacebookPayload() { + return facebookPayload; + } + public void setFacebookPayload(SignInByFacebookPayloadDto facebookPayload) { + this.facebookPayload = facebookPayload; + } + + public SignInByQQPayloadDto getQqPayload() { + return qqPayload; + } + public void setQqPayload(SignInByQQPayloadDto qqPayload) { + this.qqPayload = qqPayload; + } + + public SignInByWeiboPayloadDto getWeiboPayload() { + return weiboPayload; + } + public void setWeiboPayload(SignInByWeiboPayloadDto weiboPayload) { + this.weiboPayload = weiboPayload; + } + + public SignInByBaiduPayloadDto getBaiduPayload() { + return baiduPayload; + } + public void setBaiduPayload(SignInByBaiduPayloadDto baiduPayload) { + this.baiduPayload = baiduPayload; + } + + public SignInByLinkedInPayloadDto getLinkedInPayload() { + return linkedInPayload; + } + public void setLinkedInPayload(SignInByLinkedInPayloadDto linkedInPayload) { + this.linkedInPayload = linkedInPayload; + } + + public SignInByDingTalkPayloadDto getDingTalkPayload() { + return dingTalkPayload; + } + public void setDingTalkPayload(SignInByDingTalkPayloadDto dingTalkPayload) { + this.dingTalkPayload = dingTalkPayload; + } + public SignInByMobileOptionsDto getOptions() { return options; } @@ -235,7 +333,14 @@ public void setClientSecret(String clientSecret) { * - `yidun`: 网易易盾一键登录 * - `wechat_mini_program_code`: 微信小程序使用 code 登录 * - `wechat_mini_program_phone `: 微信小程序使用手机号登录 + * - `wechat_mini_program_code_and_phone `: 微信小程序使用 code 和手机号登录 * - `google`: Google 移动端社会化登录 + * - `facebook`: Facebook 移动端社会化登录 + * - `qq`: QQ 移动端社会化登录 + * - `weibo`: 新浪微博移动端社会化登录 + * - `baidu`: 百度移动端社会化登录 + * - `linkedin`: LinkedIn 移动端社会化登录 + * - `dingtalk`: 钉钉移动端社会化登录 * */ public static enum Connection { @@ -270,8 +375,29 @@ public static enum Connection { @JsonProperty("wechat_mini_program_phone") WECHAT_MINI_PROGRAM_PHONE("wechat_mini_program_phone"), + @JsonProperty("wechat_mini_program_code_and_phone") + WECHAT_MINI_PROGRAM_CODE_AND_PHONE("wechat_mini_program_code_and_phone"), + @JsonProperty("google") GOOGLE("google"), + + @JsonProperty("facebook") + FACEBOOK("facebook"), + + @JsonProperty("qq") + QQ("qq"), + + @JsonProperty("weibo") + WEIBO("weibo"), + + @JsonProperty("baidu") + BAIDU("baidu"), + + @JsonProperty("linkedin") + LINKEDIN("linkedin"), + + @JsonProperty("dingtalk") + DINGTALK("dingtalk"), ; private String value; diff --git a/src/main/java/cn/authing/sdk/java/dto/TenantCooperatorDto.java b/src/main/java/cn/authing/sdk/java/dto/TenantCooperatorDto.java new file mode 100644 index 00000000..660ef9a9 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/TenantCooperatorDto.java @@ -0,0 +1,73 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.TenantUserDto; +import cn.authing.sdk.java.dto.UserDto; + +public class TenantCooperatorDto { + /** + * 用户唯一 ID + */ + @JsonProperty("userId") + private String userId; + /** + * 类型 + */ + @JsonProperty("type") + private String type; + /** + * 是否external + */ + @JsonProperty("external") + private Boolean external; + /** + * 用户 + */ + @JsonProperty("user") + private UserDto user; + /** + * 租户用户 + */ + @JsonProperty("tenantUser") + private TenantUserDto tenantUser; + + public String getUserId() { + return userId; + } + public void setUserId(String userId) { + this.userId = userId; + } + + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + public Boolean getExternal() { + return external; + } + public void setExternal(Boolean external) { + this.external = external; + } + + public UserDto getUser() { + return user; + } + public void setUser(UserDto user) { + this.user = user; + } + + public TenantUserDto getTenantUser() { + return tenantUser; + } + public void setTenantUser(TenantUserDto tenantUser) { + this.tenantUser = tenantUser; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/TenantCooperatorListPagingDto.java b/src/main/java/cn/authing/sdk/java/dto/TenantCooperatorListPagingDto.java new file mode 100644 index 00000000..788a9e3f --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/TenantCooperatorListPagingDto.java @@ -0,0 +1,36 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.TenantCooperatorDto; + +public class TenantCooperatorListPagingDto { + /** + * 记录总数 + */ + @JsonProperty("totalCount") + private Integer totalCount; + /** + * 响应数据 + */ + @JsonProperty("list") + private List list; + + public Integer getTotalCount() { + return totalCount; + } + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public List getList() { + return list; + } + public void setList(List list) { + this.list = list; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/TenantCooperatorPaginatedRespDto.java b/src/main/java/cn/authing/sdk/java/dto/TenantCooperatorPaginatedRespDto.java new file mode 100644 index 00000000..17b04e0f --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/TenantCooperatorPaginatedRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.TenantCooperatorListPagingDto; + +public class TenantCooperatorPaginatedRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private TenantCooperatorListPagingDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public TenantCooperatorListPagingDto getData() { + return data; + } + public void setData(TenantCooperatorListPagingDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/TenantCooperatorSingleDto.java b/src/main/java/cn/authing/sdk/java/dto/TenantCooperatorSingleDto.java new file mode 100644 index 00000000..e8d3dca5 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/TenantCooperatorSingleDto.java @@ -0,0 +1,35 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class TenantCooperatorSingleDto { + /** + * 菜单 + */ + @JsonProperty("list") + private List list; + /** + * 策略 + */ + @JsonProperty("authorizedPoliciesCode") + private List authorizedPoliciesCode; + + public List getList() { + return list; + } + public void setList(List list) { + this.list = list; + } + + public List getAuthorizedPoliciesCode() { + return authorizedPoliciesCode; + } + public void setAuthorizedPoliciesCode(List authorizedPoliciesCode) { + this.authorizedPoliciesCode = authorizedPoliciesCode; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/TenantCooperatorSingleRespDto.java b/src/main/java/cn/authing/sdk/java/dto/TenantCooperatorSingleRespDto.java new file mode 100644 index 00000000..a4a3c841 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/TenantCooperatorSingleRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.TenantCooperatorSingleDto; + +public class TenantCooperatorSingleRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private TenantCooperatorSingleDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public TenantCooperatorSingleDto getData() { + return data; + } + public void setData(TenantCooperatorSingleDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/TenantDto.java b/src/main/java/cn/authing/sdk/java/dto/TenantDto.java new file mode 100644 index 00000000..8999b112 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/TenantDto.java @@ -0,0 +1,119 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class TenantDto { + /** + * 租户 ID + */ + @JsonProperty("tenantId") + private String tenantId; + /** + * 用户池 ID + */ + @JsonProperty("userPoolId") + private String userPoolId; + /** + * 租户名 + */ + @JsonProperty("name") + private String name; + /** + * 租户描述 + */ + @JsonProperty("description") + private String description; + /** + * 租户 logo + */ + @JsonProperty("logo") + private List logo; + /** + * 用户被租户拒绝登录时显示的提示文案 + */ + @JsonProperty("rejectHint") + private String rejectHint; + /** + * 租户关联的应用 ID + */ + @JsonProperty("appIds") + private List appIds; + /** + * 创建者用户的 ID + */ + @JsonProperty("creator") + private String creator; + /** + * 租户来源的应用 ID,该值不存在时代表租户来源为 Authing 控制台 + */ + @JsonProperty("sourceAppId") + private String sourceAppId; + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getUserPoolId() { + return userPoolId; + } + public void setUserPoolId(String userPoolId) { + this.userPoolId = userPoolId; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + public List getLogo() { + return logo; + } + public void setLogo(List logo) { + this.logo = logo; + } + + public String getRejectHint() { + return rejectHint; + } + public void setRejectHint(String rejectHint) { + this.rejectHint = rejectHint; + } + + public List getAppIds() { + return appIds; + } + public void setAppIds(List appIds) { + this.appIds = appIds; + } + + public String getCreator() { + return creator; + } + public void setCreator(String creator) { + this.creator = creator; + } + + public String getSourceAppId() { + return sourceAppId; + } + public void setSourceAppId(String sourceAppId) { + this.sourceAppId = sourceAppId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/TenantListPaginatedRespDto.java b/src/main/java/cn/authing/sdk/java/dto/TenantListPaginatedRespDto.java new file mode 100644 index 00000000..5cfdd74f --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/TenantListPaginatedRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.TenantListPagingDto; + +public class TenantListPaginatedRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 数据 + */ + @JsonProperty("data") + private TenantListPagingDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public TenantListPagingDto getData() { + return data; + } + public void setData(TenantListPagingDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/TenantListPagingDto.java b/src/main/java/cn/authing/sdk/java/dto/TenantListPagingDto.java new file mode 100644 index 00000000..64bd215f --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/TenantListPagingDto.java @@ -0,0 +1,36 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.TenantRespDto; + +public class TenantListPagingDto { + /** + * 记录总数 + */ + @JsonProperty("totalCount") + private Integer totalCount; + /** + * 响应数据 + */ + @JsonProperty("list") + private List list; + + public Integer getTotalCount() { + return totalCount; + } + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public List getList() { + return list; + } + public void setList(List list) { + this.list = list; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/TenantRespDto.java b/src/main/java/cn/authing/sdk/java/dto/TenantRespDto.java new file mode 100644 index 00000000..548fabed --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/TenantRespDto.java @@ -0,0 +1,143 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class TenantRespDto { + /** + * 租户 ID + */ + @JsonProperty("tenantId") + private String tenantId; + /** + * 用户池 ID + */ + @JsonProperty("userPoolId") + private String userPoolId; + /** + * 租户名 + */ + @JsonProperty("name") + private String name; + /** + * 租户描述 + */ + @JsonProperty("description") + private String description; + /** + * 租户 logo + */ + @JsonProperty("logo") + private List logo; + /** + * 用户被租户拒绝登录时显示的提示文案 + */ + @JsonProperty("rejectHint") + private String rejectHint; + /** + * 租户关联的应用 ID + */ + @JsonProperty("appIds") + private List appIds; + /** + * 创建者用户的 ID + */ + @JsonProperty("creator") + private String creator; + /** + * 租户来源的应用 ID,该值不存在时代表租户来源为 Authing 控制台 + */ + @JsonProperty("sourceAppId") + private String sourceAppId; + /** + * 创建者基本信息 + */ + @JsonProperty("creatorDetail") + private Object creatorDetail; + /** + * 来源 app 基本信息 + */ + @JsonProperty("sourceAppDetail") + private Object sourceAppDetail; + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getUserPoolId() { + return userPoolId; + } + public void setUserPoolId(String userPoolId) { + this.userPoolId = userPoolId; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + public List getLogo() { + return logo; + } + public void setLogo(List logo) { + this.logo = logo; + } + + public String getRejectHint() { + return rejectHint; + } + public void setRejectHint(String rejectHint) { + this.rejectHint = rejectHint; + } + + public List getAppIds() { + return appIds; + } + public void setAppIds(List appIds) { + this.appIds = appIds; + } + + public String getCreator() { + return creator; + } + public void setCreator(String creator) { + this.creator = creator; + } + + public String getSourceAppId() { + return sourceAppId; + } + public void setSourceAppId(String sourceAppId) { + this.sourceAppId = sourceAppId; + } + + public Object getCreatorDetail() { + return creatorDetail; + } + public void setCreatorDetail(Object creatorDetail) { + this.creatorDetail = creatorDetail; + } + + public Object getSourceAppDetail() { + return sourceAppDetail; + } + public void setSourceAppDetail(Object sourceAppDetail) { + this.sourceAppDetail = sourceAppDetail; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/TenantSingleRespDto.java b/src/main/java/cn/authing/sdk/java/dto/TenantSingleRespDto.java new file mode 100644 index 00000000..86e7570f --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/TenantSingleRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.TenantRespDto; + +public class TenantSingleRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private TenantRespDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public TenantRespDto getData() { + return data; + } + public void setData(TenantRespDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/TenantUserDto.java b/src/main/java/cn/authing/sdk/java/dto/TenantUserDto.java new file mode 100644 index 00000000..5c83fceb --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/TenantUserDto.java @@ -0,0 +1,393 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class TenantUserDto { + /** + * 邮箱,不区分大小写 + */ + @JsonProperty("email") + private String email; + /** + * 手机号,不带区号。如果是国外手机号,请在 phoneCountryCode 参数中指定区号。 + */ + @JsonProperty("phone") + private String phone; + /** + * 手机区号,中国大陆手机号可不填。Authing 短信服务暂不内置支持国际手机号,你需要在 Authing 控制台配置对应的国际短信服务。完整的手机区号列表可参阅 https://en.wikipedia.org/wiki/List_of_country_calling_codes。 + */ + @JsonProperty("phoneCountryCode") + private String phoneCountryCode; + /** + * 用户名,用户池内唯一 + */ + @JsonProperty("username") + private String username; + /** + * 用户真实名称,不具备唯一性 + */ + @JsonProperty("name") + private String name; + /** + * 昵称 + */ + @JsonProperty("nickname") + private String nickname; + /** + * 头像链接 + */ + @JsonProperty("photo") + private String photo; + /** + * 历史总登录次数 + */ + @JsonProperty("loginsCount") + private Integer loginsCount; + /** + * 上次登录 IP + */ + @JsonProperty("lastIp") + private String lastIp; + /** + * 性别: + * - `M`: 男性,`male` + * - `F`: 女性,`female` + * - `U`: 未知,`unknown` + * + */ + @JsonProperty("gender") + private Gender gender; + /** + * 出生日期 + */ + @JsonProperty("birthdate") + private String birthdate; + /** + * 所在国家 + */ + @JsonProperty("country") + private String country; + /** + * 所在省份 + */ + @JsonProperty("province") + private String province; + /** + * 所在城市 + */ + @JsonProperty("city") + private String city; + /** + * 所处地址 + */ + @JsonProperty("address") + private String address; + /** + * 所处街道地址 + */ + @JsonProperty("streetAddress") + private String streetAddress; + /** + * 邮政编码号 + */ + @JsonProperty("postalCode") + private String postalCode; + /** + * 名 + */ + @JsonProperty("givenName") + private String givenName; + /** + * 姓 + */ + @JsonProperty("familyName") + private String familyName; + /** + * 中间名 + */ + @JsonProperty("middleName") + private String middleName; + /** + * Preferred Username + */ + @JsonProperty("preferredUsername") + private String preferredUsername; + /** + * 用户上次登录的应用 ID + */ + @JsonProperty("lastLoginApp") + private String lastLoginApp; + /** + * 用户池 ID + */ + @JsonProperty("userPoolId") + private String userPoolId; + /** + * 租户 ID + */ + @JsonProperty("tenantId") + private String tenantId; + /** + * 租户成员 ID + */ + @JsonProperty("memberId") + private String memberId; + /** + * 关联的用户池级别的用户 ID + */ + @JsonProperty("linkUserId") + private String linkUserId; + /** + * 是否为租户管理员 + */ + @JsonProperty("isTenantAdmin") + private Boolean isTenantAdmin; + /** + * 用户密码。我们使用 HTTPS 协议对密码进行安全传输,可以在一定程度上保证安全性。如果你还需要更高级别的安全性,我们还支持 RSA256 和国密 SM2 两种方式对密码进行加密。详情见 `passwordEncryptType` 参数。 + */ + @JsonProperty("password") + private String password; + /** + * 加密用户密码的盐 + */ + @JsonProperty("salt") + private String salt; + + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + public String getPhone() { + return phone; + } + public void setPhone(String phone) { + this.phone = phone; + } + + public String getPhoneCountryCode() { + return phoneCountryCode; + } + public void setPhoneCountryCode(String phoneCountryCode) { + this.phoneCountryCode = phoneCountryCode; + } + + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public String getNickname() { + return nickname; + } + public void setNickname(String nickname) { + this.nickname = nickname; + } + + public String getPhoto() { + return photo; + } + public void setPhoto(String photo) { + this.photo = photo; + } + + public Integer getLoginsCount() { + return loginsCount; + } + public void setLoginsCount(Integer loginsCount) { + this.loginsCount = loginsCount; + } + + public String getLastIp() { + return lastIp; + } + public void setLastIp(String lastIp) { + this.lastIp = lastIp; + } + + public Gender getGender() { + return gender; + } + public void setGender(Gender gender) { + this.gender = gender; + } + + public String getBirthdate() { + return birthdate; + } + public void setBirthdate(String birthdate) { + this.birthdate = birthdate; + } + + public String getCountry() { + return country; + } + public void setCountry(String country) { + this.country = country; + } + + public String getProvince() { + return province; + } + public void setProvince(String province) { + this.province = province; + } + + public String getCity() { + return city; + } + public void setCity(String city) { + this.city = city; + } + + public String getAddress() { + return address; + } + public void setAddress(String address) { + this.address = address; + } + + public String getStreetAddress() { + return streetAddress; + } + public void setStreetAddress(String streetAddress) { + this.streetAddress = streetAddress; + } + + public String getPostalCode() { + return postalCode; + } + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + + public String getGivenName() { + return givenName; + } + public void setGivenName(String givenName) { + this.givenName = givenName; + } + + public String getFamilyName() { + return familyName; + } + public void setFamilyName(String familyName) { + this.familyName = familyName; + } + + public String getMiddleName() { + return middleName; + } + public void setMiddleName(String middleName) { + this.middleName = middleName; + } + + public String getPreferredUsername() { + return preferredUsername; + } + public void setPreferredUsername(String preferredUsername) { + this.preferredUsername = preferredUsername; + } + + public String getLastLoginApp() { + return lastLoginApp; + } + public void setLastLoginApp(String lastLoginApp) { + this.lastLoginApp = lastLoginApp; + } + + public String getUserPoolId() { + return userPoolId; + } + public void setUserPoolId(String userPoolId) { + this.userPoolId = userPoolId; + } + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getMemberId() { + return memberId; + } + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + public String getLinkUserId() { + return linkUserId; + } + public void setLinkUserId(String linkUserId) { + this.linkUserId = linkUserId; + } + + public Boolean getIsTenantAdmin() { + return isTenantAdmin; + } + public void setIsTenantAdmin(Boolean isTenantAdmin) { + this.isTenantAdmin = isTenantAdmin; + } + + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + public String getSalt() { + return salt; + } + public void setSalt(String salt) { + this.salt = salt; + } + + + /** + * 性别: + * - `M`: 男性,`male` + * - `F`: 女性,`female` + * - `U`: 未知,`unknown` + * + */ + public static enum Gender { + + @JsonProperty("M") + M("M"), + + @JsonProperty("F") + F("F"), + + @JsonProperty("U") + U("U"), + ; + + private String value; + + Gender(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + } + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/TenantUserListPaginatedRespDto.java b/src/main/java/cn/authing/sdk/java/dto/TenantUserListPaginatedRespDto.java new file mode 100644 index 00000000..ff017608 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/TenantUserListPaginatedRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.TenantUserListPagingDto; + +public class TenantUserListPaginatedRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private TenantUserListPagingDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public TenantUserListPagingDto getData() { + return data; + } + public void setData(TenantUserListPagingDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/TenantUserListPagingDto.java b/src/main/java/cn/authing/sdk/java/dto/TenantUserListPagingDto.java new file mode 100644 index 00000000..84d84ab6 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/TenantUserListPagingDto.java @@ -0,0 +1,36 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.TenantUserDto; + +public class TenantUserListPagingDto { + /** + * 记录总数 + */ + @JsonProperty("totalCount") + private Integer totalCount; + /** + * 响应数据 + */ + @JsonProperty("list") + private List list; + + public Integer getTotalCount() { + return totalCount; + } + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + public List getList() { + return list; + } + public void setList(List list) { + this.list = list; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/TenantUserSingleRespDto.java b/src/main/java/cn/authing/sdk/java/dto/TenantUserSingleRespDto.java new file mode 100644 index 00000000..7e391a38 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/TenantUserSingleRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.TenantUserDto; + +public class TenantUserSingleRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private TenantUserDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public TenantUserDto getData() { + return data; + } + public void setData(TenantUserDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/UpdateDepartmentReqDto.java b/src/main/java/cn/authing/sdk/java/dto/UpdateDepartmentReqDto.java index f18ead31..432aa235 100644 --- a/src/main/java/cn/authing/sdk/java/dto/UpdateDepartmentReqDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/UpdateDepartmentReqDto.java @@ -56,6 +56,11 @@ public class UpdateDepartmentReqDto { */ @JsonProperty("customData") private Object customData; + /** + * 岗位 id 列表 + */ + @JsonProperty("postIdList") + private String postIdList; /** * 租户 ID */ @@ -132,6 +137,13 @@ public void setCustomData(Object customData) { this.customData = customData; } + public String getPostIdList() { + return postIdList; + } + public void setPostIdList(String postIdList) { + this.postIdList = postIdList; + } + public String getTenantId() { return tenantId; } diff --git a/src/main/java/cn/authing/sdk/java/dto/UpdateMultipleTenantAdminDto.java b/src/main/java/cn/authing/sdk/java/dto/UpdateMultipleTenantAdminDto.java new file mode 100644 index 00000000..f81aa3a6 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/UpdateMultipleTenantAdminDto.java @@ -0,0 +1,35 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class UpdateMultipleTenantAdminDto { + /** + * 租户 ID + */ + @JsonProperty("tenantIds") + private List tenantIds; + /** + * 是否授权 + */ + @JsonProperty("apiAuthorized") + private Boolean apiAuthorized; + + public List getTenantIds() { + return tenantIds; + } + public void setTenantIds(List tenantIds) { + this.tenantIds = tenantIds; + } + + public Boolean getApiAuthorized() { + return apiAuthorized; + } + public void setApiAuthorized(Boolean apiAuthorized) { + this.apiAuthorized = apiAuthorized; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/UpdateOrganizationReqDto.java b/src/main/java/cn/authing/sdk/java/dto/UpdateOrganizationReqDto.java index a5f663fc..19a6a1e2 100644 --- a/src/main/java/cn/authing/sdk/java/dto/UpdateOrganizationReqDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/UpdateOrganizationReqDto.java @@ -46,6 +46,11 @@ public class UpdateOrganizationReqDto { */ @JsonProperty("organizationName") private String organizationName; + /** + * 岗位 id 列表 + */ + @JsonProperty("postIdList") + private String postIdList; public String getOrganizationCode() { return organizationCode; @@ -103,6 +108,13 @@ public void setOrganizationName(String organizationName) { this.organizationName = organizationName; } + public String getPostIdList() { + return postIdList; + } + public void setPostIdList(String postIdList) { + this.postIdList = postIdList; + } + } \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/UpdateTenantCooperatorDto.java b/src/main/java/cn/authing/sdk/java/dto/UpdateTenantCooperatorDto.java new file mode 100644 index 00000000..d039d2ba --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/UpdateTenantCooperatorDto.java @@ -0,0 +1,35 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class UpdateTenantCooperatorDto { + /** + * 是否授权 API + */ + @JsonProperty("apiAuthorized") + private Boolean apiAuthorized; + /** + * 策略 + */ + @JsonProperty("policies") + private List policies; + + public Boolean getApiAuthorized() { + return apiAuthorized; + } + public void setApiAuthorized(Boolean apiAuthorized) { + this.apiAuthorized = apiAuthorized; + } + + public List getPolicies() { + return policies; + } + public void setPolicies(List policies) { + this.policies = policies; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/UpdateTenantDto.java b/src/main/java/cn/authing/sdk/java/dto/UpdateTenantDto.java new file mode 100644 index 00000000..2e49f723 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/UpdateTenantDto.java @@ -0,0 +1,95 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class UpdateTenantDto { + /** + * 租户 ID + */ + @JsonProperty("tenantId") + private String tenantId; + /** + * 租户名 + */ + @JsonProperty("name") + private String name; + /** + * 租户关联的应用 ID + */ + @JsonProperty("appIds") + private List appIds; + /** + * 租户 logo + */ + @JsonProperty("logo") + private List logo; + /** + * 租户描述 + */ + @JsonProperty("description") + private String description; + /** + * 用户被租户拒绝登录时显示的提示文案 + */ + @JsonProperty("rejectHint") + private String rejectHint; + /** + * 租户来源的应用 ID,该值不存在时代表租户来源为 Authing 控制台 + */ + @JsonProperty("sourceAppId") + private String sourceAppId; + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public List getAppIds() { + return appIds; + } + public void setAppIds(List appIds) { + this.appIds = appIds; + } + + public List getLogo() { + return logo; + } + public void setLogo(List logo) { + this.logo = logo; + } + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + public String getRejectHint() { + return rejectHint; + } + public void setRejectHint(String rejectHint) { + this.rejectHint = rejectHint; + } + + public String getSourceAppId() { + return sourceAppId; + } + public void setSourceAppId(String sourceAppId) { + this.sourceAppId = sourceAppId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/UpdateTenantUserDto.java b/src/main/java/cn/authing/sdk/java/dto/UpdateTenantUserDto.java new file mode 100644 index 00000000..ed978dfe --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/UpdateTenantUserDto.java @@ -0,0 +1,59 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class UpdateTenantUserDto { + /** + * 要更新的租户成员信息 + */ + @JsonProperty("updates") + private Object updates; + /** + * 租户 ID + */ + @JsonProperty("tenantId") + private String tenantId; + /** + * 关联的用户池级别的用户 ID + */ + @JsonProperty("linkUserId") + private String linkUserId; + /** + * 租户成员 ID + */ + @JsonProperty("memberId") + private String memberId; + + public Object getUpdates() { + return updates; + } + public void setUpdates(Object updates) { + this.updates = updates; + } + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getLinkUserId() { + return linkUserId; + } + public void setLinkUserId(String linkUserId) { + this.linkUserId = linkUserId; + } + + public String getMemberId() { + return memberId; + } + public void setMemberId(String memberId) { + this.memberId = memberId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/UserConnectionPostDto.java b/src/main/java/cn/authing/sdk/java/dto/UserConnectionPostDto.java new file mode 100644 index 00000000..70a71fe2 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/UserConnectionPostDto.java @@ -0,0 +1,35 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class UserConnectionPostDto { + /** + * 用户 id + */ + @JsonProperty("userId") + private String userId; + /** + * 部门 id + */ + @JsonProperty("postId") + private String postId; + + public String getUserId() { + return userId; + } + public void setUserId(String userId) { + this.userId = userId; + } + + public String getPostId() { + return postId; + } + public void setPostId(String postId) { + this.postId = postId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/UserDto.java b/src/main/java/cn/authing/sdk/java/dto/UserDto.java index d988559b..80dca25d 100644 --- a/src/main/java/cn/authing/sdk/java/dto/UserDto.java +++ b/src/main/java/cn/authing/sdk/java/dto/UserDto.java @@ -250,6 +250,11 @@ public class UserDto { */ @JsonProperty("resetPasswordOnNextLogin") private Boolean resetPasswordOnNextLogin; + /** + * 注册方式 + */ + @JsonProperty("registerSource") + private List registerSource; /** * 用户所属部门 ID 列表 */ @@ -605,6 +610,13 @@ public void setResetPasswordOnNextLogin(Boolean resetPasswordOnNextLogin) { this.resetPasswordOnNextLogin = resetPasswordOnNextLogin; } + public List getRegisterSource() { + return registerSource; + } + public void setRegisterSource(List registerSource) { + this.registerSource = registerSource; + } + public List getDepartmentIds() { return departmentIds; } diff --git a/src/main/java/cn/authing/sdk/java/dto/VerifyAuthenticationDto.java b/src/main/java/cn/authing/sdk/java/dto/VerifyAuthenticationDto.java new file mode 100644 index 00000000..5e20a50f --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/VerifyAuthenticationDto.java @@ -0,0 +1,49 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.AuthenticationCredentialDto; +import cn.authing.sdk.java.dto.SignInByWebAuthnOptionsDto; + +public class VerifyAuthenticationDto { + /** + * 从 获取 WebAuthn 认证请求初始化参数接口 获得的 ticket + */ + @JsonProperty("ticket") + private String ticket; + /** + * 认证器凭证信息 + */ + @JsonProperty("authenticationCredential") + private AuthenticationCredentialDto authenticationCredential; + /** + * 可选参数 + */ + @JsonProperty("options") + private SignInByWebAuthnOptionsDto options; + + public String getTicket() { + return ticket; + } + public void setTicket(String ticket) { + this.ticket = ticket; + } + + public AuthenticationCredentialDto getAuthenticationCredential() { + return authenticationCredential; + } + public void setAuthenticationCredential(AuthenticationCredentialDto authenticationCredential) { + this.authenticationCredential = authenticationCredential; + } + + public SignInByWebAuthnOptionsDto getOptions() { + return options; + } + public void setOptions(SignInByWebAuthnOptionsDto options) { + this.options = options; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/VerifyAuthenticationResultDto.java b/src/main/java/cn/authing/sdk/java/dto/VerifyAuthenticationResultDto.java new file mode 100644 index 00000000..da11ea66 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/VerifyAuthenticationResultDto.java @@ -0,0 +1,36 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.LoginTokenResponseDataDto; + +public class VerifyAuthenticationResultDto { + /** + * 验证认证器登录认证的结果,true 验证成功 + */ + @JsonProperty("verified") + private Boolean verified; + /** + * 验证认证器登录认证通过时,即 verified = true,此数据才会返回。 + */ + @JsonProperty("tokenSet") + private LoginTokenResponseDataDto tokenSet; + + public Boolean getVerified() { + return verified; + } + public void setVerified(Boolean verified) { + this.verified = verified; + } + + public LoginTokenResponseDataDto getTokenSet() { + return tokenSet; + } + public void setTokenSet(LoginTokenResponseDataDto tokenSet) { + this.tokenSet = tokenSet; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/VerifyAuthenticationResultRespDto.java b/src/main/java/cn/authing/sdk/java/dto/VerifyAuthenticationResultRespDto.java new file mode 100644 index 00000000..7d1816c2 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/VerifyAuthenticationResultRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.VerifyAuthenticationResultDto; + +public class VerifyAuthenticationResultRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private VerifyAuthenticationResultDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public VerifyAuthenticationResultDto getData() { + return data; + } + public void setData(VerifyAuthenticationResultDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/VerifyRegistrationDto.java b/src/main/java/cn/authing/sdk/java/dto/VerifyRegistrationDto.java new file mode 100644 index 00000000..1b5b81ad --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/VerifyRegistrationDto.java @@ -0,0 +1,80 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.RegistrationCredentialDto; + +public class VerifyRegistrationDto { + /** + * 获取凭证创建初始化参数时的 ticket + */ + @JsonProperty("ticket") + private String ticket; + /** + * 绑定认证器凭证信息 + */ + @JsonProperty("registrationCredential") + private RegistrationCredentialDto registrationCredential; + /** + * 凭证信息类型: + * - `FINGERPRINT`: 指纹 + * - `FACE`: 人脸 + * - `OTHER` 其他 + */ + @JsonProperty("authenticatorCode") + private AuthenticatorCode authenticatorCode; + + public String getTicket() { + return ticket; + } + public void setTicket(String ticket) { + this.ticket = ticket; + } + + public RegistrationCredentialDto getRegistrationCredential() { + return registrationCredential; + } + public void setRegistrationCredential(RegistrationCredentialDto registrationCredential) { + this.registrationCredential = registrationCredential; + } + + public AuthenticatorCode getAuthenticatorCode() { + return authenticatorCode; + } + public void setAuthenticatorCode(AuthenticatorCode authenticatorCode) { + this.authenticatorCode = authenticatorCode; + } + + + /** + * 凭证信息类型: + * - `FINGERPRINT`: 指纹 + * - `FACE`: 人脸 + * - `OTHER` 其他 + */ + public static enum AuthenticatorCode { + + @JsonProperty("fingerprint") + FINGERPRINT("fingerprint"), + + @JsonProperty("face") + FACE("face"), + + @JsonProperty("other") + OTHER("other"), + ; + + private String value; + + AuthenticatorCode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + } + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/VerifyRegistrationResultDto.java b/src/main/java/cn/authing/sdk/java/dto/VerifyRegistrationResultDto.java new file mode 100644 index 00000000..f66114b5 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/VerifyRegistrationResultDto.java @@ -0,0 +1,23 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class VerifyRegistrationResultDto { + /** + * 验证注册认证器结果 + */ + @JsonProperty("verified") + private Boolean verified; + + public Boolean getVerified() { + return verified; + } + public void setVerified(Boolean verified) { + this.verified = verified; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/VerifyRegistrationResultRespDto.java b/src/main/java/cn/authing/sdk/java/dto/VerifyRegistrationResultRespDto.java new file mode 100644 index 00000000..48ccb84b --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/VerifyRegistrationResultRespDto.java @@ -0,0 +1,72 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.VerifyRegistrationResultDto; + +public class VerifyRegistrationResultRespDto { + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 请求 ID。当请求失败时会返回。 + */ + @JsonProperty("requestId") + private String requestId; + /** + * 响应数据 + */ + @JsonProperty("data") + private VerifyRegistrationResultDto data; + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getRequestId() { + return requestId; + } + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public VerifyRegistrationResultDto getData() { + return data; + } + public void setData(VerifyRegistrationResultDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/WechatIdentityResolveRespDataDto.java b/src/main/java/cn/authing/sdk/java/dto/WechatIdentityResolveRespDataDto.java new file mode 100644 index 00000000..7f35e189 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/WechatIdentityResolveRespDataDto.java @@ -0,0 +1,47 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class WechatIdentityResolveRespDataDto { + /** + * 可选的账号绑定方式。 + */ + @JsonProperty("methods") + private List methods; + /** + * 可选的账号列表。 + */ + @JsonProperty("accounts") + private List accounts; + /** + * 认证中间态。 + */ + @JsonProperty("key") + private String key; + + public List getMethods() { + return methods; + } + public void setMethods(List methods) { + this.methods = methods; + } + + public List getAccounts() { + return accounts; + } + public void setAccounts(List accounts) { + this.accounts = accounts; + } + + public String getKey() { + return key; + } + public void setKey(String key) { + this.key = key; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/WechatIdentityResolveRespDto.java b/src/main/java/cn/authing/sdk/java/dto/WechatIdentityResolveRespDto.java new file mode 100644 index 00000000..5fd4e6a4 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/WechatIdentityResolveRespDto.java @@ -0,0 +1,84 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.WechatIdentityResolveRespDataDto; + +public class WechatIdentityResolveRespDto { + /** + * 异常 ID:需要中间操作才能完成登录。 + */ + @JsonProperty("uniqueId") + private String uniqueId; + /** + * (仅用于兼容旧版代码)细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("code") + private Integer code; + /** + * 业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。 + */ + @JsonProperty("statusCode") + private Integer statusCode; + /** + * 细分错误码,可通过此错误码得到具体的错误类型。 + */ + @JsonProperty("apiCode") + private Integer apiCode; + /** + * 描述信息 + */ + @JsonProperty("message") + private String message; + /** + * 响应数据 + */ + @JsonProperty("data") + private WechatIdentityResolveRespDataDto data; + + public String getUniqueId() { + return uniqueId; + } + public void setUniqueId(String uniqueId) { + this.uniqueId = uniqueId; + } + + public Integer getCode() { + return code; + } + public void setCode(Integer code) { + this.code = code; + } + + public Integer getStatusCode() { + return statusCode; + } + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public Integer getApiCode() { + return apiCode; + } + public void setApiCode(Integer apiCode) { + this.apiCode = apiCode; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public WechatIdentityResolveRespDataDto getData() { + return data; + } + public void setData(WechatIdentityResolveRespDataDto data) { + this.data = data; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/WechatLoginTokenRespDto.java b/src/main/java/cn/authing/sdk/java/dto/WechatLoginTokenRespDto.java new file mode 100644 index 00000000..770fca49 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/WechatLoginTokenRespDto.java @@ -0,0 +1,83 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class WechatLoginTokenRespDto { + /** + * 接口调用凭据,在限制时间内被授权访问资源 API + */ + @JsonProperty("access_token") + private String accessToken; + /** + * 用户的身份凭证,解析后会包含用户信息 + */ + @JsonProperty("id_token") + private String idToken; + /** + * refresh_token 用于获取新的 AccessToken + */ + @JsonProperty("refresh_token") + private String refreshToken; + /** + * token 类型 + */ + @JsonProperty("token_type") + private String tokenType; + /** + * 过期时间 单位是秒 + */ + @JsonProperty("expire_in") + private Integer expireIn; + /** + * 登录请求中的 scope + */ + @JsonProperty("scope") + private String scope; + + public String getAccessToken() { + return accessToken; + } + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + public String getIdToken() { + return idToken; + } + public void setIdToken(String idToken) { + this.idToken = idToken; + } + + public String getRefreshToken() { + return refreshToken; + } + public void setRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + } + + public String getTokenType() { + return tokenType; + } + public void setTokenType(String tokenType) { + this.tokenType = tokenType; + } + + public Integer getExpireIn() { + return expireIn; + } + public void setExpireIn(Integer expireIn) { + this.expireIn = expireIn; + } + + public String getScope() { + return scope; + } + public void setScope(String scope) { + this.scope = scope; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/WechatMobileAuthByCodeIdentityInput.java b/src/main/java/cn/authing/sdk/java/dto/WechatMobileAuthByCodeIdentityInput.java new file mode 100644 index 00000000..08b5414d --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/WechatMobileAuthByCodeIdentityInput.java @@ -0,0 +1,60 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +import cn.authing.sdk.java.dto.SignInOptionsDto; + +public class WechatMobileAuthByCodeIdentityInput { + /** + * 客户端微信授权成功,微信返回当前认证授权码 + */ + @JsonProperty("code") + private String code; + /** + * 应用 ID + */ + @JsonProperty("appId") + private String appId; + /** + * 身份源连接 ID + */ + @JsonProperty("connId") + private String connId; + /** + * 登录参数 + */ + @JsonProperty("options") + private SignInOptionsDto options; + + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + + public String getAppId() { + return appId; + } + public void setAppId(String appId) { + this.appId = appId; + } + + public String getConnId() { + return connId; + } + public void setConnId(String connId) { + this.connId = connId; + } + + public SignInOptionsDto getOptions() { + return options; + } + public void setOptions(SignInOptionsDto options) { + this.options = options; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/WechatMobileAuthByCodeInput.java b/src/main/java/cn/authing/sdk/java/dto/WechatMobileAuthByCodeInput.java new file mode 100644 index 00000000..b8a8ce86 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/WechatMobileAuthByCodeInput.java @@ -0,0 +1,47 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class WechatMobileAuthByCodeInput { + /** + * 客户端微信授权成功,微信返回当前认证授权码 + */ + @JsonProperty("code") + private String code; + /** + * 应用 ID + */ + @JsonProperty("appId") + private String appId; + /** + * 身份源连接 ID + */ + @JsonProperty("connId") + private String connId; + + public String getCode() { + return code; + } + public void setCode(String code) { + this.code = code; + } + + public String getAppId() { + return appId; + } + public void setAppId(String appId) { + this.appId = appId; + } + + public String getConnId() { + return connId; + } + public void setConnId(String connId) { + this.connId = connId; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/errorEmailMsg.java b/src/main/java/cn/authing/sdk/java/dto/errorEmailMsg.java new file mode 100644 index 00000000..4acd2281 --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/errorEmailMsg.java @@ -0,0 +1,35 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class errorEmailMsg { + /** + * 邮箱地址 + */ + @JsonProperty("email") + private String email; + /** + * 错误信息描述 + */ + @JsonProperty("message") + private String message; + + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + + +} \ No newline at end of file diff --git a/src/main/java/cn/authing/sdk/java/dto/sendInviteTenantUserEmailDto.java b/src/main/java/cn/authing/sdk/java/dto/sendInviteTenantUserEmailDto.java new file mode 100644 index 00000000..8a3a7add --- /dev/null +++ b/src/main/java/cn/authing/sdk/java/dto/sendInviteTenantUserEmailDto.java @@ -0,0 +1,11 @@ +package cn.authing.sdk.java.dto; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class sendInviteTenantUserEmailDto { + + + +} \ No newline at end of file From 0b29201c26330b7ef06ec68da8f5966dbebc80a1 Mon Sep 17 00:00:00 2001 From: yujiale Date: Tue, 14 Mar 2023 15:27:05 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat=EF=BC=9Aupdate=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5d5a693a..31d9203b 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ cn.authing authing-java-sdk - 3.0.12 + 3.0.13 Authing Java SDK java backend sdk for authing