Class OA2ClientCommands
- java.lang.Object
-
- edu.uiuc.ncsa.security.util.cli.CommonCommands
-
- edu.uiuc.ncsa.security.storage.cli.StoreCommands
-
- org.oa4mp.server.admin.base.oauth2.myproxy.StoreCommands2
-
- org.oa4mp.server.admin.base.oauth2.myproxy.BaseClientStoreCommands
-
- org.oa4mp.server.admin.base.oauth2.myproxy.ClientStoreCommands
-
- org.oa4mp.server.admin.tools.oauth2.myproxy.OA2ClientCommands
-
- All Implemented Interfaces:
edu.uiuc.ncsa.security.core.Logable
,edu.uiuc.ncsa.security.util.cli.Commands
public class OA2ClientCommands extends ClientStoreCommands
Created by Jeff Gaynor
on 4/3/14 at 3:24 PM
-
-
Field Summary
Fields Modifier and Type Field Description static String
ABORT_COMMENT_INPUT_CHAR
static String
E_ADMIN_ID_FLAG
static String
E_CREATE_FLAG
static String
E_LINK_FLAG
static String
E_LIST_AS_ARRAY_FLAG
static String
E_LIST_AS_JSON_FLAG
static String
E_LIST_AS_MULTILINE_FLAG
static String
E_LIST_FLAG
static String
E_UNLINK_FLAG
static String
END_COMMENT_INPUT_CHAR
static int
ERSATZ_CREATE_MAGIC_NUMBER
static String
NO_STILE_FLAG
static String
UUC_FLAG_CFG
static String
UUC_FLAG_ENABLE
static String
UUC_FLAG_FOUND
static String
UUC_FLAG_TEST
-
Fields inherited from class edu.uiuc.ncsa.myproxy.oauth2.base.BaseClientStoreCommands
clientApprovalStoreCommands, RESET_SECRET_DEFAULT_SIZE, RESET_SECRET_NEW_FLAG, RESET_SECRET_SIZE_FLAG
-
Fields inherited from class edu.uiuc.ncsa.security.storage.cli.StoreCommands
ALL_LIST_COMMAND, allEntries, DEFAULT_MAGIC_NUMBER, display_width, FILE_FLAG, FORCE_COPY_FLAG, KEY_SHORTHAND_PREFIX, LINE_LIST_COMMAND, NEXT_N_COMMAND, RANDOM_ID_FLAG, resultSets, RM_FORCE_FLAG, RS_CLEAR_KEY, RS_LIST_INFO_KEY, RS_REMOVE_KEY, RS_SHOW_KEY, SEARCH_AFTER_TS_FLAG, SEARCH_BEFORE_TS_FLAG, SEARCH_DATE_FLAG, SEARCH_DEBUG_FLAG, SEARCH_REGEX_FLAG, SEARCH_RESULT_SET_NAME, SEARCH_RETURNED_ATTRIBUTES_FLAG, SEARCH_SHORT_REGEX_FLAG, SEARCH_SIZE_FLAG, SHORT_UPDATE_FLAG, SIZE_ALL_FLAG, SIZE_VERSIONS_FLAG, sortable, UPDATE_FLAG, UPKEEP_FLAG_CFG, UPKEEP_FLAG_ENABLE, UPKEEP_FLAG_RUN, UPKEEP_FLAG_SHOW, UPKEEP_FLAG_TEST, VERBOSE_COMMAND
-
-
Constructor Summary
Constructors Constructor Description OA2ClientCommands(edu.uiuc.ncsa.security.core.util.MyLoggingFacade logger, edu.uiuc.ncsa.security.core.Store store)
OA2ClientCommands(edu.uiuc.ncsa.security.core.util.MyLoggingFacade logger, String defaultIndent, edu.uiuc.ncsa.security.core.Store clientStore, ClientApprovalStoreCommands clientApprovalStoreCommands, org.oa4mp.server.api.permissions.admin.PermissionsStore permissionsStore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BaseClient
approvalMods(edu.uiuc.ncsa.security.util.cli.InputLine inputLine, BaseClient client)
If there are modifications to the client before saving its approval (e.g.void
bootstrap()
void
cb(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
void
ea_support(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
void
ersatz(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
void
extraUpdates(edu.uiuc.ncsa.security.core.Identifiable identifiable, int magicNumber)
In this case, the secret has to be gotten and processed into a hash, callback uris listed and the refresh token lifetime set.void
get_comment(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
protected Collection<String>
getCBS(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
org.oa4mp.server.api.permissions.admin.PermissionsStore
getPermissionsStore()
Collection<String>
getSupportedScopes()
UUCConfiguration
getUucConfiguration()
protected boolean
hasEChain(org.oa4mp.server.api.permissions.admin.PermissionList permissions, List<edu.uiuc.ncsa.security.core.Identifier> eChain)
boolean
isRefreshTokensEnabled()
protected void
linkErsatz(org.oa4mp.server.loader.oauth2.storage.clients.OA2Client provisioner, edu.uiuc.ncsa.security.core.Identifier adminID, List<edu.uiuc.ncsa.security.core.Identifier> ersatz)
protected edu.uiuc.ncsa.security.core.Identifiable
preCreation(edu.uiuc.ncsa.security.core.Identifiable identifiable, int magicNumber)
void
print_help()
protected List<String>
processCommaSeparatedList(String key, String moniker, String defaultValue)
protected List<String>
processCommaSeparatedList(String key, List<String> legalValues, String moniker, String defaultValue)
Prompt for a comma separated list, parse it an return it.protected void
processDBAdd(org.oa4mp.server.loader.oauth2.storage.clients.OA2Client client, Collection<String> newArgs)
protected void
removeCB(org.oa4mp.server.loader.oauth2.storage.clients.OA2Client client, Collection<String> cbs)
void
resolve(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
protected void
rmCleanup(edu.uiuc.ncsa.security.core.Identifiable x)
void
serialize(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
void
set_comment(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
void
setPermissionsStore(org.oa4mp.server.api.permissions.admin.PermissionsStore permissionsStore)
void
setRefreshTokensEnabled(boolean refreshTokensEnabled)
void
setSupportedScopes(Collection<String> supportedScopes)
void
setUucConfiguration(UUCConfiguration uucConfiguration)
protected void
showCBHelp()
protected void
showDeserializeHelp()
protected void
showErsatzHelp()
protected void
showSerializeHelp()
protected boolean
supportsQDL()
protected void
unlinkErsatz(org.oa4mp.server.loader.oauth2.storage.clients.OA2Client provisioner, edu.uiuc.ncsa.security.core.Identifier adminID, List<edu.uiuc.ncsa.security.core.Identifier> ersatz)
protected boolean
updateSingleValue(edu.uiuc.ncsa.security.storage.XMLMap map, String key)
-
Methods inherited from class edu.uiuc.ncsa.myproxy.oauth2.base.ClientStoreCommands
doCopy, doRename, getName, longFormat, update
-
Methods inherited from class edu.uiuc.ncsa.myproxy.oauth2.base.BaseClientStoreCommands
approve, approve, approver_search, archiveFormat, create, create_hash, format, format, getClientApprovalStore, getPublicKeyFile, getSecret, getSortable, inputJSON, inputJSON, isCARS, listAll, longFormat, longFormat, password, reset_secret, rm, rs, showApproveHelp, showCreateHashHelp, status_search
-
Methods inherited from class edu.uiuc.ncsa.myproxy.oauth2.base.StoreCommands2
decode, encode, getEnvironment, main
-
Methods inherited from class edu.uiuc.ncsa.security.storage.cli.StoreCommands
actualCreate, addEntry, addEntry, archive, clear_id, clear_store, clearEntries, copy, create, create, createEntry, createNew, deserialize, edit, escapeRegex, findItem, formatLongLine, fromXMLMap, get_id, getAndCheckKeyArg, getArgList, getEditorEntry, getID, getKeyArg, getKeyArg, getMapConverter, getPrompt, getResultSets, getSerializationKeys, getStore, getStoreArchiver, getTempDir, hasEntries, hasId, hasID, hasKey, inputJSON, isMonitored, list_keys, loadAllEntries, loadQDLScript, longFormat, ls, multiLineInput, multiLinePropertyInput, oldls, oldrm, oldUpdate, printRS, removeEntries, removeEntry, rename, search, serialize, set_id, setEnvironment, setID, setIDFromInputLine, setResultSets, setSortable, setStore, showArchiveHelp, showCommandLineSwitchesHelp, showCreateHelp, showEntries, showEntry, showKeyShorthandHelp, showListKeysHelp, showLSHelp, showLSHelp3, showResultSetHelp, showRMHelp, showSearchHelp, showSearchHelpExamples, showSizeHelp, showUpdateHelp, showUpkeepHelp, size, toXMLMap, update, update, updateSingleValue, upkeep
-
Methods inherited from class edu.uiuc.ncsa.security.util.cli.CommonCommands
clear_env, clearEnvHelp, debug, echo, echoHelp, error, get_env, getBufferedReader, getDriver, getHelpUtil, getInput, getIOInterface, getPlaceHolder, getPropertyHelp, getValue, gracefulExit, indentWidth, info, isBatch, isBatchFile, isBatchMode, isDebugOn, isEmpty, isOk, isPrintOuput, isVerbose, logit, print_env, printEnvHelp, printGetEnvHelp, printReadEnvHelp, printSaveEnvHelp, printSetEnvHelp, read_env, readFile, readJSON, readline, readline, save_env, say, say, say2, sayi, sayii, sayv, set_env, set_output_on, set_verbose_on, setBatchFile, setBatchMode, setBufferedReader, setDebugOn, setDriver, setHelpUtil, setIOInterface, setOutputOnHelp, setPlaceHolder, setPrintOuput, setVerbose, setVerboseHelp, showHelp, version, versionHelp, warn
-
-
-
-
Field Detail
-
NO_STILE_FLAG
public static String NO_STILE_FLAG
-
END_COMMENT_INPUT_CHAR
public static String END_COMMENT_INPUT_CHAR
-
ABORT_COMMENT_INPUT_CHAR
public static String ABORT_COMMENT_INPUT_CHAR
-
UUC_FLAG_TEST
public static String UUC_FLAG_TEST
-
UUC_FLAG_CFG
public static String UUC_FLAG_CFG
-
UUC_FLAG_FOUND
public static String UUC_FLAG_FOUND
-
UUC_FLAG_ENABLE
public static String UUC_FLAG_ENABLE
-
E_CREATE_FLAG
public static String E_CREATE_FLAG
-
E_LINK_FLAG
public static String E_LINK_FLAG
-
E_LIST_FLAG
public static String E_LIST_FLAG
-
E_LIST_AS_ARRAY_FLAG
public static String E_LIST_AS_ARRAY_FLAG
-
E_LIST_AS_JSON_FLAG
public static String E_LIST_AS_JSON_FLAG
-
E_LIST_AS_MULTILINE_FLAG
public static String E_LIST_AS_MULTILINE_FLAG
-
E_UNLINK_FLAG
public static String E_UNLINK_FLAG
-
E_ADMIN_ID_FLAG
public static String E_ADMIN_ID_FLAG
-
ERSATZ_CREATE_MAGIC_NUMBER
public static final int ERSATZ_CREATE_MAGIC_NUMBER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OA2ClientCommands
public OA2ClientCommands(edu.uiuc.ncsa.security.core.util.MyLoggingFacade logger, String defaultIndent, edu.uiuc.ncsa.security.core.Store clientStore, ClientApprovalStoreCommands clientApprovalStoreCommands, org.oa4mp.server.api.permissions.admin.PermissionsStore permissionsStore) throws Throwable
- Throws:
Throwable
-
-
Method Detail
-
getPermissionsStore
public org.oa4mp.server.api.permissions.admin.PermissionsStore getPermissionsStore()
-
setPermissionsStore
public void setPermissionsStore(org.oa4mp.server.api.permissions.admin.PermissionsStore permissionsStore)
-
getUucConfiguration
public UUCConfiguration getUucConfiguration()
-
setUucConfiguration
public void setUucConfiguration(UUCConfiguration uucConfiguration)
-
isRefreshTokensEnabled
public boolean isRefreshTokensEnabled()
-
setRefreshTokensEnabled
public void setRefreshTokensEnabled(boolean refreshTokensEnabled)
-
getSupportedScopes
public Collection<String> getSupportedScopes()
-
setSupportedScopes
public void setSupportedScopes(Collection<String> supportedScopes)
-
print_help
public void print_help() throws Exception
- Specified by:
print_help
in interfaceedu.uiuc.ncsa.security.util.cli.Commands
- Overrides:
print_help
in classBaseClientStoreCommands
- Throws:
Exception
-
showCBHelp
protected void showCBHelp()
-
cb
public void cb(edu.uiuc.ncsa.security.util.cli.InputLine inputLine) throws IOException
- Throws:
IOException
-
removeCB
protected void removeCB(org.oa4mp.server.loader.oauth2.storage.clients.OA2Client client, Collection<String> cbs) throws IOException
- Throws:
IOException
-
getCBS
protected Collection<String> getCBS(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
-
processDBAdd
protected void processDBAdd(org.oa4mp.server.loader.oauth2.storage.clients.OA2Client client, Collection<String> newArgs) throws IOException
- Throws:
IOException
-
extraUpdates
public void extraUpdates(edu.uiuc.ncsa.security.core.Identifiable identifiable, int magicNumber) throws IOException
In this case, the secret has to be gotten and processed into a hash, callback uris listed and the refresh token lifetime set.Caveat: This is also called for mass updates, not just create so always check for existing values.
- Overrides:
extraUpdates
in classClientStoreCommands
- Parameters:
identifiable
-- Throws:
IOException
-
processCommaSeparatedList
protected List<String> processCommaSeparatedList(String key, String moniker, String defaultValue) throws IOException
- Throws:
IOException
-
processCommaSeparatedList
protected List<String> processCommaSeparatedList(String key, List<String> legalValues, String moniker, String defaultValue) throws IOException
Prompt for a comma separated list, parse it an return it. The moniker identifies what goes on the list, the legalValues (if present) restrict the values to what is on that list.- Parameters:
legalValues
-moniker
-defaultValue
-- Returns:
- Throws:
IOException
-
supportsQDL
protected boolean supportsQDL()
- Overrides:
supportsQDL
in classedu.uiuc.ncsa.security.storage.cli.StoreCommands
-
showDeserializeHelp
protected void showDeserializeHelp()
- Overrides:
showDeserializeHelp
in classedu.uiuc.ncsa.security.storage.cli.StoreCommands
-
updateSingleValue
protected boolean updateSingleValue(edu.uiuc.ncsa.security.storage.XMLMap map, String key) throws IOException
- Overrides:
updateSingleValue
in classedu.uiuc.ncsa.security.storage.cli.StoreCommands
- Throws:
IOException
-
get_comment
public void get_comment(edu.uiuc.ncsa.security.util.cli.InputLine inputLine) throws Throwable
- Throws:
Throwable
-
set_comment
public void set_comment(edu.uiuc.ncsa.security.util.cli.InputLine inputLine) throws Throwable
- Throws:
Throwable
-
resolve
public void resolve(edu.uiuc.ncsa.security.util.cli.InputLine inputLine) throws Exception
- Throws:
Exception
-
showSerializeHelp
protected void showSerializeHelp()
- Overrides:
showSerializeHelp
in classedu.uiuc.ncsa.security.storage.cli.StoreCommands
-
serialize
public void serialize(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
- Overrides:
serialize
in classedu.uiuc.ncsa.security.storage.cli.StoreCommands
-
ea_support
public void ea_support(edu.uiuc.ncsa.security.util.cli.InputLine inputLine) throws Exception
- Throws:
Exception
-
bootstrap
public void bootstrap() throws Throwable
- Specified by:
bootstrap
in interfaceedu.uiuc.ncsa.security.util.cli.Commands
- Overrides:
bootstrap
in classedu.uiuc.ncsa.security.storage.cli.StoreCommands
- Throws:
Throwable
-
approvalMods
protected BaseClient approvalMods(edu.uiuc.ncsa.security.util.cli.InputLine inputLine, BaseClient client) throws IOException
Description copied from class:BaseClientStoreCommands
If there are modifications to the client before saving its approval (e.g. admin clients should be prompted for QDL policy) put it here.- Overrides:
approvalMods
in classBaseClientStoreCommands
- Returns:
- Throws:
IOException
-
showErsatzHelp
protected void showErsatzHelp()
-
ersatz
public void ersatz(edu.uiuc.ncsa.security.util.cli.InputLine inputLine) throws Throwable
- Throws:
Throwable
-
linkErsatz
protected void linkErsatz(org.oa4mp.server.loader.oauth2.storage.clients.OA2Client provisioner, edu.uiuc.ncsa.security.core.Identifier adminID, List<edu.uiuc.ncsa.security.core.Identifier> ersatz)
-
hasEChain
protected boolean hasEChain(org.oa4mp.server.api.permissions.admin.PermissionList permissions, List<edu.uiuc.ncsa.security.core.Identifier> eChain)
-
unlinkErsatz
protected void unlinkErsatz(org.oa4mp.server.loader.oauth2.storage.clients.OA2Client provisioner, edu.uiuc.ncsa.security.core.Identifier adminID, List<edu.uiuc.ncsa.security.core.Identifier> ersatz)
-
preCreation
protected edu.uiuc.ncsa.security.core.Identifiable preCreation(edu.uiuc.ncsa.security.core.Identifiable identifiable, int magicNumber)
- Overrides:
preCreation
in classedu.uiuc.ncsa.security.storage.cli.StoreCommands
-
rmCleanup
protected void rmCleanup(edu.uiuc.ncsa.security.core.Identifiable x)
- Overrides:
rmCleanup
in classBaseClientStoreCommands
-
-