operator/src/main/java/oracle/kubernetes/operator/helpers/AuthenticationProxy.java
public V1TokenReviewStatus check(String principal, String token) {

    LOGGER.entering(principal); // Don't expose the token since it's a credential

    V1TokenReview result = null;
    try {
      boolean allowed =
          authorizationProxy.check(
              principal,
              AuthorizationProxy.Operation.create,
              AuthorizationProxy.Resource.TOKENREVIEWS,
              null,
              AuthorizationProxy.Scope.cluster,
              null);
      if (allowed) {
        result = new CallBuilder().createTokenReview(prepareTokenReview(token));
      } else {
        LOGGER.warning(MessageKeys.CANNOT_CREATE_TOKEN_REVIEW);
      }
    } catch (ApiException e) {
      LOGGER.severe(MessageKeys.APIEXCEPTION_FROM_TOKEN_REVIEW, e);
      LOGGER.exiting(null);
      return null;
    }
    LOGGER.fine("Returned TokenReview", result);
    V1TokenReviewStatus status = result != null ? result.getStatus() : null;
    LOGGER.exiting(status);
    return status;
  }
/**
   * Check if the specified access token can be authenticated.
   *
   * @param principal The user, group or service account.
   * @param token The access token that identifies the user.
   * @return V1TokenReviewStatus containing either info about the authenticated user or an error
   *     explaining why the user couldn't be authenticated
   */
Check if the specified access token can be authenticated.
@param principal The user, group or service account.
@param token The access token that identifies the user.
@return V1TokenReviewStatus containing either info about the authenticated user or an error
explaining why the user couldn't be authenticated
Check if the specified access token can be authenticated . @param principal The user group or service account . @param token The access token that identifies the user . @return V1TokenReviewStatus containing either info about the authenticated user or an error explaining why the user couldn ' t be authenticated
public V1TokenReviewStatus check(String principal, String token) {
    LOGGER.entering(principal); 
    V1TokenReview result = null;
    try {
      boolean allowed =
          authorizationProxy.check(
              principal,
              AuthorizationProxy.Operation.create,
              AuthorizationProxy.Resource.TOKENREVIEWS,
              null,
              AuthorizationProxy.Scope.cluster,
              null);
      if (allowed) {
        result = new CallBuilder().createTokenReview(prepareTokenReview(token));
      } else {
        LOGGER.warning(MessageKeys.CANNOT_CREATE_TOKEN_REVIEW);
      }
    } catch (ApiException e) {
      LOGGER.severe(MessageKeys.APIEXCEPTION_FROM_TOKEN_REVIEW, e);
      LOGGER.exiting(null);
      return null;
    }
    LOGGER.fine("Returned TokenReview", result);
    V1TokenReviewStatus status = result != null ? result.getStatus() : null;
    LOGGER.exiting(status);
    return status;
  }
public V1TokenReviewStatus check ( String principal , String token ) { LOGGER . entering ( principal ) ; V1TokenReview result = null ; try { boolean allowed = authorizationProxy . check ( principal , AuthorizationProxy . Operation . create , AuthorizationProxy . Resource . TOKENREVIEWS , null , AuthorizationProxy . Scope . cluster , null ) ; if ( allowed ) { result = new CallBuilder ( ) . createTokenReview ( prepareTokenReview ( token ) ) ; } else { LOGGER . warning ( MessageKeys . CANNOT_CREATE_TOKEN_REVIEW ) ; } } catch ( ApiException e ) { LOGGER . severe ( MessageKeys . APIEXCEPTION_FROM_TOKEN_REVIEW , e ) ; LOGGER . exiting ( null ) ; return null ; } LOGGER . fine ( "Returned TokenReview" , result ) ; V1TokenReviewStatus status = result != null ? result . getStatus ( ) : null ; LOGGER . exiting ( status ) ; return status ; }
Check if the specified access token can be authenticated.
Check if the specified access token can be authenticated .
// Don't expose the token since it's a credential