Skip to content

EE-4048: add attributeFriendlyName to every application template (819 of 828) - #1016

Draft
nsaraceno-sa wants to merge 1 commit into
masterfrom
feat/saml-attribute-friendly-name
Draft

EE-4048: add attributeFriendlyName to every application template (819 of 828)#1016
nsaraceno-sa wants to merge 1 commit into
masterfrom
feat/saml-attribute-friendly-name

Conversation

@nsaraceno-sa

Copy link
Copy Markdown
Contributor

Draft on purpose. Merging this alone ships nothing — see This does not deploy itself below. It is also an alternative to swap-monorepo#209, which is already open and does the same job in one place. Opened so the diff can be looked at before choosing.

What

SecureAuthCorp/IdP#426 (EE-4048) made FederationAttribute.friendlyName persist. Until then ExtractAttributes copied five of the six fields and left FriendlyName null, so the realm writer's if (attr.FriendlyName != null) guard skipped SAMLAttr{n}FriendlyName. The field is writable now; the SWAP attribute editor has nowhere to type it.

Two additions per template:

// entries
"attributeFriendlyName": {
  "label": "Friendly Name",
  "controlType": "input",
  "dataModelName": "friendlyName"
}

// statics.attributeCallout.after
[ "attributeInfo", "attributeFriendlyName", "attributeNamespace", ... ]

Placed directly after the name/property grid rather than appended after attributeFilterGroup: it decorates the attribute name, and the realm writes SAMLAttr{n}FriendlyName beside SAMLAttr{n}Name.

Coverage

819 of 828 templates. Diff is +4,922 / −15, about six lines per file.

The nine skipped are top-level JSON arrays rather than objects — ApexAnalytix, Firmplay, Miro, SageX3, VictorOps, Wombat, Wrike, ZscalerInternetAccess, ZscalerPrivateAccess. template-compiler already drops them, because template.data.templateName is undefined for an array, so they are absent from the compiled set and inert in production today. They want their own fix, not a workaround here.

Also already inert, for the same kind of reason, and untouched here: CrashPlan, MobileIron and PartnerCentral have no icon (the compiler skips them), and Atipica.Json's capital J means it compiles to Atipica.Json.json.

Reviewing the diff

Generated by script, preserving each file's own formatting — 2-space indentation and its trailing-newline state.

This matters more than it sounds. Re-serialising at the compiler's own 4-space indent instead rewrites all 38 MB: 866,000 added and 861,000 removed lines, median 2,110 per file, versus ~4,900 total here. If you regenerate this branch, keep the 2-space indent.

Salesforce.json carries twelve extra lines — it uses Allman brace placement ("notify": then { on the next line) that JSON.stringify normalises. Cosmetic, and the only file with churn beyond the six added lines.

Ellucian_Colleague.json shows a replaced line rather than an added one: its after is a single-element array, so the last entry gains a comma.

Verified equivalent to the runtime injection

swap-monorepo#209 injects this same entry into each template as dagobah fetches it. Running that injectEntry over all 816 compiled templates and comparing entries.attributeFriendlyName plus statics.attributeCallout.after against these patched sources:

compared: 816   identical: 816   differ: 0

So this is a true drop-in. If it lands, #209's augmentTemplate.js and its yaml fragment can be deleted in the same change with no behavioural difference — the swap-monorepo side becomes a deletion.

This does not deploy itself

template-compiler/compile.js is a pure download-and-write (JSON.stringify(template.data), no transform), and CI does not run it. .github/workflows/template-compiler.yml dropped the build step deliberately:

Build stage for "npm install" and "node compile prod" commands where not included in this workflow since the templates are deprecated and wont change.

It only does aws s3 cp ./dist/ from the committed template-compiler/dist in swap-monorepo. So shipping this needs, in order:

  1. this PR merged;
  2. node compile prod run against it, and the ~816 regenerated files committed to swap-monorepo's template-compiler/dist — that diff is clean, six lines per file (simulated);
  3. develop/master → dev bucket, live → prod.

Step 2 is in the directory swap-monorepo's CLAUDE.md marks legacy and do-not-touch, and this change falsifies the "templates … wont change" assumption the workflow was simplified around. Worth deciding whether that step gets restored to CI before relying on this route again.

Trade-off against #209

This way: the field lives in the templates, so any consumer of them gets it, and no runtime code is needed. Costs a three-surface deploy, and every new template added here has to remember the field.

#209: one file in one sub-app, covers every template present and future, ships on the normal SWAP release. Costs a small amount of runtime code that has to be maintained.

Refs: https://secureauth.atlassian.net/browse/EE-4048
Refs: https://github.com/SecureAuthCorp/swap-monorepo/pull/209

🤖 Generated with Claude Code

SecureAuthCorp/IdP#426 made FederationAttribute.friendlyName persist — until then
ExtractAttributes left FriendlyName null and the realm writer's null guard skipped
SAMLAttr{n}FriendlyName. The field is writable; the attribute editor had nowhere
to type it.

Adds one entry and one composition slot per template:

  entries.attributeFriendlyName = { label, controlType: input, dataModelName: friendlyName }
  statics.attributeCallout.after: attributeFriendlyName, directly after attributeInfo

Placed after the name/property grid rather than appended after attributeFilterGroup:
it decorates the attribute name, and the realm writes SAMLAttr{n}FriendlyName beside
SAMLAttr{n}Name.

819 of the 828 templates. The nine skipped are top-level JSON arrays rather than
objects (ApexAnalytix, Firmplay, Miro, SageX3, VictorOps, Wombat, Wrike,
ZscalerInternetAccess, ZscalerPrivateAccess); template-compiler already drops them
because `template.data.templateName` is undefined for an array, so they are absent
from the compiled set and inert in production. They need their own fix.

Generated by a script, with the source formatting preserved: 2-space indentation
and the trailing-newline state of each file. Re-serialising at the compiler's own
4-space indent instead rewrites all 38 MB — 866k added and 861k removed lines
against ~4.9k here.

Salesforce.json carries twelve extra lines: it uses Allman brace placement that
JSON.stringify normalises. Cosmetic.

Verified equivalent to the runtime injection this replaces: running dagobah's
injectEntry over all 816 compiled templates and comparing
entries.attributeFriendlyName plus statics.attributeCallout.after against these
patched sources is identical in 816 of 816.

Refs: https://secureauth.atlassian.net/browse/EE-4048
Refs: SecureAuthCorp/swap-monorepo#209

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant