Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Introduce new remote user store implementation #7099

Merged
merged 35 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
82b991e
[feat] introduce new remote user store impl
JayaShakthi97 Nov 7, 2024
00e1300
[feat] introduce new remote user store impl - fix import paths
JayaShakthi97 Nov 7, 2024
7836433
[feat] introduce new remote user store impl - complete creation flow
JayaShakthi97 Nov 9, 2024
f850d50
[feat] introduce new remote user store impl - add i18n translations
JayaShakthi97 Nov 9, 2024
892f3bc
[feat] introduce new remote user store impl - fix lint issues
JayaShakthi97 Nov 9, 2024
a56efc3
[feat] introduce new remote user store impl - update endpoint configs
JayaShakthi97 Nov 19, 2024
8dacd48
[feat] introduce new remote user store impl - update setup guide
JayaShakthi97 Nov 19, 2024
ceee0c2
[feat] introduce new remote user store impl - update agent connection…
JayaShakthi97 Nov 20, 2024
ae800bb
[feat] introduce new remote user store impl - update attribute mappin…
JayaShakthi97 Nov 24, 2024
813c902
[feat] introduce new remote user store impl - disable RemoteUserStore…
JayaShakthi97 Nov 25, 2024
6e5d20f
[feat] introduce new remote user store impl - cleanup
JayaShakthi97 Nov 25, 2024
372bd9f
[feat] introduce new remote user store impl - fix import issue
JayaShakthi97 Nov 25, 2024
b19c34d
[feat] introduce new remote user store impl - revert unnecessary changes
JayaShakthi97 Nov 25, 2024
6fac1c5
Add changeset 🦋
JayaShakthi97 Nov 25, 2024
738a561
[feat] introduce new remote user store impl - minor improvements
JayaShakthi97 Nov 26, 2024
9ba874c
[feat] introduce new remote user store impl - minor fixes
JayaShakthi97 Nov 27, 2024
9795afe
[feat] introduce new remote user store impl - formatting fix
JayaShakthi97 Nov 27, 2024
2a39913
[feat] introduce new remote user store impl - fix formatting
JayaShakthi97 Nov 27, 2024
5c75552
[feat] introduce new remote user store impl - fix mis-wording
JayaShakthi97 Nov 27, 2024
5de903b
Update modules/i18n/src/translations/en-US/portals/remote-user-stores.ts
JayaShakthi97 Nov 28, 2024
934ba87
Update modules/i18n/src/translations/en-US/portals/remote-user-stores.ts
JayaShakthi97 Nov 28, 2024
9362ce6
Update modules/i18n/src/translations/en-US/portals/remote-user-stores.ts
JayaShakthi97 Nov 28, 2024
0252d3f
Update modules/i18n/src/translations/en-US/portals/remote-user-stores.ts
JayaShakthi97 Nov 28, 2024
9172243
Update modules/i18n/src/translations/en-US/portals/remote-user-stores.ts
JayaShakthi97 Nov 28, 2024
3e5f9c3
Update modules/i18n/src/translations/en-US/portals/remote-user-stores.ts
JayaShakthi97 Nov 28, 2024
eefb94e
Update features/admin.remote-userstores.v1/components/edit/setup-guid…
JayaShakthi97 Nov 28, 2024
1ef2e8c
Update features/admin.remote-userstores.v1/constants/ui-constants.ts
JayaShakthi97 Nov 28, 2024
263379a
Update features/admin.remote-userstores.v1/api/use-get-user-store-age…
JayaShakthi97 Nov 28, 2024
9c343ec
Update features/admin.remote-userstores.v1/pages/remote-user-store-cr…
JayaShakthi97 Nov 28, 2024
4504f3e
[feat] introduce new remote user store impl - address review comments
JayaShakthi97 Nov 28, 2024
9bc4155
Add changeset 🦋
JayaShakthi97 Nov 28, 2024
9f634a4
[feat] introduce new remote user store impl - add missing license hea…
JayaShakthi97 Nov 28, 2024
6c13234
Update features/admin.remote-userstores.v1/api/use-get-user-store-age…
JayaShakthi97 Nov 28, 2024
70f200f
[feat] introduce new remote user store impl - address review comments
JayaShakthi97 Nov 28, 2024
b064c1e
[feat] introduce new remote user store impl - fix minor issue
JayaShakthi97 Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/giant-parents-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@wso2is/admin.remote-userstores.v1": minor
"@wso2is/admin.extensions.v1": minor
"@wso2is/admin.userstores.v1": minor
"@wso2is/admin.claims.v1": minor
"@wso2is/admin.groups.v1": minor
"@wso2is/admin.users.v1": minor
"@wso2is/core": minor
"@wso2is/admin.core.v1": patch
"@wso2is/theme": patch
---

Introduce new remote user store implementation
5 changes: 5 additions & 0 deletions .changeset/gorgeous-ducks-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/form": minor
---

Introduce `RadioGroupFieldAdapter` and minor improvements
5 changes: 5 additions & 0 deletions .changeset/lovely-masks-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/i18n": minor
---

Add remote user stores translations
22 changes: 22 additions & 0 deletions apps/console/src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,28 @@ const Theme: OxygenTheme = extendTheme({
fontFamily: "Gilmer, sans-serif"
}
}
},
MuiStepConnector: {
styleOverrides: {
root: {
marginLeft: "16px"
}
}
},
MuiStepContent: {
styleOverrides: {
root: {
marginLeft: "16px"
}
}
},
MuiStepIcon: {
styleOverrides: {
root: {
height: "30px",
width: "30px"
}
}
}
},
customComponents: {
Expand Down
66 changes: 66 additions & 0 deletions features/admin.claims.v1/api/use-get-all-local-claims.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/**
* Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import useRequest, {
RequestConfigInterface,
RequestErrorInterface,
RequestResultInterface
} from "@wso2is/admin.core.v1/hooks/use-request";
import { store } from "@wso2is/admin.core.v1/store";
import { Claim, ClaimsGetParams, HttpMethods } from "@wso2is/core/models";

/**
* Hook to get DataType.
*
* @param shouldFetch - If true, will fetch the data.
*
* @returns local claims list.
*/
const useGetAllLocalClaims = <Data = Claim[], Error = RequestErrorInterface>(
params: ClaimsGetParams,
shouldFetch: boolean = true
): RequestResultInterface<Data, Error> => {

const requestConfig: RequestConfigInterface = {
headers: {
Accept: "application/json",
"Content-Type": "application/json"
},
method: HttpMethods.GET,
params,
url: store.getState().config.endpoints.localClaims
};

const {
data,
error,
isLoading,
isValidating,
mutate
} = useRequest<Data, Error>(shouldFetch ? requestConfig : null);

return {
data,
error,
isLoading,
isValidating,
mutate
};
};

export default useGetAllLocalClaims;
3 changes: 2 additions & 1 deletion features/admin.core.v1/configs/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ export class Config {
I18nConstants.TEMPLATE_CORE_NAMESPACE,
I18nConstants.APPLICATION_TEMPLATES_NAMESPACE,
I18nConstants.ACTIONS_NAMESPACE,
I18nConstants.TENANTS_NAMESPACE
I18nConstants.TENANTS_NAMESPACE,
I18nConstants.REMOTE_USER_STORES_NAMESPACE
],
preload: []
};
Expand Down
8 changes: 7 additions & 1 deletion features/admin.core.v1/constants/i18n-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@ export class I18nConstants {
*/
public static readonly TENANTS_NAMESPACE: string = I18nModuleConstants.TENANTS_NAMESPACE;

/**
* Remote User Stores namespace.
*/
public static readonly REMOTE_USER_STORES_NAMESPACE: string = I18nModuleConstants.REMOTE_USER_STORES_NAMESPACE;

/**
* Locations of the I18n namespaces.
*/
Expand Down Expand Up @@ -321,7 +326,8 @@ export class I18nConstants {
[ I18nConstants.TEMPLATE_CORE_NAMESPACE, "portals" ],
[ I18nConstants.IMPERSONATION_CONFIGURATION_NAMESPACE, "portals" ],
[ I18nConstants.ACTIONS_NAMESPACE, "portals" ],
[ I18nConstants.TENANTS_NAMESPACE, "portals" ]
[ I18nConstants.TENANTS_NAMESPACE, "portals" ],
[ I18nConstants.REMOTE_USER_STORES_NAMESPACE, "portals" ]
]);

/**
Expand Down
14 changes: 13 additions & 1 deletion features/admin.core.v1/hooks/use-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import { AsgardeoSPAClient, HttpClientInstance } from "@asgardeo/auth-react";
import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from "axios";
import useSWR, { SWRConfiguration, SWRResponse } from "swr";
import useSWR, { BareFetcher, Revalidator, RevalidatorOptions, SWRConfiguration, SWRResponse } from "swr";
import { FetcherResponse } from "swr/dist/_internal";

const httpClient: HttpClientInstance = AsgardeoSPAClient.getInstance()
Expand Down Expand Up @@ -97,6 +97,18 @@ export interface SWRConfig<Data = unknown, Error = unknown>
fallbackData?: Data
}

export type BareFetcherInterface = BareFetcher;
JayaShakthi97 marked this conversation as resolved.
Show resolved Hide resolved

/**
* Schema for the revalidator.
*/
export type RevalidatorInterface = Revalidator;

/**
* Schema for the revalidator options.
*/
export type RevalidatorOptionsInterface = RevalidatorOptions;

const globalConfig: SWRConfiguration = {};

const useRequest = <Data = unknown, Error = unknown>(
Expand Down
4 changes: 2 additions & 2 deletions features/admin.extensions.v1/configs/common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import { getSidePanelIcons } from "@wso2is/admin.core.v1/configs/ui";
import { AppConstants } from "@wso2is/admin.core.v1/constants";
import { RemoteUserStoreConstants } from "@wso2is/admin.remote-userstores.v1/constants";
import { RemoteUserStoreConstants } from "@wso2is/admin.remote-userstores.v1/constants/remote-user-stores-constants";
import { RouteInterface } from "@wso2is/core/models";
import { lazy } from "react";
import { CommonConfig } from "./models";
Expand Down Expand Up @@ -66,7 +66,7 @@ export const commonConfig: CommonConfig = {
},
{
component: lazy(() =>
import("@wso2is/admin.remote-userstores.v1/pages/remote-customer-user-store-create-page")
import("@wso2is/admin.remote-userstores.v1/pages/remote-user-store-create-page")
),
icon: {
icon: getSidePanelIcons().childIcon
Expand Down
10 changes: 6 additions & 4 deletions features/admin.extensions.v1/configs/endpoints.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021, WSO2 LLC. (https://www.wso2.com).
* Copyright (c) 2021-2024, WSO2 LLC. (https://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
Expand Down Expand Up @@ -42,12 +42,14 @@ export const getExtendedFeatureResourceEndpoints = (serverHost: string,
inviteEndpoint: `${ serverHost }/api/asgardeo-guest/v1/users/invite`,
inviteLinkEndpoint: "/api/users/v1/offline-invite-link",
notificationSendersEndPoint: `${ serverHost }/api/server/v1/notification-senders`,
onPremUserStoreAgentConnection: `${ serverHost }/api/onprem-userstore/v1/connection`,
JayaShakthi97 marked this conversation as resolved.
Show resolved Hide resolved
onPremUserStoreAgentToken: `${ serverHost }/api/onprem-userstore/v1/token`,
organizationEndpoint: `${ serverHost }/api/asgardeo-enterprise-login/v1/business-user-login/{organization}`,
organizationPatchEndpoint: `${ serverHost }/api/asgardeo-enterprise-login/v1/business-user-login`,
remoteUserStoreAgentConnection: `${ serverHost }/api/remote-userstore/v1/connection`,
remoteUserStoreAgentToken: `${ serverHost }/api/remote-userstore/v1/token`,
resendEndpoint: `${ serverHost }/api/asgardeo-guest/v1/users/invite/{}/resend`,
smsProviderEndpoint: `${ serverHost }/api/server/v1/notification-senders/sms`,
userEndpoint: `${ serverHost }/api/asgardeo-guest/v1/users`,
userStoreAgentConnection: `${ serverHost }/api/onprem-userstore/v1/connection`,
userStoreAgentToken: `${ serverHost }/api/onprem-userstore/v1/token`
userEndpoint: `${ serverHost }/api/asgardeo-guest/v1/users`
};
};
17 changes: 12 additions & 5 deletions features/admin.extensions.v1/configs/models/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,21 @@
*/
export interface ExtendedFeatureResourceEndpointsInterface {
/**
* Remote user store agent connection API endpoint.
* On-prem user store agent connection API endpoint.
JayaShakthi97 marked this conversation as resolved.
Show resolved Hide resolved
*/
userStoreAgentConnection: string;
onPremUserStoreAgentConnection: string;
/**
* Remote user store agent token API endpoint.
* On-prem user store agent token API endpoint.
*/
userStoreAgentToken: string;

onPremUserStoreAgentToken: string;
/**
* On-prem user store agent connection API endpoint.
*/
remoteUserStoreAgentConnection: string;
/**
* On-prem user store agent token API endpoint.
*/
remoteUserStoreAgentToken: string;
/**
* Get the resource endpoints for the Invitation Management feature.
*/
Expand Down
7 changes: 6 additions & 1 deletion features/admin.groups.v1/pages/groups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ import { commonConfig, groupConfig, userstoresConfig } from "@wso2is/admin.exten
import { RootOnlyComponent } from "@wso2is/admin.organizations.v1/components";
import { useGetCurrentOrganizationType } from "@wso2is/admin.organizations.v1/hooks/use-get-organization-type";
import { getUserStoreList } from "@wso2is/admin.userstores.v1/api";
import { CONSUMER_USERSTORE, PRIMARY_USERSTORE } from "@wso2is/admin.userstores.v1/constants";
import {
CONSUMER_USERSTORE,
PRIMARY_USERSTORE,
RemoteUserStoreManagerType
} from "@wso2is/admin.userstores.v1/constants";
import { UserStorePostData } from "@wso2is/admin.userstores.v1/models/user-stores";
import { AlertInterface, AlertLevels, RolesInterface, UserstoreListResponseInterface } from "@wso2is/core/models";
import { addAlert } from "@wso2is/core/store";
Expand Down Expand Up @@ -199,6 +203,7 @@ const GroupsPage: FunctionComponent<any> = (): ReactElement => {

if (!isDisabled) {
storeOption = {
disabled: store.typeName === RemoteUserStoreManagerType.RemoteUserStoreManager,
key: index,
text: store.name,
value: store.name
Expand Down
Loading
Loading