Enum Auth

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Auth>

    public enum Auth
    extends java.lang.Enum<Auth>
    Enum used to configure authentication settings for Actions.
    • Enum Constant Detail

      • AUTH_PUBLIC_ANONYMOUS

        public static final Auth AUTH_PUBLIC_ANONYMOUS
        Allows anyone access, doesn't attempt to authenticate user. Will never return absent(), but only authenticates access from App Engine task-queues. For everyone else - returns NOT_AUTHENTICATED.
      • AUTH_PUBLIC

        public static final Auth AUTH_PUBLIC
        Allows anyone access, does attempt to authenticate user. If a user is logged in, will authenticate (and return) them. Otherwise, access is still granted, but NOT_AUTHENTICATED is returned. Will never return absent().
      • AUTH_PUBLIC_LOGGED_IN

        public static final Auth AUTH_PUBLIC_LOGGED_IN
        Allows anyone access, as long as they are logged in. Does not allow access from App Engine task-queues.
      • AUTH_PUBLIC_OR_INTERNAL

        public static final Auth AUTH_PUBLIC_OR_INTERNAL
        Allows anyone access, as long as they use OAuth to authenticate.

        Also allows access from App Engine task-queue. Note that OAuth client ID still needs to be allow-listed in the config file for OAuth-based authentication to succeed.

      • AUTH_INTERNAL_OR_ADMIN

        public static final Auth AUTH_INTERNAL_OR_ADMIN
        Allows only admins or App Engine task-queue access.
      • AUTH_INTERNAL_ONLY

        public static final Auth AUTH_INTERNAL_ONLY
        Allows only App Engine task-queue access.

        In general, prefer AUTH_INTERNAL_OR_ADMIN. This level of access should be reserved for endpoints that have some sensitivity (it was introduced to mitigate a remote-shell vulnerability).

    • Method Detail

      • values

        public static Auth[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Auth c : Auth.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Auth valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null