Class GitHubLoginFunction
- java.lang.Object
-
- org.jenkinsci.plugins.github.util.misc.NullSafeFunction<GitHubServerConfig,org.kohsuke.github.GitHub>
-
- org.jenkinsci.plugins.github.internal.GitHubLoginFunction
-
- All Implemented Interfaces:
com.google.common.base.Function<GitHubServerConfig,org.kohsuke.github.GitHub>
,Function<GitHubServerConfig,org.kohsuke.github.GitHub>
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class GitHubLoginFunction extends NullSafeFunction<GitHubServerConfig,org.kohsuke.github.GitHub>
Converts server config to authorized GH instance onapplyNullSafe(GitHubServerConfig)
. If login process is not successful it returns null Uses okHttp (https://github.com/square/okhttp) as connector to have ability to use cache and proxy The capacity of cache can be changed in advanced section of global configuration for plugin Don't use this class in any place directly as of it have public static factoryGitHubServerConfig.loginToGithub()
- Author:
- lanwen (Merkushev Kirill)
- See Also:
GitHubServerConfig.loginToGithub()
-
-
Constructor Summary
Constructors Constructor Description GitHubLoginFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.kohsuke.github.GitHub
applyNullSafe(GitHubServerConfig github)
Called byNullSafeFunction.apply(Object)
Logins to GH and returns client instance-
Methods inherited from class org.jenkinsci.plugins.github.util.misc.NullSafeFunction
apply
-
-
-
-
Method Detail
-
applyNullSafe
@CheckForNull protected org.kohsuke.github.GitHub applyNullSafe(@NonNull GitHubServerConfig github)
Called byNullSafeFunction.apply(Object)
Logins to GH and returns client instance- Specified by:
applyNullSafe
in classNullSafeFunction<GitHubServerConfig,org.kohsuke.github.GitHub>
- Parameters:
github
- config where token saved- Returns:
- authorized client or null on login error
-
-