Class BaseContextACLManager<T>

    • Constructor Detail

      • BaseContextACLManager

        public BaseContextACLManager()
    • Method Detail

      • applyMappings

        protected ACLFileManager applyMappings​(T ctx,
                                               ACLFileManager listenable)
        Applies existing listener mappings to a manager
        Parameters:
        ctx - context
        listenable - manager
      • createManager

        protected abstract ACLFileManager createManager​(T context)
        Returns:
        create a manager based on context
      • addListenerMap

        public void addListenerMap​(java.util.function.Function<T,​ACLFileManagerListener> mapping)
        adds a mapping from context to listeners, and immediately applies to previously created managers
        Specified by:
        addListenerMap in interface ContextACLManager<T>
        Parameters:
        mapping -
      • storePolicyFile

        public long storePolicyFile​(T context,
                                    java.lang.String fileName,
                                    java.io.InputStream input)
                             throws java.io.IOException
        Description copied from interface: ContextACLManager
        Store a system policy file
        Specified by:
        storePolicyFile in interface ContextACLManager<T>
        fileName - name without path
        input - input stream
        Returns:
        size of bytes stored
        Throws:
        java.io.IOException
      • deletePolicyFile

        public boolean deletePolicyFile​(T context,
                                        java.lang.String fileName)
                                 throws java.io.IOException
        Description copied from interface: ContextACLManager
        Delete a policy file
        Specified by:
        deletePolicyFile in interface ContextACLManager<T>
        Returns:
        true if successful
        Throws:
        java.io.IOException
      • storePolicyFileContents

        public long storePolicyFileContents​(T context,
                                            java.lang.String fileName,
                                            java.lang.String fileText)
                                     throws java.io.IOException
        Description copied from interface: ContextACLManager
        Store a system policy file
        Specified by:
        storePolicyFileContents in interface ContextACLManager<T>
        fileName - name without path
        fileText - contents
        Returns:
        size of bytes stored
        Throws:
        java.io.IOException
      • getPolicyFileContents

        public java.lang.String getPolicyFileContents​(T context,
                                                      java.lang.String fileName)
                                               throws java.io.IOException
        Specified by:
        getPolicyFileContents in interface ContextACLManager<T>
        fileName - name of policy file, without path
        Returns:
        text contents of the policy file
        Throws:
        java.io.IOException
      • loadPolicyFileContents

        public long loadPolicyFileContents​(T context,
                                           java.lang.String fileName,
                                           java.io.OutputStream outputStream)
                                    throws java.io.IOException
        Description copied from interface: ContextACLManager
        Load content to output stream
        Specified by:
        loadPolicyFileContents in interface ContextACLManager<T>
        fileName - name of policy file, without path
        Returns:
        length of output
        Throws:
        java.io.IOException
      • existsPolicyFile

        public boolean existsPolicyFile​(T context,
                                        java.lang.String file)
        Specified by:
        existsPolicyFile in interface ContextACLManager<T>
        file - name without path
        Returns:
        true if the policy file with the given name exists
      • validateYamlPolicy

        public com.dtolabs.rundeck.core.authorization.RuleSetValidation<com.dtolabs.rundeck.core.authorization.providers.PolicyCollection> validateYamlPolicy​(T context,
                                                                                                                                                              java.lang.String ident,
                                                                                                                                                              java.lang.String text)
                                                                                                                                                       throws java.io.IOException
        Description copied from interface: ContextValidator
        Validate the yaml aclpolicy, optionally within a specific project context
        Specified by:
        validateYamlPolicy in interface ContextValidator<T>
        ident - identity string for the sources
        text - yaml aclpolicy text
        Returns:
        validation
        Throws:
        java.io.IOException
      • validatePolicyFile

        public com.dtolabs.rundeck.core.authorization.RuleSetValidation<com.dtolabs.rundeck.core.authorization.providers.PolicyCollection> validatePolicyFile​(T context,
                                                                                                                                                              java.lang.String fname)
                                                                                                                                                       throws java.io.IOException
        Description copied from interface: ContextValidator
        Validate the yaml aclpolicy within a specific project context
        Specified by:
        validatePolicyFile in interface ContextValidator<T>
        fname - filename
        Returns:
        validation
        Throws:
        java.io.IOException
      • listStoredPolicyFiles

        public java.util.List<java.lang.String> listStoredPolicyFiles​(T context)
        Description copied from interface: ContextACLManager
        List the system aclpolicy file names, not including the dir path
        Specified by:
        listStoredPolicyFiles in interface ContextACLManager<T>