java.lang.Object
io.jenkins.plugins.credentials.secretsmanager.FolderScope
All Implemented Interfaces:
Serializable

public class FolderScope extends Object implements Serializable
Represents the folder scope for a credential. A credential with folder scope is only accessible from jobs within the specified folders and their subfolders (hierarchical matching).
See Also:
  • Method Details

    • global

      @NonNull public static FolderScope global()
      Creates a global scope (accessible from anywhere).
      Returns:
      a global FolderScope
    • of

      @NonNull public static FolderScope of(@NonNull String... paths)
      Creates a FolderScope from one or more folder paths.
      Parameters:
      paths - the folder paths
      Returns:
      a FolderScope with the specified paths
    • parse

      @NonNull public static FolderScope parse(@CheckForNull String commaSeparated)
      Parses a comma-separated list of folder paths into a FolderScope.
      Parameters:
      commaSeparated - comma-separated folder paths (e.g., "engineering/backend,qa/staging")
      Returns:
      a FolderScope with the parsed paths
    • isGlobal

      public boolean isGlobal()
      Checks if this scope is global (no folder restrictions).
      Returns:
      true if global, false otherwise
    • isAccessibleFrom

      public boolean isAccessibleFrom(@CheckForNull String requestingFolderPath)
      Checks if this credential is accessible from the specified requesting folder path. Uses hierarchical matching: credentials are accessible from the specified folder and all child folders.
      Parameters:
      requestingFolderPath - the folder path from which access is requested (null means global/root context)
      Returns:
      true if accessible, false otherwise
    • getFolderPaths

      @NonNull public Set<String> getFolderPaths()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object