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 on
applyNullSafe(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 factory GitHubServerConfig.loginToGithub()
- Author:
- lanwen (Merkushev Kirill)
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected org.kohsuke.github.GitHub
applyNullSafe
(GitHubServerConfig github) Called byNullSafeFunction.apply(Object)
Logins to GH and returns client instanceMethods inherited from class org.jenkinsci.plugins.github.util.misc.NullSafeFunction
apply
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.common.base.Function
equals
-
Constructor Details
-
GitHubLoginFunction
public GitHubLoginFunction()
-
-
Method Details
-
applyNullSafe
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
-