Skip to content

Feature/627 step config#646

Merged
oharsta merged 18 commits intomainfrom
feature/627-step-config
Mar 19, 2026
Merged

Feature/627 step config#646
oharsta merged 18 commits intomainfrom
feature/627-step-config

Conversation

@oharsta
Copy link
Copy Markdown
Member

@oharsta oharsta commented Mar 12, 2026

Added two collections: SFO en institution for #627

@oharsta oharsta requested a review from Copilot March 12, 2026 14:57
@oharsta oharsta linked an issue Mar 12, 2026 that may be closed by this pull request
9 tasks
@oharsta oharsta moved this from New to In Progress in Openconext-Manage Mar 12, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support in Manage for Openconext-Stepup configuration by introducing new metadata collections (sfo and institution) with corresponding schemas/templates, UI editing tabs, and server “push preview” endpoints to generate the JSON payloads for Stepup-Middleware.

Changes:

  • Add new metadata types sfo and institution (schemas, templates, seed/test updates).
  • Add Stepup-related “push preview” endpoints (SFO/config, institution config, whitelist) and wiring/configuration file loading.
  • Update Manage GUI to support new tabs/components and migrate i18n usage to a central src/locale/I18n.js wrapper (plus jsondiffpatch import path updates).

Reviewed changes

Copilot reviewed 87 out of 88 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
manage-server/src/test/resources/json/meta_data_seed.json Adds seed entries for institution and sfo used by integration tests.
manage-server/src/test/java/manage/control/MetaDataControllerTest.java Updates expected metadata configuration list to include sfo and institution.
manage-server/src/test/java/manage/control/DatabaseControllerUnitTest.java Updates unit test wiring for DatabaseController constructor changes (Stepup config).
manage-server/src/test/java/manage/control/DatabaseControllerTest.java Adds integration tests for new push preview endpoints (PDP/SFO/Stepup).
manage-server/src/main/resources/stepup_config.json Adds default Stepup config resource used for push previews (sraa + email templates).
manage-server/src/main/resources/metadata_templates/sfo.template.json Adds default UI template for new sfo metadata type.
manage-server/src/main/resources/metadata_templates/institution.template.json Adds default UI template for new institution metadata type.
manage-server/src/main/resources/metadata_configuration/sfo.schema.json Adds JSON schema for sfo validation and UI configuration.
manage-server/src/main/resources/metadata_configuration/institution.schema.json Adds JSON schema for institution validation and UI configuration.
manage-server/src/main/resources/application.yml Adds push.stepup.* configuration defaults (url/user/password/config file/enabled).
manage-server/src/main/java/manage/repository/MetaDataRepository.java Adds identifier-based lookup and adjusts search projections for Stepup/SFO.
manage-server/src/main/java/manage/hook/StepupIdentifierReconcilerHook.java New hook to reconcile use_ra/use_raa/select_raa references on identifier rename/delete.
manage-server/src/main/java/manage/hook/MetaDataHookConfiguration.java Registers the new Stepup identifier reconciler hook.
manage-server/src/main/java/manage/hook/EntityIdReconcilerHook.java Excludes STEPUP/SFO from the generic entityId reconciler logic.
manage-server/src/main/java/manage/control/MetaDataController.java Adds endpoint to check uniqueness of institution identifiers.
manage-server/src/main/java/manage/control/DatabaseController.java Loads Stepup config resource; adds push preview endpoints for SFO/config, whitelist, institution config.
manage-gui/vite.config.js Removes jsondiffpatch aliasing (paired with updated import paths).
manage-gui/src/utils/Flash.js Switches i18n import to the local ../locale/I18n wrapper.
manage-gui/src/stylesheets/mixins.scss Removes a phone-specific max-width override for .clip-board.
manage-gui/src/pages/System.jsx Adds new system tabs and calls for Stepup push preview endpoints.
manage-gui/src/pages/Support.jsx Switches i18n import to local wrapper.
manage-gui/src/pages/Staging.jsx Switches i18n import to local wrapper.
manage-gui/src/pages/ServerError.jsx Switches i18n import to local wrapper and minor formatting fix.
manage-gui/src/pages/Search.jsx Switches i18n import to local wrapper.
manage-gui/src/pages/Scopes.jsx Switches i18n import to local wrapper.
manage-gui/src/pages/Policies.jsx Switches i18n import to local wrapper.
manage-gui/src/pages/NotFound.jsx Switches i18n import to local wrapper.
manage-gui/src/pages/EduGain.jsx Switches i18n import to local wrapper.
manage-gui/src/pages/Detail.jsx Adds new detail tabs/components for sfo and institution and validation handling.
manage-gui/src/pages/ChangeRequests.jsx Switches i18n import to local wrapper.
manage-gui/src/pages/Activity.scss Adds hover background for activity rows.
manage-gui/src/pages/Activity.jsx Switches i18n import to local wrapper.
manage-gui/src/pages/API.jsx Switches i18n import to local wrapper.
manage-gui/src/locale/nl.js Refactors nl export to mirror the new I18n wrapper approach.
manage-gui/src/locale/en.js Refactors en export to plain object; adds Stepup/SFO/institution strings and new system tab labels.
manage-gui/src/locale/I18n.js New central i18n wrapper using i18n-js v4 API.
manage-gui/src/components/metadata/WhiteList.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/Stepup.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/SelectState.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/SelectMetaDataType.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/SFO.scss Adds styling for new SFO editor component.
manage-gui/src/components/metadata/SFO.jsx Adds new SFO editor UI component with client-side format validation hooks.
manage-gui/src/components/metadata/Revisions.jsx Updates jsondiffpatch CSS import path and i18n wrapper usage.
manage-gui/src/components/metadata/RevisionDiff.jsx Switches i18n import and fixes initial “no revisions” state calculation.
manage-gui/src/components/metadata/ResourceServers.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/RelyingParties.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/ProvisioningApplications.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/PolicyXML.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/PolicyRules.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/PolicyMaintenance.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/PolicyJSON.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/PolicyForm.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/PolicyAttributes.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/Policies.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/OrganisationEntity.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/Organisation.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/MetaDataChangeRequests.jsx Updates jsondiffpatch API usage/imports for newer version + i18n wrapper usage.
manage-gui/src/components/metadata/MetaData.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/Manipulation.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/Institution.scss Adds styling for new Institution editor component.
manage-gui/src/components/metadata/Institution.jsx Adds new Institution editor UI component including identifier uniqueness checks.
manage-gui/src/components/metadata/InlineEditable.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/Import.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/Export.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/EntityId.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/Diff.jsx Updates jsondiffpatch API usage/imports for newer version + i18n wrapper usage.
manage-gui/src/components/metadata/ConsentDisabling.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/Connection.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/ConnectedIdps.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/AutoRefresh.jsx Switches i18n import to local wrapper.
manage-gui/src/components/metadata/ARP.jsx Switches i18n import to local wrapper.
manage-gui/src/components/form/Strings.jsx Switches i18n import to local wrapper.
manage-gui/src/components/form/StringWithFormat.jsx Switches i18n import to local wrapper.
manage-gui/src/components/form/SelectMulti.jsx Removes an extra blank line (formatting).
manage-gui/src/components/form/ScopeSelection.jsx Switches i18n import to local wrapper.
manage-gui/src/components/form/Password.jsx Switches i18n import to local wrapper.
manage-gui/src/components/PolicyPlaygound.jsx Switches i18n import to local wrapper.
manage-gui/src/components/Navigation.jsx Switches i18n import to local wrapper.
manage-gui/src/components/Header.jsx Switches i18n import to local wrapper.
manage-gui/src/components/FormatInput.jsx Switches i18n import to local wrapper.
manage-gui/src/components/ErrorDialog.jsx Switches i18n import to local wrapper.
manage-gui/src/components/ConfirmationDialog.jsx Switches i18n import to local wrapper.
manage-gui/src/components/ClipBoardCopy.jsx Switches i18n import to local wrapper.
manage-gui/src/components/Autocomplete.jsx Updates results table behavior for institution/SFO display and i18n wrapper usage.
manage-gui/src/api/index.js Adds API calls for unique institution identifier + new push preview endpoints.
manage-gui/package.json Updates dependencies (React, router, i18n-js, jsondiffpatch, etc.) and resolutions.
manage-gui/eslint.config.mjs Updates ESLint flat config wiring and rule settings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +267 to +285
return (
<section className="metadata-sfo">
{/*{JSON.stringify(errors)}*/}
<section className="sfo">
{renderName()}
{renderIdentifier()}
{renderUseRaLocations()}
{renderShowRaaContactInformation()}
{renderVerifyEmail()}
{renderAllowedSecondFactors()}
{renderNumberOfTokensPerIdentity()}
{renderUseRa()}
{renderUseRaa()}
{renderSelectRaa()}
{renderSelfVet()}
{renderAllowSelfAssertedTokens()}
{renderSsoOn2fa()}
{renderStepupClient()}
</section>
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

This component uses metadata-sfo / sfo class names, but the stylesheet defines .metadata-institution and section.institution. As a result, the Institution page won’t get the intended styling. Rename the wrapper/section class names to match the SCSS (or update the SCSS selectors).

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +6
{
"entityid": "",
"metaDataFields": {},
"identifier": "",
"use_ra_locations": true,
"show_raa_contact_information": true,
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

The institution template is missing the name field, but institution.schema.json lists name as required. Creating a new Institution from this template will immediately fail validation unless the UI injects a name elsewhere; add a name property to the template to match the schema.

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +30
"acs": {
"type": "array",
"items": {
"type": "string",
"format": "url"
},
"info": "The ACS locations of this institution."
},
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

The Issue/PR description specifies that acs must contain exactly 1 value, but the schema only requires the field to be present and does not enforce a non-empty array. Add appropriate array constraints (e.g. minItems: 1 and possibly maxItems: 1) so server-side validation matches the intended contract.

Copilot uses AI. Check for mistakes.
Comment on lines +260 to +269
return institutions.stream().map(MetaData::getData)
.collect(toMap(
data -> (String) data.get("identifier"),
data -> data.keySet().stream()
.filter(key -> properties.contains(key))
.collect(toMap(
key -> key,
key -> data.get(key)
))
));
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

pushPreviewInstitution builds a map keyed by identifier using Collectors.toMap without a merge function. If the database contains duplicate identifiers (there’s no unique index enforced here), this endpoint will throw at runtime. Consider enforcing uniqueness at write-time (index/validation) and/or providing a merge strategy / explicit error when duplicates are detected.

Copilot uses AI. Check for mistakes.
Comment on lines +43 to +54
List.of("use_ra","use_raa","select_raa").forEach(attr -> {
List<MetaData> references = metaDataRepository.findRaw(newMetaData.getType(),
String.format("{\"data.%s\" : \"%s\"}", attr, oldIdentifier));
references.forEach(metaData -> {
List<String> identifiers = (List<String>) metaData.getData().get(attr);
identifiers.set(identifiers.indexOf(oldIdentifier), newIdentifier);
this.revision(metaData, revisionNote);
});
}
);
newMetaData.getData().put("entityid", newIdentifier);
return newMetaData;
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

When an institution’s identifier changes, this hook updates other documents referencing the old identifier, but it does not update newMetaData itself. If the edited institution references itself (common for use_ra), the subsequent save of newMetaData can reintroduce the old identifier values. Update the use_ra/use_raa/select_raa arrays in newMetaData as well (or exclude the current document from references and reconcile via newMetaData).

Copilot uses AI. Check for mistakes.
Comment on lines +755 to +757
identifier: "Identifier",
duplicateIdentifier: "This identifier is alreay taken. Duplicates are not allowed",
useRaLocations: "Use RA locations",
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

Typo in user-facing validation message: "alreay" should be "already".

Copilot uses AI. Check for mistakes.
Comment on lines +1230 to +1236
return (
<Institution data={metaData.data}
configuration={configuration}
onChange={this.onChange("institution")}
errors={errors.sfo}
isNew={isNew}
onError={this.onError("institution")}/>
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

In the Institution tab render, the component is receiving errors={errors.sfo} instead of the institution-specific error object. This will hide/misattribute validation errors for institutions; pass errors.institution here so the UI can display the correct field errors.

Copilot uses AI. Check for mistakes.
Comment on lines 142 to 150
<td>
{!isPolicy && this.item(getNameForLanguage(item.data.metaDataFields), query)}
{isPolicy && this.item(item.data.name, query)}
{!isPolicy && !isInstitution && !isSfo && this.item(getNameForLanguage(item.data.metaDataFields), query)}
{(isPolicy || isInstitution || isSfo) && this.item(item.data.name, query)}
</td>
<td>
{!isPolicy && this.item(getOrganisationForLanguage(item.data.metaDataFields), query)}
{!isPolicy && isInstitution && this.item(getOrganisationForLanguage(item.data.metaDataFields), query)}
{isInstitution && this.item(item.data.identifier, query)}
{isPolicy && I18n.t(`topBannerDetails.${item.data.type}`)}
</td>
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

The organization/institution column rendering logic is inconsistent with the table headers: for non-policy/non-organisation types the organization cell is now always empty (because it only renders when isInstitution is true), and for institutions the same cell tries to render both organization and identifier. Adjust the conditions so regular metadata types render the organisation name, institutions render the identifier in their dedicated column, and SFOs don’t render an empty organization column.

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 13, 2026

Codecov Report

❌ Patch coverage is 67.67241% with 75 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.91%. Comparing base (30947e7) to head (7ef3255).

Files with missing lines Patch % Lines
...va/manage/hook/StepupIdentifierReconcilerHook.java 9.75% 37 Missing ⚠️
...c/main/java/manage/control/DatabaseController.java 81.25% 11 Missing and 7 partials ⚠️
...rc/main/java/manage/control/RestTemplateIdiom.java 0.00% 7 Missing and 1 partial ⚠️
...ain/java/manage/repository/MetaDataRepository.java 0.00% 5 Missing and 1 partial ⚠️
...c/main/java/manage/control/MetaDataController.java 0.00% 5 Missing ⚠️
...src/main/java/manage/control/SystemController.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #646      +/-   ##
============================================
- Coverage     81.53%   80.91%   -0.62%     
- Complexity     1244     1273      +29     
============================================
  Files           117      119       +2     
  Lines          4261     4458     +197     
  Branches        447      458      +11     
============================================
+ Hits           3474     3607     +133     
- Misses          546      604      +58     
- Partials        241      247       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@oharsta oharsta merged commit fb345a1 into main Mar 19, 2026
1 of 2 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Delivered in Openconext-Manage Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Delivered

Development

Successfully merging this pull request may close these issues.

Add Openconext-Stepup config

2 participants