Skip to content

v1.0.0-beta.77

Latest

Choose a tag to compare

@github-actions github-actions released this 23 Nov 14:38
2ec4cf1

Authup v1.0.0-beta.77 adds reusable resource-server authorization, more reliable provisioning and safer console defaults. These notes cover v1.0.0-beta.76 → v1.0.0-beta.77.

👀 Highlights

🛡️ Console pages get a script policy by default

The admin and account consoles now restrict scripts to their own origin and the hash of the injected runtime configuration. Requests and form submissions may reach the console and API origins; objects and base URLs are blocked. Packaged consoles need no configuration change, and icons are bundled rather than fetched from an external service.

If your reverse proxy injects scripts, you can opt out per console:

adminConsole:
  cspEnabled: false
accountConsole:
  cspEnabled: false

Note

When theme head fragments are enabled, or a development-server shell is used, these consoles retain the framing-only policy so those scripts can run. Turning off the script policy also retains the framing protection.

📖 Console upgrade guidance

🔗 Provisioning binds relations after creating the entities

Within a realm, provisioning now creates the permissions, roles, clients and users before applying their assignments. A client can receive permissions declared in the same file on its first boot, without depending on declaration order.

Roles and clients can also receive permissions owned by any client in the same realm, and clients can receive client-owned roles. For example, the relations block of a client entry can include:

relations:
  clientPermissions:
    reporting-api: ['report_read']
  clientRoles:
    reporting-api: ['viewer']

Provisioning repairs existing client-owned permissions and roles missing their realm, including the realm columns of referring bindings. Permission managers can assign roles containing realm- or client-owned permissions when they pass the permission's update gate and their policy-free update reach covers the role's grant. Global permissions retain the stricter dominance requirement; direct permission binding still requires holding that permission.

Warning

Existing createOnly entries keep the assignments they already received. If an earlier boot missed relations, use strategy: { type: merge } on those entries for one boot, or add the bindings through the API.

📖 Provisioning reference

🧩 Build resource-server authorization without copying server-core

@authup/access now exports scopeReadQuery, narrowReadScope and appendQueryConditions. You can scope list queries with the same compiled permission checks used by Authup, including resources pinned to a realm rather than carrying a realmId column.

For a resource that genuinely belongs to no realm, the record helpers accept an explicit false:

import { reachesRecord } from '@authup/access';

const canRead = await reachesRecord(evaluator, {
    name: 'event_read',
    realm: false,
});

@authup/server-kit/core provides the entity-service contracts, typed actor identities, stale-row retry helpers and AuthorizationCatalogCache without loading native bindings, Winston, Redis or the Socket.IO emitter. The cache shares concurrent reads, keeps no failed read and retries once with a fresh catalog on AuthorizationCatalogStaleError; its default maximum age is 60 seconds.

Warning

realm: false skips realm matching; it is not a fallback for missing realm data. Use null for a global row. The light server-kit/core entry changes what is loaded, not what npm installs: the parent package's dependencies remain declared.

📖 Access helpers · Server-kit contracts and cache

🚦 Distinguish an authentication outage from an invalid token

TokenVerifier now raises UpstreamError (upstream_error, HTTP 502) for failures unrelated to the token, such as an unreachable Authup service, unusable upstream responses or failed verifier credentials. Your error handler can recognize it with isUpstreamError from @authup/errors and return 502 or 503 instead of telling the client to discard its token. Timeouts remain UpstreamTimeoutError; caller aborts are preserved.

A token whose subject was deleted now introspects as inactive:

{"active": false}

UUID-shaped entity names fall back to a name lookup after an ID miss, including credential lookups; an ID match wins. Token subjects, however, resolve by ID only, so a namesake cannot inherit a deleted subject's token.

The Redis token cache moves into its own package. Memory-only consumers of server-adapter-kit no longer need its Redis peer:

-import { RedisTokenCache } from '@authup/server-adapter-kit';
+import { RedisTokenCache } from '@authup/server-adapter-redis';

Redis consumers install @authup/server-adapter-redis@1.0.0-beta.77 and ioredis@^6.0.0 alongside the verifier.

📖 Verifier error and import migration · Redis adapter

🎛️ Realm selection gets a list layout and custom items

The realm chooser is now ARealmPicker (formerly ARealmGrid). It keeps the grid default and adds a list layout with realm descriptions, plus an item slot exposing { realm, select } for your own rendering:

<ARealmPicker layout="list">
  <template #item="{ realm, select }">
    <a @click="select">{{ realm.name }}</a>
  </template>
</ARealmPicker>

The form pickers have distinct names: AFormClientPicker, AFormPathPicker, AFormPolicyPicker and AFormRealmPicker.

Warning

Search your templates for the old form ARealmPicker and replace it with AFormRealmPicker. With global component registration, the old name can still compile but render the realm chooser and never emit the form's change event. The generated changelog below abbreviates these form names as AFormPicker; use the concrete names listed here.

Collection loading indicators now follow only the newest load, so a superseded search does not keep the table spinning. Empty states distinguish filtered results, entity forms disable their fields during saves to avoid overwriting new edits, and admin detail pages reload when route parameters change.

📖 Realm picker examples at this tag

🔒 HTTP client IDs stay inside one URL segment

Every core-http-kit method placing an ID or name in a URL now encodes it as one path segment. Reserved characters cannot become a different path or query, and empty strings, . and .. fail locally with path_segment_invalid before sending a request. Special routes such as @me keep their literal @.

import { encodePathSegment } from '@authup/core-http-kit';

encodePathSegment('a/b');       // 'a%2Fb'
encodePathSegment('x?force=1'); // 'x%3Fforce%3D1'
encodePathSegment('@me');      // '@me'

You also get EntityCollectionResponse<R, M> for custom collection metadata and a public buildRequestConfig export. Serialized AuthupError base fields cannot be overridden by custom data, and cache-error logs include bounded tag lists with column values masked.

📖 Path-segment behavior and API coverage

🗄️ CLI migrations share the startup lock and respect PostgreSQL schemas

CLI migration run and revert now use the same advisory lock as server startup, preventing concurrent migration jobs and booting replicas from applying or undoing the same migration twice. status remains unlocked.

PostgreSQL migrations stop qualifying dropped indexes with public. For a deployment in another schema, Authup places DB_SCHEMA first on the connection's search_path unless you explicitly configured one:

DB_SCHEMA=authup

📖 Database configuration

⚠️ Heads-Up Before Upgrading

Change What to do
Form pickers and realm chooser renamed Replace AClientPicker, APathPicker, APolicyPicker and the form ARealmPicker with their AForm<Entity>Picker names; replace ARealmGrid with ARealmPicker. Search globally registered templates as well as imports.
JunctionEntityService.ownerRealmKey replaced Declare ownerRealm = { key: 'roleRealmId' } as const and read this.ownerRealm.key; use the explicit { realm } alternative for a fixed or resolved owner realm.
RedisTokenCache moved Install @authup/server-adapter-redis plus ioredis 6 and change the import.
Invalid HTTP path segments now throw Reject empty, . and .. IDs in callers; use collection methods rather than getOne('').
New verifier outage classification Handle isUpstreamError separately from invalid-token errors, alongside the existing timeout case.
Console script policy enabled by default Review proxy-injected scripts; use the per-console CSP switches only if needed.
@vuecs/locale is a required web-kit peer Ensure @vuecs/locale@^1.1.3 is installed in custom kit hosts.
Previously missed createOnly provisioning relations Run affected entries with the merge strategy for one boot, or add the assignments through the API.

⬆️ Upgrading

For an npm deployment of the operator CLI (Node.js 26 or newer):

npm install authup@1.0.0-beta.77

Update the Authup packages your application consumes together to 1.0.0-beta.77, and apply the relevant migrations above before rebuilding custom integrations.

📖 Deployment upgrade guide at this release

👉 Changelog

Compare v1.0.0-beta.76...v1.0.0-beta.77

⚠ BREAKING CHANGES

  • APathPicker, APolicyPicker, AClientPicker and ARealmPicker (the form picker) are renamed to AForm<Entity>Picker; ARealmGrid is renamed to ARealmPicker.
  • JunctionEntityService subclasses declare ownerRealm = { key: '<column>' } instead of ownerRealmKey = '<column>', and read the column as this.ownerRealm.key.
  • server-adapter-kit: RedisTokenCache is no longer exported by @authup/server-adapter-kit; import it from @authup/server-adapter-redis.

Features

  • bump rapiq and vuecs, adopt their new features (#3898) (83d9bcb)
  • encode kit path ids, realm picker layouts, error and cache fixes (#3900) (4245ac2)
  • publish the resource-server surface from access and server-kit (#3895) (f2b31f3)
  • server-core: client-owned provisioning relations, owned delegation (#3892) (55687bc)

Bug Fixes

  • console shell csp and config global, web-kit form and scope fixes (#3893) (50e1b0d)
  • deps: bump all dependencies except typescript and envix (#3880) (7e85d52)
  • deps: bump routup to 6.5 and the routup plugins (#3883) (6412493)
  • resolve uuid-shaped names after an id miss, token subjects by id only (#3896) (f7a2438), closes #3848
  • server-adapter-kit: upstream errors, redis cache package (#3894) (8354fff)
  • server-core: lock CLI migrations, drop the public qualifier (#3891) (5d87eba)
  • write explicit extensions on relative imports (f08d954), closes #3843