• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CanonicalWebUrl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.gerrit.server.config.CanonicalWebUrl的典型用法代码示例。如果您正苦于以下问题:Java CanonicalWebUrl类的具体用法?Java CanonicalWebUrl怎么用?Java CanonicalWebUrl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CanonicalWebUrl类属于com.google.gerrit.server.config包,在下文中一共展示了CanonicalWebUrl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: CasOAuthService

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
@Inject
CasOAuthService(
    PluginConfigFactory cfgFactory,
    @PluginName String pluginName,
    @CanonicalWebUrl Provider<String> urlProvider) {
  PluginConfig cfg = cfgFactory.getFromGerritConfig(pluginName + CONFIG_SUFFIX);
  rootUrl = cfg.getString(InitOAuth.ROOT_URL);
  String canonicalWebUrl = CharMatcher.is('/').trimTrailingFrom(urlProvider.get()) + "/";
  fixLegacyUserId = cfg.getBoolean(InitOAuth.FIX_LEGACY_USER_ID, false);
  service =
      new ServiceBuilder()
          .provider(new CasApi(rootUrl))
          .apiKey(cfg.getString(InitOAuth.CLIENT_ID))
          .apiSecret(cfg.getString(InitOAuth.CLIENT_SECRET))
          .callback(canonicalWebUrl + "oauth")
          .build();
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:18,代码来源:CasOAuthService.java


示例2: BitbucketOAuthService

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
@Inject
BitbucketOAuthService(
    PluginConfigFactory cfgFactory,
    @PluginName String pluginName,
    @CanonicalWebUrl Provider<String> urlProvider) {
  PluginConfig cfg = cfgFactory.getFromGerritConfig(pluginName + CONFIG_SUFFIX);

  String canonicalWebUrl = CharMatcher.is('/').trimTrailingFrom(urlProvider.get()) + "/";
  fixLegacyUserId = cfg.getBoolean(InitOAuth.FIX_LEGACY_USER_ID, false);
  service =
      new ServiceBuilder()
          .provider(BitbucketApi.class)
          .apiKey(cfg.getString(InitOAuth.CLIENT_ID))
          .apiSecret(cfg.getString(InitOAuth.CLIENT_SECRET))
          .callback(canonicalWebUrl + "oauth")
          .build();
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:18,代码来源:BitbucketOAuthService.java


示例3: GitLabOAuthService

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
@Inject
GitLabOAuthService(
    PluginConfigFactory cfgFactory,
    @PluginName String pluginName,
    @CanonicalWebUrl Provider<String> urlProvider) {
  PluginConfig cfg = cfgFactory.getFromGerritConfig(pluginName + CONFIG_SUFFIX);
  String canonicalWebUrl = CharMatcher.is('/').trimTrailingFrom(urlProvider.get()) + "/";
  rootUrl = cfg.getString(InitOAuth.ROOT_URL);
  service =
      new ServiceBuilder()
          .provider(new GitLabApi(rootUrl))
          .apiKey(cfg.getString(InitOAuth.CLIENT_ID))
          .apiSecret(cfg.getString(InitOAuth.CLIENT_SECRET))
          .callback(canonicalWebUrl + "oauth")
          .build();
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:17,代码来源:GitLabOAuthService.java


示例4: DexOAuthService

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
@Inject
DexOAuthService(
    PluginConfigFactory cfgFactory,
    @PluginName String pluginName,
    @CanonicalWebUrl Provider<String> urlProvider) {
  PluginConfig cfg = cfgFactory.getFromGerritConfig(pluginName + CONFIG_SUFFIX);
  String canonicalWebUrl = CharMatcher.is('/').trimTrailingFrom(urlProvider.get()) + "/";

  rootUrl = cfg.getString(InitOAuth.ROOT_URL);
  domain = cfg.getString(InitOAuth.DOMAIN, null);
  serviceName = cfg.getString(InitOAuth.SERVICE_NAME, "Dex OAuth2");

  service =
      new ServiceBuilder()
          .provider(new DexApi(rootUrl))
          .apiKey(cfg.getString(InitOAuth.CLIENT_ID))
          .apiSecret(cfg.getString(InitOAuth.CLIENT_SECRET))
          .scope("openid profile email offline_access")
          .callback(canonicalWebUrl + "oauth")
          .build();
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:22,代码来源:DexOAuthService.java


示例5: FacebookOAuthService

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
@Inject
FacebookOAuthService(
    PluginConfigFactory cfgFactory,
    @PluginName String pluginName,
    @CanonicalWebUrl Provider<String> urlProvider) {

  PluginConfig cfg = cfgFactory.getFromGerritConfig(pluginName + CONFIG_SUFFIX);
  String canonicalWebUrl = CharMatcher.is('/').trimTrailingFrom(urlProvider.get()) + "/";

  service =
      new ServiceBuilder()
          .provider(FacebookApi.class)
          .apiKey(cfg.getString(InitOAuth.CLIENT_ID))
          .apiSecret(cfg.getString(InitOAuth.CLIENT_SECRET))
          .callback(canonicalWebUrl + "oauth")
          .scope(SCOPE)
          .build();
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:19,代码来源:FacebookOAuthService.java


示例6: GitHubOAuthService

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
@Inject
GitHubOAuthService(
    PluginConfigFactory cfgFactory,
    @PluginName String pluginName,
    @CanonicalWebUrl Provider<String> urlProvider) {
  PluginConfig cfg = cfgFactory.getFromGerritConfig(pluginName + CONFIG_SUFFIX);
  String canonicalWebUrl = CharMatcher.is('/').trimTrailingFrom(urlProvider.get()) + "/";
  fixLegacyUserId = cfg.getBoolean(InitOAuth.FIX_LEGACY_USER_ID, false);
  service =
      new ServiceBuilder()
          .provider(GitHub2Api.class)
          .apiKey(cfg.getString(InitOAuth.CLIENT_ID))
          .apiSecret(cfg.getString(InitOAuth.CLIENT_SECRET))
          .callback(canonicalWebUrl + "oauth")
          .scope(SCOPE)
          .build();
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:18,代码来源:GitHubOAuthService.java


示例7: KeycloakOAuthService

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
@Inject
KeycloakOAuthService(
    PluginConfigFactory cfgFactory,
    @PluginName String pluginName,
    @CanonicalWebUrl Provider<String> urlProvider) {
  PluginConfig cfg = cfgFactory.getFromGerritConfig(pluginName + CONFIG_SUFFIX);
  String canonicalWebUrl = CharMatcher.is('/').trimTrailingFrom(urlProvider.get()) + "/";

  String rootUrl = cfg.getString(InitOAuth.ROOT_URL);
  String realm = cfg.getString(InitOAuth.REALM);
  serviceName = cfg.getString(InitOAuth.SERVICE_NAME, "Keycloak OAuth2");

  service =
      new ServiceBuilder()
          .provider(new KeycloakApi(rootUrl, realm))
          .apiKey(cfg.getString(InitOAuth.CLIENT_ID))
          .apiSecret(cfg.getString(InitOAuth.CLIENT_SECRET))
          .scope("openid")
          .callback(canonicalWebUrl + "oauth")
          .build();
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:22,代码来源:KeycloakOAuthService.java


示例8: Factory

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
@Inject
Factory(
    @GerritServerConfig Config cfg,
    Provider<InternalAccountQuery> accountQueryProvider,
    IdentifiedUser.GenericFactory userFactory,
    @CanonicalWebUrl String webUrl) {
  this.accountQueryProvider = accountQueryProvider;
  this.webUrl = webUrl;
  this.userFactory = userFactory;
  this.maxTrustDepth = cfg.getInt("receive", null, "maxTrustDepth", 0);

  String[] strs = cfg.getStringList("receive", null, "trustedKey");
  if (strs.length != 0) {
    Map<Long, Fingerprint> fps = Maps.newHashMapWithExpectedSize(strs.length);
    for (String str : strs) {
      str = CharMatcher.whitespace().removeFrom(str).toUpperCase();
      Fingerprint fp = new Fingerprint(BaseEncoding.base16().decode(str));
      fps.put(fp.getId(), fp);
    }
    trusted = ImmutableMap.copyOf(fps);
  } else {
    trusted = null;
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:25,代码来源:GerritPublicKeyChecker.java


示例9: Factory

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
@Inject
Factory(
    @GerritPersonIdent PersonIdent gerritIdent,
    @CanonicalWebUrl @Nullable String canonicalWebUrl,
    @GerritServerConfig Config cfg,
    DynamicSet<CommitValidationListener> pluginValidators,
    AllUsersName allUsers,
    AllProjectsName allProjects,
    ExternalIdsConsistencyChecker externalIdsConsistencyChecker,
    AccountValidator accountValidator,
    ProjectCache projectCache) {
  this.gerritIdent = gerritIdent;
  this.canonicalWebUrl = canonicalWebUrl;
  this.pluginValidators = pluginValidators;
  this.allUsers = allUsers;
  this.allProjects = allProjects;
  this.externalIdsConsistencyChecker = externalIdsConsistencyChecker;
  this.accountValidator = accountValidator;
  this.installCommitMsgHookCommand =
      cfg != null ? cfg.getString("gerrit", null, "installCommitMsgHookCommand") : null;
  this.projectCache = projectCache;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:23,代码来源:CommitValidators.java


示例10: MergeUtil

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
@AssistedInject
MergeUtil(
    @GerritServerConfig Config serverConfig,
    Provider<ReviewDb> db,
    IdentifiedUser.GenericFactory identifiedUserFactory,
    @CanonicalWebUrl @Nullable Provider<String> urlProvider,
    ApprovalsUtil approvalsUtil,
    PluggableCommitMessageGenerator commitMessageGenerator,
    @Assisted ProjectState project) {
  this(
      serverConfig,
      db,
      identifiedUserFactory,
      urlProvider,
      approvalsUtil,
      project,
      commitMessageGenerator,
      project.isUseContentMerge());
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:20,代码来源:MergeUtil.java


示例11: EventFactory

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
@Inject
EventFactory(
    AccountCache accountCache,
    Emails emails,
    @CanonicalWebUrl @Nullable Provider<String> urlProvider,
    PatchListCache patchListCache,
    @GerritPersonIdent PersonIdent myIdent,
    ChangeData.Factory changeDataFactory,
    ApprovalsUtil approvalsUtil,
    ChangeKindCache changeKindCache,
    Provider<InternalChangeQuery> queryProvider,
    SchemaFactory<ReviewDb> schema) {
  this.accountCache = accountCache;
  this.emails = emails;
  this.urlProvider = urlProvider;
  this.patchListCache = patchListCache;
  this.myIdent = myIdent;
  this.changeDataFactory = changeDataFactory;
  this.approvalsUtil = approvalsUtil;
  this.changeKindCache = changeKindCache;
  this.queryProvider = queryProvider;
  this.schema = schema;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:24,代码来源:EventFactory.java


示例12: wrapImpl

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
/** @see RequestScopePropagator#wrap(Callable) */
// ServletScopes#continueRequest is deprecated, but it's not obvious their
// recommended replacement is an appropriate drop-in solution; see
// https://gerrit-review.googlesource.com/83971
@SuppressWarnings("deprecation")
@Override
protected <T> Callable<T> wrapImpl(Callable<T> callable) {
  Map<Key<?>, Object> seedMap = new HashMap<>();

  // Request scopes appear to use specific keys in their map, instead of only
  // providers. Add bindings for both the key to the instance directly and the
  // provider to the instance to be safe.
  seedMap.put(Key.get(typeOfProvider(String.class), CanonicalWebUrl.class), Providers.of(url));
  seedMap.put(Key.get(String.class, CanonicalWebUrl.class), url);

  seedMap.put(Key.get(typeOfProvider(SocketAddress.class), RemotePeer.class), Providers.of(peer));
  seedMap.put(Key.get(SocketAddress.class, RemotePeer.class), peer);

  return ServletScopes.continueRequest(callable, seedMap);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:21,代码来源:GuiceRequestScopePropagator.java


示例13: GenericFactory

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
@Inject
public GenericFactory(
    AuthConfig authConfig,
    Realm realm,
    @AnonymousCowardName String anonymousCowardName,
    @CanonicalWebUrl Provider<String> canonicalUrl,
    @DisableReverseDnsLookup Boolean disableReverseDnsLookup,
    AccountCache accountCache,
    GroupBackend groupBackend) {
  this.authConfig = authConfig;
  this.realm = realm;
  this.anonymousCowardName = anonymousCowardName;
  this.canonicalUrl = canonicalUrl;
  this.accountCache = accountCache;
  this.groupBackend = groupBackend;
  this.disableReverseDnsLookup = disableReverseDnsLookup;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:18,代码来源:IdentifiedUser.java


示例14: RequestFactory

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
@Inject
RequestFactory(
    AuthConfig authConfig,
    Realm realm,
    @AnonymousCowardName String anonymousCowardName,
    @CanonicalWebUrl Provider<String> canonicalUrl,
    AccountCache accountCache,
    GroupBackend groupBackend,
    @DisableReverseDnsLookup Boolean disableReverseDnsLookup,
    @RemotePeer Provider<SocketAddress> remotePeerProvider) {
  this.authConfig = authConfig;
  this.realm = realm;
  this.anonymousCowardName = anonymousCowardName;
  this.canonicalUrl = canonicalUrl;
  this.accountCache = accountCache;
  this.groupBackend = groupBackend;
  this.disableReverseDnsLookup = disableReverseDnsLookup;
  this.remotePeerProvider = remotePeerProvider;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:20,代码来源:IdentifiedUser.java


示例15: AnonymousHttpScheme

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
@Inject
public AnonymousHttpScheme(
    @GerritServerConfig Config cfg,
    @CanonicalWebUrl @Nullable Provider<String> provider,
    DownloadConfig downloadConfig) {
  this.gitHttpUrl = ensureSlash(cfg.getString("gerrit", null, "gitHttpUrl"));
  this.canonicalWebUrl = provider != null ? provider.get() : null;
  this.schemeAllowed = downloadConfig.getDownloadSchemes().contains(ANON_HTTP);
}
 
开发者ID:GerritCodeReview,项目名称:plugins_download-commands,代码行数:10,代码来源:AnonymousHttpScheme.java


示例16: HttpScheme

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
@Inject
public HttpScheme(
    @GerritServerConfig Config cfg,
    @CanonicalWebUrl @Nullable Provider<String> urlProvider,
    Provider<CurrentUser> userProvider,
    DownloadConfig downloadConfig) {
  this.gitHttpUrl = ensureSlash(cfg.getString("gerrit", null, "gitHttpUrl"));
  this.canonicalWebUrl = urlProvider != null ? urlProvider.get() : null;
  this.userProvider = userProvider;
  this.schemeAllowed = downloadConfig.getDownloadSchemes().contains(HTTP);
}
 
开发者ID:GerritCodeReview,项目名称:plugins_download-commands,代码行数:12,代码来源:HttpScheme.java


示例17: GoogleOAuthService

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
@Inject
GoogleOAuthService(
    PluginConfigFactory cfgFactory,
    @PluginName String pluginName,
    @CanonicalWebUrl Provider<String> urlProvider) {
  PluginConfig cfg = cfgFactory.getFromGerritConfig(pluginName + CONFIG_SUFFIX);
  this.canonicalWebUrl = CharMatcher.is('/').trimTrailingFrom(urlProvider.get()) + "/";
  if (cfg.getBoolean(InitOAuth.LINK_TO_EXISTING_OPENID_ACCOUNT, false)) {
    log.warn(
        String.format(
            "The support for: %s is disconinued", InitOAuth.LINK_TO_EXISTING_OPENID_ACCOUNT));
  }
  fixLegacyUserId = cfg.getBoolean(InitOAuth.FIX_LEGACY_USER_ID, false);
  this.domains = Arrays.asList(cfg.getStringList(InitOAuth.DOMAIN));
  this.useEmailAsUsername = cfg.getBoolean(InitOAuth.USE_EMAIL_AS_USERNAME, false);
  this.service =
      new ServiceBuilder()
          .provider(Google2Api.class)
          .apiKey(cfg.getString(InitOAuth.CLIENT_ID))
          .apiSecret(cfg.getString(InitOAuth.CLIENT_SECRET))
          .callback(canonicalWebUrl + "oauth")
          .scope(SCOPE)
          .build();
  if (log.isDebugEnabled()) {
    log.debug("OAuth2: canonicalWebUrl={}", canonicalWebUrl);
    log.debug("OAuth2: scope={}", SCOPE);
    log.debug("OAuth2: domains={}", domains);
    log.debug("OAuth2: useEmailAsUsername={}", useEmailAsUsername);
  }
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:31,代码来源:GoogleOAuthService.java


示例18: JobsServlet

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
@Inject
public JobsServlet(final ProjectControl.Factory projectControlFactory,
                   final GerritConfig gerritConfig, @CanonicalWebUrl String canonicalWebUrl,
                   final SitePaths sitePaths) {
    this.projectControlFactory = projectControlFactory;
    this.gerritConfig = gerritConfig;
    this.canonicalWebUrl = canonicalWebUrl;
    this.sitePaths = sitePaths;
}
 
开发者ID:palantir,项目名称:gerrit-ci,代码行数:10,代码来源:JobsServlet.java


示例19: MessageFactory

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
@Inject
MessageFactory(
    IdentifiedUser user, SshInfo sshInfo, @CanonicalWebUrl Provider<String> urlProvider) {
  this.user = user;
  this.sshInfo = sshInfo;
  this.urlProvider = urlProvider;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:8,代码来源:NoShell.java


示例20: OAuthOverOpenIDLogoutServlet

import com.google.gerrit.server.config.CanonicalWebUrl; //导入依赖的package包/类
@Inject
OAuthOverOpenIDLogoutServlet(
    AuthConfig authConfig,
    DynamicItem<WebSession> webSession,
    @CanonicalWebUrl @Nullable Provider<String> urlProvider,
    AuditService audit,
    Provider<OAuthSessionOverOpenID> oauthSession) {
  super(authConfig, webSession, urlProvider, audit);
  this.oauthSession = oauthSession;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:11,代码来源:OAuthOverOpenIDLogoutServlet.java



注:本文中的com.google.gerrit.server.config.CanonicalWebUrl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TrecTopicsReader类代码示例发布时间:2022-05-22
下一篇:
Java FragmentDelegate类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap