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

Fix dependency cycle between galaxy.security and galaxy.model. #7554

Merged
merged 3 commits into from Mar 19, 2019

Commits on Mar 18, 2019

  1. Fix dependency cycle between galaxy.security and galaxy.model (1/2)

    ```python
    >>> from galaxy.security import get_permitted_actions
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "galaxy/security/__init__.py", line 12, in <module>
        import galaxy.model
      File "galaxy/model/__init__.py", line 51, in <module>
        from galaxy.security import get_permitted_actions
    ImportError: cannot import name get_permitted_actions
    ```
    
    Previously galaxy.model import galaxy.security and galaxy.security import galaxy.model. This prevents certain seemingly reasonable imports from working properly (see above). The new break down of code is objectively less circular and matches the better pattern we've taken more recently of seperating interfaces from implementations to allow cleaner imports and dependencies.
    
    The fix is to use galaxy.security to define the interface for security operations on Galaxy components and moving the actual model dependent code into galaxy.model.security. Now galaxy.security has no dependencies on galaxy.model, galaxy.model (the raw model definitions) only depends on the interface and utilities methods, and the actual implementation of the security agent is found in galaxy.model.security that is effectively injected at runtime from galaxy.model.mapping.
    jmchilton committed Mar 18, 2019
    Copy the full SHA
    1c20743 View commit details
    Browse the repository at this point in the history
  2. Refactor security (2/2).

    Breaking one commit into two to try to preserve history.
    jmchilton committed Mar 18, 2019
    Copy the full SHA
    9672395 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    78eed4f View commit details
    Browse the repository at this point in the history