Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose registry as a catalog #255

Merged
merged 14 commits into from
Jun 18, 2024
Merged

Expose registry as a catalog #255

merged 14 commits into from
Jun 18, 2024

Conversation

karlcz
Copy link
Contributor

@karlcz karlcz commented Jun 17, 2024

The registry is the built-in ermrest database which tracks all API-provisioned ERMrest catalogs. This feature converts the registry into a special catalog accessed at /ermrest/catalog/0. This can provide read access to enumerate catalog and alias records as well as limited write access to modify descriptive metadata.

The default configuration provides a self-service policy so that the same client ID who provisioned a catalog may update its metadata. It also has default annotations to provide a basic catalog enumeration UX by visiting /chaise/recordset/#0/ermrest:registry.

Because the existing deployment strategy has not defined any overall "owner" ACL for the site operator, the owner ACL of this special catalog is initially empty. The site operator must first change this via local SQL access if they wish to enable API-based management of the registry catalog. For example, run commands like this against the ermrest DB:

UPDATE _ermrest.known_catalog_acls SET members = ARRAY['group-id-1'] WHERE acl = 'owner';
SELECT _ermrest.model_change_event();

There are built-in authorization restrictions so that unsafe changes are not permitted on the registry catalog regardless of how the operator customizes its policy. The existing web APIs must be used to manage the lifecycle of catalogs and aliases and these other APIs will add or remove rows from the registry table.

karlcz added 11 commits April 23, 2024 15:48
- the `ermrest` db gets catalog treatment (_ermrest schema, history tracking, etc)
- the registy logic targets the `ermrest.registry` table instead of `ermrest.simple_registry`
- existing catalog/alias APIs remain as the way to manage catalog lifecycles
- a self-referencing link for id `0` to the `ermrest` DB is added to the registry
- the /ermrest/catalog/0 data APIs allow viewing of registry records
- basic read-only policies are applied when provisioning the registry table
- limited self-service write access is allowed to modify text description fields
- descriptor column may have JSON `null` value or SQL null
- do not copy owner array content to RCB/RMB since values may be invalid client IDs
to protect built-in functions:
1. prevent insert/delete of registry rows via data APIs
2. prevent write to core registry columns via data APIs
3. prevent dropping of core registry columns
4. prevent dropping of core registry fkeys
This will default TRUE and not really serve a purpose in typical
deployments.

A site might opt to deploy an auto-expiry script to delete
non-persistent catalogs after some lifetime is reached. They might
also revise the column default to FALSE and/or adjust policies
to decide which self-service clients can adjust the flag.
…ias APIs

- name
- description
- is_persistent
- clone_source (only for catalogs)
Along with default ACLs, apply default annotations so that the
Chaise UI is sensible when looking at the ermrest:registry table.
@karlcz karlcz self-assigned this Jun 17, 2024
@karlcz karlcz merged commit 137db5a into master Jun 18, 2024
1 check passed
@karlcz karlcz deleted the reg-cat branch October 23, 2024 20:55
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