Class GitHubAppUsageContext

java.lang.Object
org.jenkinsci.plugins.github_branch_source.GitHubAppUsageContext

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class GitHubAppUsageContext extends Object
Holds the inferred owner, repository, and required permissions for whatever operation is going to be performed by the code that looked up these credentials.

Context is inferred either in Connector.lookupScanCredentials(jenkins.scm.api.SCMSourceOwner, java.lang.String, java.lang.String) or GitHubAppCredentials.forRun(hudson.model.Run<?, ?>). Each call to GitHubAppCredentials.contextualize(org.jenkinsci.plugins.github_branch_source.GitHubAppUsageContext) for a distinct context returns a different instance of these GitHubAppCredentials.

See Also:
  • Constructor Details

    • GitHubAppUsageContext

      public GitHubAppUsageContext()
  • Method Details

    • builder

      public static GitHubAppUsageContext.Builder builder()
    • getInferredOwner

      @CheckForNull public String getInferredOwner()
    • getInferredRepository

      @CheckForNull public String getInferredRepository()
    • getPermissions

      @CheckForNull public Map<String,org.kohsuke.github.GHPermissionType> getPermissions()
    • isTrusted

      @CheckForNull public boolean isTrusted()
      Returns:
      true if the generated installation access token will only be used in a controlled scenario such as an organization folder scan or multibranch project branch indexing. false if the token will be available for arbitrary use, for example if it is bound using withCredentials in a Pipeline.
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object