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

[NP-2927] Add DAO decorator to warn about (or redirect) system context #4398

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

KernelDeimos
Copy link
Contributor

BACKGROUND

We have two nspecs for capabilityDAO: capabilityDAO and localCapabilityDAO. capabilityDAO is served, while localCapabilityDAO is intended for use by the system.

CapabilityAuthService, as well as a number of rules, are accessing capabilityDAO with a system context, which introduces an inconsistency - the possibility of a system context - that each DAO decorator in capabilityDAO has to deal with individually.

THIS PR

PreventSystemDAO is a DAO decorator that prevents a system context from accessing a DAO. It can be configured with three modes of operation:

  • ABORT_REQUEST: the default behaviour; do not handle the request. May produce an alarm.
  • REDIRECT_REQUEST: log a warning, but redirect system context requests to the appropriate DAO (like localCapabilityDAO)
  • WARN_ONLY: just warn about system contexts; don't modify behaviour. This is a helpful first-step for finding the common cases.

@google-cla google-cla bot added the cla: yes label Dec 1, 2020
@KernelDeimos KernelDeimos changed the title [NP-2927] Add DAO decorator to warn about system context [NP-2927] Add DAO decorator to warn about (or redirect) system context Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant