EE-4048: add attributeFriendlyName to every application template (819 of 828) - #1016
Draft
nsaraceno-sa wants to merge 1 commit into
Draft
EE-4048: add attributeFriendlyName to every application template (819 of 828)#1016nsaraceno-sa wants to merge 1 commit into
nsaraceno-sa wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
SecureAuthCorp/IdP#426 (EE-4048) made
FederationAttribute.friendlyNamepersist. Until thenExtractAttributescopied five of the six fields and leftFriendlyNamenull, so the realm writer'sif (attr.FriendlyName != null)guard skippedSAMLAttr{n}FriendlyName. The field is writable now; the SWAP attribute editor has nowhere to type it.Two additions per template:
Placed directly after the name/property grid rather than appended after
attributeFilterGroup: it decorates the attribute name, and the realm writesSAMLAttr{n}FriendlyNamebesideSAMLAttr{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-compileralready drops them, becausetemplate.data.templateNameisundefinedfor 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,MobileIronandPartnerCentralhave noicon(the compiler skips them), andAtipica.Json's capital J means it compiles toAtipica.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.jsoncarries twelve extra lines — it uses Allman brace placement ("notify":then{on the next line) thatJSON.stringifynormalises. Cosmetic, and the only file with churn beyond the six added lines.Ellucian_Colleague.jsonshows a replaced line rather than an added one: itsafteris 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
injectEntryover all 816 compiled templates and comparingentries.attributeFriendlyNameplusstatics.attributeCallout.afteragainst these patched sources:So this is a true drop-in. If it lands, #209's
augmentTemplate.jsand 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.jsis a pure download-and-write (JSON.stringify(template.data), no transform), and CI does not run it..github/workflows/template-compiler.ymldropped the build step deliberately:It only does
aws s3 cp ./dist/from the committedtemplate-compiler/distin swap-monorepo. So shipping this needs, in order:node compile prodrun against it, and the ~816 regenerated files committed to swap-monorepo'stemplate-compiler/dist— that diff is clean, six lines per file (simulated);Step 2 is in the directory swap-monorepo's
CLAUDE.mdmarks 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