Skip to content
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b39ae57
Creating a WIP branch
IainSAP Sep 15, 2025
eda494b
Parking WIP (store id check, store overwrite error, axios UTs, )
IainSAP Sep 17, 2025
c070397
Merge remote-tracking branch 'origin/main' into 090925
IainSAP Sep 17, 2025
4c7a42b
Revert to ABAP sec reentrance endpoint
IainSAP Sep 22, 2025
305581c
Merge remote-tracking branch 'origin/main' into 090925
IainSAP Sep 22, 2025
2823a9a
Committing WIP (axios-extension tests updated)
IainSAP Sep 29, 2025
c42c964
Merge remote-tracking branch 'origin/main' into 090925
IainSAP Sep 29, 2025
508cb4c
Test updates
IainSAP Oct 1, 2025
367051b
Merge remote-tracking branch 'origin/main' into 090925
IainSAP Oct 1, 2025
6944944
Update tests
IainSAP Oct 1, 2025
c96f89e
Update tests, remove unnecessary disableAutoMock from telem tests
IainSAP Oct 1, 2025
587605d
Merge branch 'main' into 3578/remove_service_key_usage
IainSAP Oct 1, 2025
20c936f
Address lint issues, remove refresh token related code
IainSAP Oct 1, 2025
8f9ee0f
Merge branch 'main' into 3578/remove_service_key_usage
IainSAP Oct 1, 2025
3129b04
Remove commented test code
IainSAP Oct 1, 2025
99ec420
Address Sonar issues
IainSAP Oct 2, 2025
e239f4b
Fix comp
IainSAP Oct 2, 2025
7780c9c
Linting auto fix commit
github-actions[bot] Oct 2, 2025
fb8b9ba
Revert test change
IainSAP Oct 2, 2025
4b3bfb9
Merge remote-tracking branch 'origin/3578/remove_service_key_usage' i…
IainSAP Oct 2, 2025
bcd8f42
Update backend proxy to use only the app setting for auth determination
IainSAP Oct 3, 2025
8f9f5f2
Update packages/store/src/translations/ux-store.i18n.json
IainSAP Oct 3, 2025
461b58b
Sonar issue fixes
IainSAP Oct 3, 2025
8465f00
Merge branch 'main' into 3578/remove_service_key_usage
IainSAP Oct 6, 2025
315db52
Collect cov!
IainSAP Oct 6, 2025
c67f7ef
Merge branch 'main' into 3578/remove_service_key_usage
IainSAP Oct 6, 2025
90b934b
Adds cset
IainSAP Oct 6, 2025
6b74ab2
Merge remote-tracking branch 'origin/3578/remove_service_key_usage' i…
IainSAP Oct 6, 2025
7ba436d
Merge remote-tracking branch 'origin/main' into
IainSAP Oct 7, 2025
ed38771
Restore import style
IainSAP Oct 7, 2025
3a87a7a
Fix test import
IainSAP Oct 7, 2025
a4c43c2
Merge branch 'main' into 3578/remove_service_key_usage
IainSAP Oct 7, 2025
3bd0b43
Update overwrite msg
IainSAP Oct 7, 2025
e49df8e
Merge branch 'main' into 3578/remove_service_key_usage
IainSAP Oct 8, 2025
87d966d
Merge branch 'main' into 3578/remove_service_key_usage
IainSAP Oct 8, 2025
4da6826
Merge branch 'main' into 3578/remove_service_key_usage
IainSAP Oct 13, 2025
9cd02c9
Re-add tests for unattended UUA
IainSAP Oct 13, 2025
5b19719
Re-add unattended (credential passed) UAA
IainSAP Oct 13, 2025
b4f1b94
Merge remote-tracking branch 'origin/main' into 3578/remove_service_k…
IainSAP Oct 13, 2025
f24ec12
Merge remote-tracking branch 'origin/3578/remove_service_key_usage' i…
IainSAP Oct 13, 2025
b3f3f97
Organise imports, fix UAA interceptor (self-removal but needs reuse)
IainSAP Oct 13, 2025
9dae347
Merge branch 'main' into 3578/remove_service_key_usage
IainSAP Oct 13, 2025
6a33cba
Merge branch 'main' into 3578/remove_service_key_usage
IainSAP Oct 14, 2025
592024a
Merge branch 'main' into 3578/remove_service_key_usage
IainSAP Oct 14, 2025
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
11 changes: 6 additions & 5 deletions packages/abap-deploy-config-inquirer/src/prompts/conditions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function showScpQuestion(previousAnswers: AbapDeployConfigAnswersInternal
*/
function showClientCondition(scp?: boolean): boolean {
return Boolean(
!isAppStudio() && !PromptState.abapDeployConfig?.isS4HC && !scp && !PromptState.abapDeployConfig?.scp
!isAppStudio() && !PromptState.abapDeployConfig?.isAbapCloud && !scp && !PromptState.abapDeployConfig?.scp
);
}

Expand Down Expand Up @@ -142,7 +142,7 @@ export function showUi5AppDeployConfigQuestion(ui5AbapPromptOptions?: UI5AbapRep
!ui5AbapPromptOptions?.hide &&
ui5AbapPromptOptions?.hideIfOnPremise &&
!PromptState.abapDeployConfig?.scp &&
!PromptState.abapDeployConfig?.isS4HC
!PromptState.abapDeployConfig?.isAbapCloud
) {
return false;
}
Expand Down Expand Up @@ -238,7 +238,7 @@ function defaultOrShowTransportQuestion(): boolean {
export function showTransportInputChoice(options?: TransportInputChoicePromptOptions): boolean {
if (
options?.hideIfOnPremise === true &&
!PromptState.abapDeployConfig?.isS4HC &&
!PromptState.abapDeployConfig?.isAbapCloud &&
!PromptState.abapDeployConfig?.scp
) {
return false;
Expand Down Expand Up @@ -276,7 +276,7 @@ export function defaultOrShowTransportListQuestion(
return (
transportInputChoice === TransportChoices.ListExistingChoice &&
!isTransportListEmpty(PromptState.transportAnswers.transportList) &&
!(transportInputChoiceOptions?.hideIfOnPremise === true && PromptState?.abapDeployConfig?.isS4HC === false)
!(transportInputChoiceOptions?.hideIfOnPremise === true && PromptState?.abapDeployConfig?.isAbapCloud === false)
);
}

Expand Down Expand Up @@ -311,7 +311,8 @@ export function defaultOrShowManualTransportQuestion(
return (
defaultOrShowTransportQuestion() &&
(transportInputChoice === TransportChoices.EnterManualChoice ||
(transportInputChoiceOptions?.hideIfOnPremise === true && PromptState?.abapDeployConfig?.isS4HC === false))
(transportInputChoiceOptions?.hideIfOnPremise === true &&
PromptState?.abapDeployConfig?.isAbapCloud === false))
);
}

Expand Down
43 changes: 9 additions & 34 deletions packages/abap-deploy-config-inquirer/src/prompts/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from '../types';
import { AuthenticationType, type BackendSystem } from '@sap-ux/store';
import type { ChoiceOptions, ListChoiceOptions } from 'inquirer';
import { getSystemDisplayName } from '@sap-ux/fiori-generator-shared';
import { getBackendSystemDisplayName, getSystemDisplayName } from '@sap-ux/fiori-generator-shared';
import type { AbapServiceProvider } from '@sap-ux/axios-extension';

/**
Expand All @@ -40,32 +40,6 @@ function getDestinationChoices(destinations: Destinations = {}): AbapSystemChoic
return systemChoices;
}

/**
* Returns the display name for the backend system.
*
* @param options options for display name
* @param options.backendSystem backend system
* @param options.includeUserName include user name in the display name
* @returns backend display name
*/
function getBackendDisplayName({
backendSystem,
includeUserName = true
}: {
backendSystem: BackendSystem;
includeUserName?: boolean;
}): string {
const userDisplayName = includeUserName && backendSystem.userDisplayName ? `${backendSystem.userDisplayName}` : '';
const systemDisplayName = getSystemDisplayName(
backendSystem.name,
userDisplayName,
!!backendSystem.serviceKeys,
backendSystem.authenticationType === AuthenticationType.ReentranceTicket
);

return systemDisplayName;
}

/**
* Returns a list of backend system choices.
*
Expand Down Expand Up @@ -102,12 +76,12 @@ async function getBackendTargetChoices(
}
return {
name: isDefault
? `${getBackendDisplayName({ backendSystem: system })} (Source system)`
: getBackendDisplayName({ backendSystem: system }) ?? '',
? `${getBackendSystemDisplayName(system)} (Source system)`
: getBackendSystemDisplayName(system) ?? '',
value: system.url,
isDefault,
scp: !!system.serviceKeys,
isS4HC: system.authenticationType === AuthenticationType.ReentranceTicket,
scp: !!system.serviceKeys, // legacy service key store entries
isAbapCloud: system.authenticationType === AuthenticationType.ReentranceTicket,
client: system.client
};
});
Expand All @@ -123,13 +97,14 @@ async function getBackendTargetChoices(
name: `${getSystemDisplayName(
systemName,
user,
target.scp,
target.authenticationType === AuthenticationType.ReentranceTicket
target.scp || target.authenticationType === AuthenticationType.ReentranceTicket
? 'ABAPCloud'
: undefined // scp is retained for legacy apps yamls that contain this value
)} (Source system)`,
value: target.url,
isDefault: true,
scp: target.scp,
isS4HC: target.authenticationType === AuthenticationType.ReentranceTicket,
isAbapCloud: target.authenticationType === AuthenticationType.ReentranceTicket,
client: target.client
});
}
Expand Down
28 changes: 13 additions & 15 deletions packages/abap-deploy-config-inquirer/src/prompts/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const allowedPackagePrefixes = ['$', 'Z', 'Y', 'SAP'];
async function validateSystemType(options?: TargetSystemPromptOptions): Promise<boolean | string> {
if (options?.additionalValidation?.shouldRestrictDifferentSystemType) {
const isDefaultProviderAbapCloud = AbapServiceProviderManager.getIsDefaultProviderAbapCloud();
const isSelectedS4HC = PromptState?.abapDeployConfig?.isS4HC;
const isSelectedS4HC = PromptState?.abapDeployConfig?.isAbapCloud;
if (isDefaultProviderAbapCloud === true && isSelectedS4HC === false) {
return t('errors.validators.invalidCloudSystem');
} else if (isDefaultProviderAbapCloud === false && isSelectedS4HC) {
Expand Down Expand Up @@ -90,26 +90,26 @@ export async function validateDestinationQuestion(
* @param props - properties to update
* @param props.url - url
* @param props.client - client
* @param props.isS4HC - is S/4HANA Cloud
* @param props.isAbapCloud - Cloud based Abap (either Steampunk or Embedded Steampunk)
* @param props.scp - is SCP
* @param props.target - target system
*/
function updatePromptState({
url,
client,
isS4HC,
isAbapCloud,
scp,
target
}: {
url: string;
client?: string;
isS4HC?: boolean;
isAbapCloud?: boolean;
scp?: boolean;
target?: string;
}): void {
PromptState.abapDeployConfig.url = url;
PromptState.abapDeployConfig.client = client;
PromptState.abapDeployConfig.isS4HC = isS4HC;
PromptState.abapDeployConfig.isAbapCloud = isAbapCloud;
PromptState.abapDeployConfig.scp = scp;
PromptState.abapDeployConfig.targetSystem = target;
}
Expand All @@ -134,13 +134,12 @@ export async function updateDestinationPromptState(
updatePromptState({
url: dest?.Host,
client: dest['sap-client'],
isS4HC: isS4HC(dest),
isAbapCloud: isS4HC(dest),
scp: isAbapEnvironmentOnBtp(dest)
});

if (options?.additionalValidation?.shouldRestrictDifferentSystemType) {
const isS4HCloud = await isAbapCloud(backendTarget);
PromptState.abapDeployConfig.isS4HC = isS4HCloud ?? false;
PromptState.abapDeployConfig.isAbapCloud = (await isAbapCloud(backendTarget)) ?? false;
}
}
}
Expand Down Expand Up @@ -171,7 +170,7 @@ export async function validateTargetSystem(
url: choice.value,
client: choice.client ?? '',
scp: choice.scp,
isS4HC: choice.isS4HC,
isAbapCloud: choice.isAbapCloud,
target: target
});
}
Expand Down Expand Up @@ -202,7 +201,7 @@ export function validateUrl(input: string): boolean | string {
url: input.trim(),
client: backendSystem?.client,
scp: !!backendSystem?.serviceKeys,
isS4HC: backendSystem?.authenticationType === AuthenticationType.ReentranceTicket
isAbapCloud: backendSystem?.authenticationType === AuthenticationType.ReentranceTicket
});
} else {
return t('errors.invalidUrl', { url: input?.trim() });
Expand Down Expand Up @@ -305,8 +304,7 @@ export async function validateCredentials(
});

if (isAppStudio() && shouldCheckSystemType) {
const isS4HCloud = await isAbapCloud(backendTarget);
PromptState.abapDeployConfig.isS4HC = isS4HCloud ?? false;
PromptState.abapDeployConfig.isAbapCloud = (await isAbapCloud(backendTarget)) ?? false;
}

PromptState.transportAnswers.transportConfigNeedsCreds = transportConfigNeedsCreds ?? false;
Expand Down Expand Up @@ -646,8 +644,8 @@ export function validateConfirmQuestion(overwrite: boolean): boolean {
* @returns {Promise<boolean>} - Resolves to `true` if the package is cloud-ready, `false` otherwise.
*/
async function validatePackageType(input: string, backendTarget?: BackendTarget): Promise<boolean | string> {
const isS4HC = PromptState?.abapDeployConfig?.isS4HC;
if (!isS4HC) {
const isAbapCloud = PromptState?.abapDeployConfig?.isAbapCloud;
if (!isAbapCloud) {
LoggerHelper.logger.debug(`System is OnPremise, skipping package "${input}" type validation`);
return true;
}
Expand Down Expand Up @@ -819,7 +817,7 @@ function shouldValidatePackageForStartingPrefix(
!ui5AbapPromptOptions?.hide &&
!(
ui5AbapPromptOptions?.hideIfOnPremise === true &&
PromptState.abapDeployConfig?.isS4HC === false &&
PromptState.abapDeployConfig?.isAbapCloud === false &&
PromptState.abapDeployConfig?.scp === false
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class AbapServiceProviderManager {
} as UrlAbapTarget;

if (
PromptState.abapDeployConfig.isS4HC ??
PromptState.abapDeployConfig.isAbapCloud ??
backendTarget?.abapTarget.authenticationType === AuthenticationType.ReentranceTicket
) {
abapTarget.authenticationType = AuthenticationType.ReentranceTicket;
Expand Down
4 changes: 2 additions & 2 deletions packages/abap-deploy-config-inquirer/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface AbapSystemChoice {
url?: string;
client?: string;
isDefault?: boolean;
isS4HC?: boolean;
isAbapCloud?: boolean;
}

/**
Expand Down Expand Up @@ -255,7 +255,7 @@ export interface AbapDeployConfigAnswers {
export interface AbapDeployConfigAnswersInternal extends AbapDeployConfigAnswers {
clientChoice?: string;
username?: string;
isS4HC?: boolean;
isAbapCloud?: boolean;
packageInputChoice?: PackageInputChoices;
packageManual?: string;
packageAutocomplete?: string;
Expand Down
5 changes: 3 additions & 2 deletions packages/abap-deploy-config-inquirer/test/fixtures/targets.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AuthenticationType } from '@sap-ux/store';
import { AuthenticationType, BackendSystem } from '@sap-ux/store';

export const mockTargetSystems = [
{
Expand All @@ -12,7 +12,8 @@ export const mockTargetSystems = [
url: 'https://mock.url.target2.com',
client: '102',
userDisplayName: 'mockUser2',
authenticationType: AuthenticationType.ReentranceTicket
authenticationType: AuthenticationType.ReentranceTicket,
systemType: 'ABAPCloud'
},
{
name: 'target3',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,20 @@ describe('Test abap deploy config inquirer conditions', () => {
test('should show client choice question', () => {
mockIsAppStudio.mockReturnValueOnce(false);
PromptState.isYUI = false;
PromptState.abapDeployConfig.isS4HC = false;
PromptState.abapDeployConfig.isAbapCloud = false;
expect(
showClientChoiceQuestion({ scp: false, targetSystem: TargetSystemType.Url, url: '', package: '' }, '100')
).toBe(true);
PromptState.resetAbapDeployConfig();
// Should not show client choice question if SCP is enabled
PromptState.abapDeployConfig.isS4HC = false;
PromptState.abapDeployConfig.isAbapCloud = false;
PromptState.abapDeployConfig.scp = true;
expect(
showClientChoiceQuestion({ scp: false, targetSystem: TargetSystemType.Url, url: '', package: '' }, '100')
).toBe(false);
PromptState.resetAbapDeployConfig();
// Should not show client choice question if target system is not a URL
PromptState.abapDeployConfig.isS4HC = false;
PromptState.abapDeployConfig.isAbapCloud = false;
PromptState.abapDeployConfig.scp = true;
expect(showClientChoiceQuestion({ scp: true, url: '', package: '' }, '100')).toBe(false);
PromptState.resetAbapDeployConfig();
Expand All @@ -91,7 +91,7 @@ describe('Test abap deploy config inquirer conditions', () => {
test('should not show client choice question', () => {
mockIsAppStudio.mockReturnValueOnce(false);
PromptState.isYUI = false;
PromptState.abapDeployConfig.isS4HC = true;
PromptState.abapDeployConfig.isAbapCloud = true;
expect(
showClientChoiceQuestion({ scp: true, targetSystem: TargetSystemType.Url, url: '', package: '' }, undefined)
).toBe(false);
Expand All @@ -114,14 +114,14 @@ describe('Test abap deploy config inquirer conditions', () => {
PromptState.isYUI = isYui;
mockIsAppStudio.mockReturnValueOnce(false);
// Validate client question if SCP is enabled
PromptState.abapDeployConfig.isS4HC = false;
PromptState.abapDeployConfig.isAbapCloud = false;
expect(showClientQuestion({ scp: true, targetSystem: TargetSystemType.Url, url: '', package: '' })).toBe(
scpEnabled
);
PromptState.resetAbapDeployConfig();
// Validate client question if SCP is disabled
PromptState.abapDeployConfig.client = '100';
PromptState.abapDeployConfig.isS4HC = false;
PromptState.abapDeployConfig.isAbapCloud = false;
expect(
showClientQuestion({
scp: false,
Expand Down Expand Up @@ -190,7 +190,7 @@ describe('Test abap deploy config inquirer conditions', () => {
};
PromptState.abapDeployConfig.scp = false;
expect(showUi5AppDeployConfigQuestion(promptOptions)).toBe(false);
PromptState.abapDeployConfig.isS4HC = false;
PromptState.abapDeployConfig.isAbapCloud = false;
expect(showUi5AppDeployConfigQuestion(promptOptions)).toBe(false);
});

Expand Down Expand Up @@ -237,7 +237,7 @@ describe('Test abap deploy config inquirer conditions', () => {

test('should not show transport input choice question for onPremise systems', () => {
PromptState.transportAnswers.transportRequired = false;
PromptState.abapDeployConfig.isS4HC = false;
PromptState.abapDeployConfig.isAbapCloud = false;
PromptState.abapDeployConfig.scp = false;
expect(showTransportInputChoice({ hideIfOnPremise: true })).toBe(false);
});
Expand Down Expand Up @@ -267,7 +267,7 @@ describe('Test abap deploy config inquirer conditions', () => {
});

test('should not show transport list question', () => {
PromptState.abapDeployConfig.isS4HC = false;
PromptState.abapDeployConfig.isAbapCloud = false;
PromptState.transportAnswers.transportList = [
{ transportReqNumber: 'K123456', transportReqDescription: 'Mock transport' }
];
Expand Down Expand Up @@ -303,7 +303,7 @@ describe('Test abap deploy config inquirer conditions', () => {
});

test('should show manual transport question when transportInput choice is not provided and transportInputChoice is hidden', () => {
PromptState.abapDeployConfig.isS4HC = false;
PromptState.abapDeployConfig.isAbapCloud = false;
expect(defaultOrShowManualTransportQuestion(undefined, { hideIfOnPremise: true })).toBe(true);
});

Expand Down
Loading
Loading