Uploaded image for project: 'Ranger'
  1. Ranger
  2. RANGER-502

To support easier extension/enhancement, provide abstract implementation for interfaces ConditionEvaluator/ContextEnricher/ResourceMatcher; also should support parameterless init

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.5.0
    • Fix Version/s: 0.5.0
    • Component/s: plugins
    • Labels:
      None

      Description

      To enable enhancements, without breaking existing implementations, an Abstract implementation must be provided for the following interfaces. Concrete implementations should extend from the Abstract class, instead of directly implementing the interface.

      • RangerConditionEvaluator
      • RangerContextEnricher
      • RangerResourceMatcher

      Also, currently each of these interfaces require the implementation to provide an init() method that takes few parameters - like conditionDef, resourceDef+policyResource, etc. While implementing tag-based policies, it became necessary to provide additional context (like serviceDef, serviceName) to ContextEnricher. Instead of updating init() method, which could break existing implementations, a better approach would be to set the context via series of set() methods. After all set()s are done, a parameterless init() can be called. This will model would enable extending the interface for new requirements, without breaking existing implementations.

        Attachments

          Activity

            People

            • Assignee:
              madhan Madhan Neethiraj
              Reporter:
              madhan Madhan Neethiraj
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: