Class SecretProvider
-
- All Implemented Interfaces:
public class SecretProviderSystem password provider, default 256bit, 32 characters
- Since:
2022-12-05
trydofor
-
-
Method Summary
Modifier and Type Method Description static Stringstrong(int len)Generate `len` length passwords of alphabetic, case-sensitive and numeric static Stringhuman(int len)Generate `len` length passwords with good readability of case-sensitive letters and numbers. static Stringget(String name)Get the secret by name, if not found, generate a default length strong password and cache it. static Stringget(String name, boolean computeIfAbsent)Get the secret by name, if not found and computeIfAbsent, generate a default length strong password and cache it. StringtryGet(String name)used for `@Bean` method static voidput(@NotNull() String name, @NotNull() String secret, boolean replace)put the secret by name -
-
Method Detail
-
strong
@NotNull() static String strong(int len)
Generate `len` length passwords of alphabetic, case-sensitive and numeric
-
human
@NotNull() static String human(int len)
Generate `len` length passwords with good readability of case-sensitive letters and numbers. total 32 Letter and Numbers, removing 30 (0oO,1il,cC,j,kK,mM,nN,pP,sS,uU,vV,wW,xX,y,zZ)
-
get
@NotNull() static String get(String name)
Get the secret by name, if not found, generate a default length strong password and cache it.
-
get
@Contract(value = "_,true->!null") static String get(String name, boolean computeIfAbsent)
Get the secret by name, if not found and computeIfAbsent, generate a default length strong password and cache it.
-
-
-
-