ZCU-DATA/config(shibboleth): map ZCU affiliation to DSpace groups for collection rights (#952) - #1424
Conversation
Replicate the ZCU Shibboleth role->group mapping from the publications instance (issue #132, branch customer/zcu-pub) onto the data instance so that collection access rights work for Shibboleth-authenticated users. After login the `affiliation` header maps users into DSpace groups: - `member@zcu.cz` -> group MEMBER_ZCU - no matching affiliation -> default role `nogroup` -> group NOGROUP The download-403 code fix (special groups on token refresh, PR #1375) is already present on customer/zcu-data, so this is the only remaining repo delta; authentication-shibboleth.cfg is now identical to customer/zcu-pub. NOTE (runtime admin, not shippable): the EPerson groups NOGROUP and MEMBER_ZCU must exist on the instance, and the target collections/bitstreams must carry a READ policy for MEMBER_ZCU; also confirm the ZCU IdP emits `affiliation = member@zcu.cz`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The added default-roles setting only applies when the role header is missing (not when it’s present but unmapped), which conflicts with the PR description’s stated fallback behavior and may break intended access policies relying on NOGROUP.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds the missing Shibboleth affiliation → DSpace group role mapping for the ZCU-DATA deployment, aligning its Shibboleth group assignment configuration with the already-working ZCU-PUB setup so collection access policies can rely on DSpace group membership.
Changes:
- Introduces a default Shibboleth role (
nogroup) and maps it to theNOGROUPDSpace group. - Adds an explicit mapping from
member@zcu.czaffiliation to theMEMBER_ZCUDSpace group.
File summaries
| File | Description |
|---|---|
| dspace/config/modules/authentication-shibboleth.cfg | Adds ZCU-specific Shibboleth affiliation-to-group role mappings to support group-based collection access. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Problem
dataquest-dev/dspace-customers#952 asks whether the "collection rights for Shibboleth users" change (original issue #132, delivered on the publications instance
customer/zcu-pub) is implemented on the data instancecustomer/zcu-data. It was not fully: the role→group mapping was missing.Root cause / what was missing
#132 had three parts:
customer/zcu-data(backport PR ZCU-DATA/fix: shibboleth special groups lost in short-lived and refreshed tokens - 403 on download (backport #1347) #1375, commit669ffec). Nothing to do.affiliation → DSpace groupmapping inauthentication-shibboleth.cfg. This was missing on zcu-data — the delta this PR fixes.Change set
dspace/config/modules/authentication-shibboleth.cfg(+4 lines) — now byte-identical tocustomer/zcu-pub:With the already-present
authentication-shibboleth.role-header = affiliationandrole-header.ignore-scope = false, after a Shibboleth login:affiliation = member@zcu.cz→ user placed in group MEMBER_ZCU;nogroup→ group NOGROUP.ShibGrouplooks groups up by name and safely skips missing ones, so this config is inert (no startup error) until the groups exist.Out of repo — required runtime admin steps (this is the +3h in the estimate)
These live on the running zcu-data instance, not in git:
NOGROUPandMEMBER_ZCU(exact names).affiliation = member@zcu.cz; if the real attribute value differs, adjust the mapping key.Testing
Automated (already green on this branch): the mechanism is covered by existing ITs in
dspace-server-webapp/.../security/:ClarinShibbolethAuthAssing2GroupsIT— provesaffiliation/entitlement header →role.*config → group assignment.ClarinShibbolethSpecialGroupsIT— proves a restricted bitstream is downloadable after Shibboleth login with the login token, a short-lived token, and a refreshed token (the internal/OAI-stability #132 download-403 regression guard).A config
.cfgfile is not exercised by ITs (they inject properties dynamically), so no new IT is added; the ZCU values are validated manually per below.Manual — simulate Shibboleth locally without an IdP. DSpace reads Shibboleth attributes as plain HTTP headers (mod_shib sets them), so you can fake a federated login:
MEMBER_ZCUgroup and give a test collection a READ policy for it; leave a restricted bitstream in it.Authorizationbearer token from the response, then confirm membership/access:Risk / rollback
Refs dataquest-dev/dspace-customers#952 (original #132)