Swap ServiceRadar's local policy copies for the palisade package #3278

Open
opened 2026-05-12 15:56:57 +00:00 by mfreeman451 · 0 comments
Owner

Background

Palisade was extracted from ServiceRadar in #3277 — Apache-2.0
shared library at elixir/palisade/ housing the trust-boundary
primitives that CRM and ServiceRadar previously kept as drifting
verbatim copies (NetworkAddressPolicy, OutboundURLPolicy,
OutboundFetch).

That PR adds the package but does NOT yet migrate ServiceRadar's
own apps off their local copies. This issue tracks the followup.

Files to swap

serviceradar_core/lib/serviceradar/policies/

  • network_address_policy.ex — delete; consumers use
    Palisade.NetworkAddressPolicy.
  • outbound_url_policy.ex — delete; consumers use
    Palisade.OutboundURLPolicy.

web-ng/lib/serviceradar_web_ng_web/auth/

  • outbound_url_policy.ex (thin wrapper around the policies
    module) — delete; replace call sites with direct
    Palisade.OutboundURLPolicy calls.
  • outbound_fetch.ex — delete; consumers use
    Palisade.OutboundFetch.

Call-site updates

  • web-ng/lib/serviceradar_web_ng_web/auth/oidc_client.ex
    swap alias from ServiceRadarWebNGWeb.Auth.OutboundFetch to
    Palisade.OutboundFetch. Same get/2 / post/2 signature.
  • Any other consumers in serviceradar_core/ /
    serviceradar_agent_gateway/ that import the policy
    modules — grep + swap.

Tests

  • serviceradar_core/test/serviceradar/policies/* — delete
    (now in elixir/palisade/test/palisade/).
  • Update any test fixtures that referenced the
    ServiceRadar.Policies.* namespace.

Dep declaration

Each consuming app adds:

```elixir
{:palisade, path: "../palisade"}
```

Same sibling-path pattern as `serviceradar_srql`, `connection`,
`elixir_uuid`.

Acceptance criteria

  • No remaining `ServiceRadar.Policies.NetworkAddressPolicy`
    or `ServiceRadar.Policies.OutboundURLPolicy` references.
  • No remaining `ServiceRadarWebNGWeb.Auth.OutboundFetch` /
    `OutboundURLPolicy` references.
  • `mix test` green across every Elixir app in the matrix.
  • `mix credo --strict` green.
  • `mix sobelow --skip --exit medium` green for web-ng
    (skip file may need fingerprint refresh since deletions
    shift line numbers).

Out of scope (separate issues)

  • Porting `oidc_client.ex` + `oidc_strategy.ex` +
    `config_cache.ex` into `Palisade.OIDC.*` — palisade v0.2.0
    work, separate issue.
  • Porting `saml_assertion_validator.ex` etc. into
    `Palisade.SAML.*` — palisade v0.3.0 work, separate issue.
  • CRM-side migration is on a different branch
    (`migrate-auth-to-ueberauth`); CRM's PR #179 already swaps
    its own copies for the palisade dep.

Sequencing note

Land #3277 first. Then this issue's PR can proceed knowing the
package exists.

## Background Palisade was extracted from ServiceRadar in #3277 — Apache-2.0 shared library at `elixir/palisade/` housing the trust-boundary primitives that CRM and ServiceRadar previously kept as drifting verbatim copies (`NetworkAddressPolicy`, `OutboundURLPolicy`, `OutboundFetch`). That PR adds the package but does NOT yet migrate ServiceRadar's own apps off their local copies. This issue tracks the followup. ## Files to swap ### `serviceradar_core/lib/serviceradar/policies/` - `network_address_policy.ex` — delete; consumers use `Palisade.NetworkAddressPolicy`. - `outbound_url_policy.ex` — delete; consumers use `Palisade.OutboundURLPolicy`. ### `web-ng/lib/serviceradar_web_ng_web/auth/` - `outbound_url_policy.ex` (thin wrapper around the policies module) — delete; replace call sites with direct `Palisade.OutboundURLPolicy` calls. - `outbound_fetch.ex` — delete; consumers use `Palisade.OutboundFetch`. ### Call-site updates - `web-ng/lib/serviceradar_web_ng_web/auth/oidc_client.ex` — swap alias from `ServiceRadarWebNGWeb.Auth.OutboundFetch` to `Palisade.OutboundFetch`. Same `get/2` / `post/2` signature. - Any other consumers in `serviceradar_core/` / `serviceradar_agent_gateway/` that import the policy modules — grep + swap. ### Tests - `serviceradar_core/test/serviceradar/policies/*` — delete (now in `elixir/palisade/test/palisade/`). - Update any test fixtures that referenced the `ServiceRadar.Policies.*` namespace. ## Dep declaration Each consuming app adds: \`\`\`elixir {:palisade, path: \"../palisade\"} \`\`\` Same sibling-path pattern as \`serviceradar_srql\`, \`connection\`, \`elixir_uuid\`. ## Acceptance criteria - [ ] No remaining \`ServiceRadar.Policies.NetworkAddressPolicy\` or \`ServiceRadar.Policies.OutboundURLPolicy\` references. - [ ] No remaining \`ServiceRadarWebNGWeb.Auth.OutboundFetch\` / \`OutboundURLPolicy\` references. - [ ] \`mix test\` green across every Elixir app in the matrix. - [ ] \`mix credo --strict\` green. - [ ] \`mix sobelow --skip --exit medium\` green for web-ng (skip file may need fingerprint refresh since deletions shift line numbers). ## Out of scope (separate issues) - Porting \`oidc_client.ex\` + \`oidc_strategy.ex\` + \`config_cache.ex\` into \`Palisade.OIDC.*\` — palisade v0.2.0 work, separate issue. - Porting \`saml_assertion_validator.ex\` etc. into \`Palisade.SAML.*\` — palisade v0.3.0 work, separate issue. - CRM-side migration is on a different branch (\`migrate-auth-to-ueberauth\`); CRM's PR #179 already swaps its own copies for the palisade dep. ## Sequencing note Land #3277 first. Then this issue's PR can proceed knowing the package exists.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
carverauto/serviceradar#3278
No description provided.