Interface AuthorizationResource

  • All Known Implementing Classes:
    AuthorizationResourceImpl

    public interface AuthorizationResource
    This interface provides string representations of auth-protected resources.

    Background:

    In general, authorization is about granting a subject access to perform a particular action on an object/resource.

    In Pravega,

    • A subject is represented as an instance of type Principal.
    • An action is represented as an element of enum type AuthHandler.Permissions.
    • An object is represented by an instance of this class.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String ofInternalStream​(java.lang.String scopeName, java.lang.String streamName)
      Creates a resource representation for use in authorization of actions related to the specified internal stream.
      java.lang.String ofKeyValueTableInScope​(java.lang.String scopeName, java.lang.String kvtName)
      Creates a resource representation for use in authorization of actions pertaining to the specified KeyValueTable within the specified scope.
      java.lang.String ofKeyValueTablesInScope​(java.lang.String scopeName)
      Creates a resource representation for use in authorization of actions pertaining to the collection of Key-Value tables within the specified scope.
      java.lang.String ofReaderGroupInScope​(java.lang.String scopeName, java.lang.String readerGroupName)
      Creates a resource representation for use in authorization of actions pertaining to the specified reader group within the specified scope.
      java.lang.String ofReaderGroupsInScope​(java.lang.String scopeName)
      Creates a resource representation for use in authorization of actions pertaining to the collection of reader groups within the specified scope.
      java.lang.String ofScope​(java.lang.String scopeName)
      Creates a resource representation for use in authorization of actions pertaining to the specified scope.
      java.lang.String ofScopes()
      Creates a resource representation for use in authorization of actions pertaining to the collection of scopes in the system.
      java.lang.String ofStreamInScope​(java.lang.String scopeName, java.lang.String streamName)
      Creates a resource representation for use in authorization of actions pertaining to the specified stream within the specified scope.
      java.lang.String ofStreamsInScope​(java.lang.String scopeName)
      Creates a resource representation for use in authorization of actions pertaining to the collection of streams within the specified scope.
    • Method Detail

      • ofScopes

        java.lang.String ofScopes()
        Creates a resource representation for use in authorization of actions pertaining to the collection of scopes in the system.
        Returns:
        a string representing the collections of scopes in the system
      • ofScope

        java.lang.String ofScope​(java.lang.String scopeName)
        Creates a resource representation for use in authorization of actions pertaining to the specified scope.
        Parameters:
        scopeName - the name of the scope
        Returns:
        a string representing the scope with the specified name
        Throws:
        java.lang.NullPointerException - if scopeName is null
        java.lang.IllegalArgumentException - if scopeName is empty
      • ofStreamsInScope

        java.lang.String ofStreamsInScope​(java.lang.String scopeName)
        Creates a resource representation for use in authorization of actions pertaining to the collection of streams within the specified scope.
        Parameters:
        scopeName - the name of the scope
        Returns:
        a string representing the collection of streams under the scope with the specified name
        Throws:
        java.lang.NullPointerException - if scopeName is null
        java.lang.IllegalArgumentException - if scopeName is empty
      • ofStreamInScope

        java.lang.String ofStreamInScope​(java.lang.String scopeName,
                                         java.lang.String streamName)
        Creates a resource representation for use in authorization of actions pertaining to the specified stream within the specified scope.
        Parameters:
        scopeName - the name of the scope
        streamName - the name of the stream
        Returns:
        a string representing the specified stream within the specified scope
        Throws:
        java.lang.NullPointerException - if scopeName or streamName are null
        java.lang.IllegalArgumentException - if scopeName or streamName are empty
      • ofReaderGroupsInScope

        java.lang.String ofReaderGroupsInScope​(java.lang.String scopeName)
        Creates a resource representation for use in authorization of actions pertaining to the collection of reader groups within the specified scope.
        Parameters:
        scopeName - the name of the scope
        Returns:
        a string representing the specified the collection of reader groups
        Throws:
        java.lang.NullPointerException - if scopeName is null
        java.lang.IllegalArgumentException - if scopeName is empty
      • ofReaderGroupInScope

        java.lang.String ofReaderGroupInScope​(java.lang.String scopeName,
                                              java.lang.String readerGroupName)
        Creates a resource representation for use in authorization of actions pertaining to the specified reader group within the specified scope.
        Parameters:
        scopeName - the name of the scope
        readerGroupName - the name of the reader group
        Returns:
        a string representing the specified reader group
        Throws:
        java.lang.NullPointerException - if scopeName or streamName are null
        java.lang.IllegalArgumentException - if scopeName or streamName are empty
      • ofKeyValueTablesInScope

        java.lang.String ofKeyValueTablesInScope​(java.lang.String scopeName)
        Creates a resource representation for use in authorization of actions pertaining to the collection of Key-Value tables within the specified scope.
        Parameters:
        scopeName - the name of the scope
        Throws:
        java.lang.NullPointerException - if scopeName is null
        java.lang.IllegalArgumentException - if scopeName is empty
      • ofKeyValueTableInScope

        java.lang.String ofKeyValueTableInScope​(java.lang.String scopeName,
                                                java.lang.String kvtName)
        Creates a resource representation for use in authorization of actions pertaining to the specified KeyValueTable within the specified scope.
        Parameters:
        scopeName - the name of the scope
        kvtName - the name of the KeyValueTable
        Returns:
        a string representing the specified kvtable within the specified scope
        Throws:
        java.lang.NullPointerException - if scopeName or kvtName are null
        java.lang.IllegalArgumentException - if scopeName or kvtName are empty
      • ofInternalStream

        java.lang.String ofInternalStream​(java.lang.String scopeName,
                                          java.lang.String streamName)
        Creates a resource representation for use in authorization of actions related to the specified internal stream.
        Parameters:
        scopeName - the name of the scope
        streamName - the name of the internal stream
        Returns:
        a string representing the resource