Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
9 changes: 9 additions & 0 deletions .changeset/wet-drinks-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@wso2is/admin.server-configurations.v1": minor
"@wso2is/admin.core.v1": minor
"@wso2is/theme": minor
"@wso2is/console": minor
"@wso2is/i18n": minor
---

Improve Sift configuration page
1 change: 1 addition & 0 deletions features/admin.core.v1/store/reducers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export const commonConfigReducerInitialState: CommonConfigReducerStateInterface<
fidoConfigs: "",
flow: "",
flowMeta: "",
fraudDetectionConfigurations: "",
getSecret: "",
getSecretList: "",
getSecretType: "",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/**
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).

Check other files as well :)

*
* 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 { AsgardeoSPAClient, HttpClientInstance } from "@asgardeo/auth-react";
import { RequestConfigInterface } from "@wso2is/admin.core.v1/hooks/use-request";
import { store } from "@wso2is/admin.core.v1/store";
import { IdentityAppsApiException } from "@wso2is/core/exceptions";
import { HttpMethods } from "@wso2is/core/models";
import { AxiosError, AxiosResponse } from "axios";
import { ServerConfigurationsConstants } from "../constants/server-configurations-constants";
import { FraudDetectionConfigurationsInterface } from "../models/fraud-detection";

/**
* Initialize an axios Http client.
*
*/
const httpClient: HttpClientInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(
AsgardeoSPAClient.getInstance());

/**
* Function to update the Event Publishing Configurations.
*/
const updateEventPublishingConfigurations = (
payload: FraudDetectionConfigurationsInterface
): Promise<FraudDetectionConfigurationsInterface> => {
const requestConfig: RequestConfigInterface = {
data: payload,
headers: {
Accept: "application/json",
"Content-Type": "application/json"
},
method: HttpMethods.PUT,
url: store.getState().config.endpoints.fraudDetectionConfigurations
};

return httpClient(requestConfig)
.then((response: AxiosResponse) => {
if (response.status !== 200) {
throw new IdentityAppsApiException(
ServerConfigurationsConstants.CONFIGS_UPDATE_REQUEST_INVALID_STATUS_CODE_ERROR,
null,
response.status,
response.request,
response,
response.config);
}

return Promise.resolve(response.data);
})
.catch((error: AxiosError) => {
throw new IdentityAppsApiException(
ServerConfigurationsConstants.CONFIGS_UPDATE_REQUEST_ERROR,
error.stack,
error.code,
error.request,
error.response,
error.config);
});
};

export default updateEventPublishingConfigurations;
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**
* Copyright (c) 2025, 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 { HttpMethods } from "@wso2is/core/models";
import { FraudDetectionConfigurationsInterface } from "../models/fraud-detection";

const useFraudDetectionConfigurations = <Data = FraudDetectionConfigurationsInterface, Error = RequestErrorInterface>(
shouldFetch: boolean = true
): RequestResultInterface<Data, Error> => {
const requestConfig: RequestConfigInterface = {
headers: {
Accept: "application/json",
"Content-Type": "application/json"
},
method: HttpMethods.GET,
url: store.getState().config.endpoints.fraudDetectionConfigurations
};

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

return {
data: data as Data,
error,
isLoading,
isValidating,
mutate
};
};

export default useFraudDetectionConfigurations;
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const getServerConfigurationsResourceEndpoints = (
captchaForSSOLogin: `${ serverHost }/api/server/v1/identity-governance/${
ServerConfigurationsConstants.IDENTITY_GOVERNANCE_LOGIN_POLICIES_ID
}/connectors/${ServerConfigurationsConstants.CAPTCHA_FOR_SSO_LOGIN_CONNECTOR_ID}`,
fraudDetectionConfigurations: `${ serverHost }/api/server/v1/configs/fraud-detection`,
governanceConnectorCategories: `${ serverHost }/api/server/v1/identity-governance`,
impersonationConfigurations: `${ serverHost }/api/server/v1/configs/impersonation`,
loginPolicies: `${ serverHost }/api/server/v1/identity-governance/${
Expand Down
13 changes: 13 additions & 0 deletions features/admin.server-configurations.v1/configs/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
VerticleFilterBarsIcon
} from "@oxygen-ui/react-icons";
import UsernameValidationIcon from "@wso2is/admin.extensions.v1/assets/images/icons/username-validation-icon.svg";
import { FunctionComponent, SVGProps } from "react";
import {
default as LockRecoverIcon
} from "../../themes/default/assets/images/icons/lock-recover-icon.svg";
Expand Down Expand Up @@ -93,6 +94,7 @@ import {
import {
default as JWTKeyIcon
} from "../../themes/default/assets/images/illustrations/jwt-key-icon.svg";
import { ReactComponent as SiftLogo } from "../../themes/wso2is/assets/images/connectors/sift.svg";
import { ServerConfigurationsConstants } from "../constants/server-configurations-constants";

interface GetGovernanceConnectorIllustrationsInterface {
Expand Down Expand Up @@ -157,3 +159,14 @@ export const getConnectorCategoryIcon = (): ConnectorCategoryIconsInterface => {
"default": GearIcon
};
};

/**
* Get Sift connector icon.
*/
export const getSiftConnectorIcon = (): {
sift: FunctionComponent<SVGProps<SVGSVGElement>>;
} => {
return {
sift: SiftLogo
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
* Keys used in feature dictionary.
*/
export enum GovernanceConnectorFeatureDictionaryKeys {
HIDE_INVITED_USER_REGISTRATION_TOGGLE = "hideInvitedUserRegistrationToggle"
HIDE_INVITED_USER_REGISTRATION_TOGGLE = "hideInvitedUserRegistrationToggle",
HIDE_FRAUD_DETECTION_EVENT_PUBLISHING_CONFIGURATION = "hideFraudDetectionEventPublishingConfiguration"
}

/**
Expand All @@ -35,7 +36,9 @@ export class GovernanceConnectorConstants {
*/
public static readonly featureDictionary: Record<string, string> = {
[GovernanceConnectorFeatureDictionaryKeys.HIDE_INVITED_USER_REGISTRATION_TOGGLE]:
"governanceConnectors.invitedUserRegistration.enableDisableControl"
"governanceConnectors.invitedUserRegistration.enableDisableControl",
[GovernanceConnectorFeatureDictionaryKeys.HIDE_FRAUD_DETECTION_EVENT_PUBLISHING_CONFIGURATION]:
"governanceConnectors.fraudDetection.eventPublishingConfigurations"
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* under the License.
*/

.sift-connector-form{
.sift-connector-form {
.oxygen-text-field {
min-width: 350px;
}
Expand Down
Loading
Loading