Class StrongOptions
-strong* options of the server's command line (CC-SERVERADMIN-STRONG-AUTH, section 3.2 of the design of order 475, SA-D-6 (a)): after -app and before its -appjar or -project, in the one-parameter style of every other option, they set the strong authentication policy of that application - source S3 of the policy's resolution, as the six strong* properties of the application's definition in config.iiziServer do:-app com.example.bank -strongcount 2 -strongmandatory passkey -strongdevice strict -appjar bank.jar
Every value goes through the policy's own parser (StrongAuthPolicy.Source.of(String, String, String, String, String, String, String)), so what the file refuses the command line refuses the same way: a value outside its range or above the supported maximum (CC-FIX-SIGNIN-STRONG-SUPPORTED-MAX) is refused where the option is read, naming the option, the value and what is supported, and the server does not start (exit 9 with one SEVERE, like the file); the rules among the six keys (StrongAuthPolicy.checkSource(String, UnaryOperator)) are checked when the application's definition is complete.
When the configuration file defines the application too, the command line's strong values are combined with the file's, the strictest winning field by field (SA-D-6 (a)): a command line can raise the protection of a deployed application and never lower it. The combination is made where the policy is resolved (SignInPolicies.strong, from the AppDefinition the command line built); the file's definition is never changed by it, so a later save of the configuration from ServerAdmin does not write what the command line said. decided(StrongAuthPolicy.Source, StrongAuthPolicy.Source) says which source decided each key, for the log.
- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]The six options, lower case, in the order ofStrongAuthPolicy.KEYS.static final StringThe prefix of the options: "-strong", followed by the key (-strongcount, ...).Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionbuild()Builds the source of the options given, checked as one level (StrongAuthPolicy.checkSource(String, UnaryOperator): the rules among the six keys, a floor above the count, a mandatory factor outside the allowed ones).static Stringdecided(StrongAuthPolicy.Source file, StrongAuthPolicy.Source commandLine) Says which source decided each key of the combination of a file's definition with a command line's options, the strictest winning field by field (SA-D-6 (a)): for the log line of the start.booleanisEmpty()Checks if any of the six was given.static booleanChecks if an option is one of the six.voidSets an option as it was typed: the value is parsed at once, so a bad one is refused where it stands.
Field Details
PREFIX
The prefix of the options: "-strong", followed by the key (-strongcount, ...). The parser is handed it as the prefix of the keys, so a refusal names the option as it was typed.- See Also:
OPTIONS
The six options, lower case, in the order ofStrongAuthPolicy.KEYS.
Constructor Details
StrongOptions
public StrongOptions()Creates the options of one application, none given.
Method Details
isOption
Checks if an option is one of the six.- Parameters:
option- The option, lower case.- Returns:
- true for
-strongcount, ...,-strongwho.
isEmpty
public boolean isEmpty()Checks if any of the six was given.- Returns:
- true when at least one option was set.
set
Sets an option as it was typed: the value is parsed at once, so a bad one is refused where it stands.- Parameters:
option- One of the six options, lower case.value- Its parameter.- Throws:
IllegalArgumentException- If the option is none of the six, was given twice, or its value is outside its range or above the supported maximum; the message names the option, the value and what is supported.
build
Builds the source of the options given, checked as one level (StrongAuthPolicy.checkSource(String, UnaryOperator): the rules among the six keys, a floor above the count, a mandatory factor outside the allowed ones).- Returns:
- The source,
StrongAuthPolicy.Source.NONEwhen no option was given. - Throws:
IllegalArgumentException- If the six break a rule among themselves; the message names the keys.
decided
Says which source decided each key of the combination of a file's definition with a command line's options, the strictest winning field by field (SA-D-6 (a)): for the log line of the start.- Parameters:
file- What the file's definition sets.commandLine- What the command line sets.- Returns:
- E.g.
count=2 (the command line), mandatory=[passkey] (the file), device=strict (both); the keys neither sets are left out;nothingwhen neither sets anything.