public UserInfo loadUserInfo(final PendingOIDCAuthenticationToken token) {
   try {
     return cache.get(token);
   } catch (UncheckedExecutionException | ExecutionException e) {
     logger.warn("Couldn't load User Info from token: " + e.getMessage());
     return null;
   }
 }
Exemple #2
0
  public TargetNode<?> getTargetNode(
      final BuckEventBus eventBus,
      final Cell cell,
      final ProjectBuildFileParser parser,
      final BuildTarget target,
      final TargetNodeListener nodeListener)
      throws BuildFileParseException, BuildTargetException, InterruptedException {
    invalidateIfProjectBuildFileParserStateChanged(cell);
    try {
      return allTargetNodes.get(
          target,
          new Callable<TargetNode<?>>() {
            @Override
            public TargetNode<?> call() throws Exception {
              Path buildFile = cell.getAbsolutePathToBuildFile(target);
              Preconditions.checkState(buildFile.isAbsolute());
              List<Map<String, Object>> rawNodes = loadRawNodes(cell, buildFile, parser);

              for (Map<String, Object> rawNode : rawNodes) {
                Object shortName = rawNode.get("name");

                if (target.getShortName().equals(shortName)) {
                  return createTargetNode(eventBus, cell, buildFile, target, rawNode, nodeListener);
                }
              }

              throw new HumanReadableException(
                  NoSuchBuildTargetException.createForMissingBuildRule(
                      target,
                      BuildTargetPatternParser.forBaseName(target.getBaseName()),
                      cell.getBuildFileName(),
                      "Defined in file: " + buildFile));
            }
          });
    } catch (UncheckedExecutionException | ExecutionException e) {
      Throwables.propagateIfInstanceOf(e.getCause(), BuildTargetException.class);
      throw propagate(e);
    }
  }