Conversation
There was a problem hiding this comment.
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
sfoandinstitution(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.jswrapper (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.
| 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> |
There was a problem hiding this comment.
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).
| { | ||
| "entityid": "", | ||
| "metaDataFields": {}, | ||
| "identifier": "", | ||
| "use_ra_locations": true, | ||
| "show_raa_contact_information": true, |
There was a problem hiding this comment.
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.
| "acs": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "string", | ||
| "format": "url" | ||
| }, | ||
| "info": "The ACS locations of this institution." | ||
| }, |
There was a problem hiding this comment.
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.
| 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) | ||
| )) | ||
| )); |
There was a problem hiding this comment.
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.
| 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; |
There was a problem hiding this comment.
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).
| identifier: "Identifier", | ||
| duplicateIdentifier: "This identifier is alreay taken. Duplicates are not allowed", | ||
| useRaLocations: "Use RA locations", |
There was a problem hiding this comment.
Typo in user-facing validation message: "alreay" should be "already".
manage-gui/src/pages/Detail.jsx
Outdated
| return ( | ||
| <Institution data={metaData.data} | ||
| configuration={configuration} | ||
| onChange={this.onChange("institution")} | ||
| errors={errors.sfo} | ||
| isNew={isNew} | ||
| onError={this.onError("institution")}/> |
There was a problem hiding this comment.
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.
| <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> |
There was a problem hiding this comment.
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.
Add stepup config to changelog (and formatted)
Codecov Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
Added two collections: SFO en institution for #627