keycloak-service
静的公開メンバ関数 | 全メンバ一覧
org.keycloak.authentication.actiontoken.TokenUtils クラス
org.keycloak.authentication.actiontoken.TokenUtils 連携図
Collaboration graph

静的公開メンバ関数

static Predicate< JsonWebToken > checkThat (BooleanSupplier function, String errorEvent, String errorMessage)
 
static< T extends JsonWebToken > Predicate< T > checkThat (java.util.function.Predicate< T > function, String errorEvent, String errorMessage)
 
static< T extends JsonWebToken > Predicate< T > onlyIf (java.util.function.Predicate< T > condition, Predicate< T > predicate)
 
static< T extends JsonWebToken > Predicate<? super T > [] predicates (Predicate<? super T >... predicate)
 

詳解

著者
hmlnarik

関数詳解

◆ checkThat() [1/2]

static Predicate<JsonWebToken> org.keycloak.authentication.actiontoken.TokenUtils.checkThat ( BooleanSupplier  function,
String  errorEvent,
String  errorMessage 
)
inlinestatic

Returns a predicate for use in TokenVerifier using the given boolean-returning function. When the function return

false

, this predicate throws a ExplainedTokenVerificationException with

message

and

errorEvent

set from

errorMessage

and

errorEvent

, .

引数
function
errorEvent
errorMessage
戻り値
39  {
40  return (JsonWebToken t) -> {
41  if (! function.getAsBoolean()) {
42  throw new ExplainedTokenVerificationException(t, errorEvent, errorMessage);
43  }
44 
45  return true;
46  };
47  }

◆ checkThat() [2/2]

static <T extends JsonWebToken> Predicate<T> org.keycloak.authentication.actiontoken.TokenUtils.checkThat ( java.util.function.Predicate< T >  function,
String  errorEvent,
String  errorMessage 
)
inlinestatic

Returns a predicate for use in TokenVerifier using the given boolean-returning function. When the function return

false

, this predicate throws a ExplainedTokenVerificationException with

message

and

errorEvent

set from

errorMessage

and

errorEvent

, .

引数
function
errorEvent
errorMessage
戻り値
59  {
60  return (T t) -> {
61  if (! function.test(t)) {
62  throw new ExplainedTokenVerificationException(t, errorEvent, errorMessage);
63  }
64 
65  return true;
66  };
67  }

◆ onlyIf()

static <T extends JsonWebToken> Predicate<T> org.keycloak.authentication.actiontoken.TokenUtils.onlyIf ( java.util.function.Predicate< T >  condition,
Predicate< T >  predicate 
)
inlinestatic

Returns a predicate that is applied only if the given

condition

evaluates to {}. In case it evaluates to

false

, the predicate passes.

引数
<T>
conditionCondition guarding execution of the predicate
predicatePredicate that gets tested if the condition evaluates to
true
戻り値
78  {
79  return t -> (! condition.test(t)) || predicate.test(t);
80  }

◆ predicates()

static <T extends JsonWebToken> Predicate<? super T> [] org.keycloak.authentication.actiontoken.TokenUtils.predicates ( Predicate<? super T >...  predicate)
inlinestatic
82  {
83  return predicate;
84  }

このクラス詳解は次のファイルから抽出されました: