Class InterfolioExternalSystem
java.lang.Object
edu.internet2.middleware.grouper.app.config.GrouperConfigurationModuleBase
edu.internet2.middleware.grouper.app.externalSystem.GrouperExternalSystem
edu.internet2.middleware.grouper.app.interfolio.InterfolioExternalSystem
- All Implemented Interfaces:
OptionValueDriver
External system for the Interfolio faculty information system.
Interfolio exposes a few distinct API surfaces, all authenticated with the same HMAC-SHA1 "INTF"
scheme but living on different hosts:
- IAM API (iamUrl, e.g. https://iam-api.interfolio.com) - user identity: create / update users.
- byc/core API (bycUrl, e.g. https://logic.interfolio.com) - search users and grant/remove access
to the products RPT (byc-tenure) and FS (byc-search) via subscribe/unsubscribe.
(Interfolio also has a Faculty180/FAR API on faculty180.interfolio.com, but it is a separate auth
realm that our credentials are not authorized for, so it is intentionally not modeled here.)
The HMAC signature string is: VERB + "\n\n\n" + timestamp + "\n" + requestString, HMAC-SHA1'd with
the private key, base64-encoded, and sent as "Authorization: INTF {publicKey}:{signature}" along
with a "TimeStamp" header. The requestString is everything after the host (path + query), and the
query string - if any - must be signed verbatim.
Config (in grouper-loader.properties), prefix grouper.interfolio.{configId}. :
publicKey - the INTF public key
privateKey - the INTF private key (secret)
databaseId - the Interfolio tenant id (used in the URL path)
bycUrl - base url for the byc/core API (search, subscribe, unsubscribe)
iamUrl - base url for the IAM API (create, update)
-
Field Summary
Fields inherited from class edu.internet2.middleware.grouper.app.externalSystem.GrouperExternalSystem
externalTypeClassNamesFields inherited from class edu.internet2.middleware.grouper.app.config.GrouperConfigurationModuleBase
attributeCache, extraConfigKeys -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidattachInterfolioHmacHeaders(String configId, GrouperHttpClient grouperHttpClient, String requestVerb, String requestString) Attach the Interfolio HMAC authorization headers to an http client.config file name to check for properties and metadataconfig id regeg eg: ^(provisioner)\\.([^.]+)\\.(.*)$config id that identified this config. either suffix and value or getConfigIdThatIdentifiesThisConfig is required, not both. eg: personLdapprefix for the properties eg: provisioner.someConfigId.static StringretrieveConfigValue(String configId, String suffix) Read a config value for this external system's configId.test()Validate the configuration: the required properties are present, and (if they are) a lightweight search call authenticates against Interfolio.Methods inherited from class edu.internet2.middleware.grouper.app.externalSystem.GrouperExternalSystem
causeChainMessage, getConfigurationTypePrefix, isCanAdd, isCanDelete, logAndDescribeTestException, propertiesApiProperyValue, refreshConnectionsIfNeeded, retrieveAllGrouperExternalSystems, retrieveAllModuleConfigurationTypes, retrieveAllUsedBy, retrieveKeysAndLabels, validatePreSaveMethods inherited from class edu.internet2.middleware.grouper.app.config.GrouperConfigurationModuleBase
changeStatus, clearAttributeCache, deleteConfig, editConfig, formatIndexes, getCacheAttributePrefix, getCacheEntityAttributePrefix, getCacheGroupAttributePrefix, getCacheMembershipAttributePrefix, getConfigId, getDescription, getDocumentation, getGenericConfigId, getPropertySuffixThatIdentifiesThisConfig, getPropertyValueThatIdentifiesThisConfig, getStartWithDescription, getStartWithDocumentation, getSubSections, getTitle, insertConfig, isEnabled, isMultiple, listAllConfigurationsOfThisType, populateConfigurationValuesFromUi, populateValuesLabelsFromOptionValueClass, removeNoUnsedConfigs, retrieveAllConfigurations, retrieveAllConfigurationTypesHelper, retrieveAttributes, retrieveAttributesFromConfig, retrieveAttributeValueFromConfig, retrieveConfigurationConfigIds, retrieveConfigurationKeysByPrefix, retrieveExtraConfigKeys, retrieveObjectValueSubstituteMap, retrieveSuffix, retrieveText, setConfigId, showAttributeOverride, validatePreSaveMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.internet2.middleware.grouper.cfg.dbConfig.OptionValueDriver
setConfigSuffixToConfigModuleAttribute
-
Constructor Details
-
InterfolioExternalSystem
public InterfolioExternalSystem()
-
-
Method Details
-
getConfigFileName
Description copied from class:GrouperConfigurationModuleBaseconfig file name to check for properties and metadata- Specified by:
getConfigFileNamein classGrouperConfigurationModuleBase- Returns:
-
getConfigItemPrefix
Description copied from class:GrouperConfigurationModuleBaseprefix for the properties eg: provisioner.someConfigId.- Specified by:
getConfigItemPrefixin classGrouperConfigurationModuleBase- Returns:
- the prefix
-
getConfigIdRegex
Description copied from class:GrouperConfigurationModuleBaseconfig id regeg eg: ^(provisioner)\\.([^.]+)\\.(.*)$- Specified by:
getConfigIdRegexin classGrouperConfigurationModuleBase- Returns:
-
getConfigIdThatIdentifiesThisConfig
Description copied from class:GrouperConfigurationModuleBaseconfig id that identified this config. either suffix and value or getConfigIdThatIdentifiesThisConfig is required, not both. eg: personLdap- Overrides:
getConfigIdThatIdentifiesThisConfigin classGrouperConfigurationModuleBase- Returns:
-
test
Validate the configuration: the required properties are present, and (if they are) a lightweight search call authenticates against Interfolio.- Overrides:
testin classGrouperExternalSystem- Returns:
- Throws:
UnsupportedOperationException
-
retrieveConfigValue
Read a config value for this external system's configId.- Parameters:
configId- external system config idsuffix- the property suffix after grouper.interfolio.{configId}.- Returns:
- the value (required - throws if missing)
-
attachInterfolioHmacHeaders
public static void attachInterfolioHmacHeaders(String configId, GrouperHttpClient grouperHttpClient, String requestVerb, String requestString) Attach the Interfolio HMAC authorization headers to an http client. Signs VERB + "\n\n\n" + timestamp + "\n" + requestString with HMAC-SHA1 using the private key, base64-encodes it, and sets: TimeStamp: {timestamp} Authorization: INTF {publicKey}:{signature} IMPORTANT: requestString must be exactly the path (plus query string, if any) that follows the host in the URL, and must match what is actually sent on the wire, or the signature will fail.- Parameters:
configId- external system config id (to look up the public/private key)grouperHttpClient- the http client to add headers torequestVerb- HTTP verb (GET, POST, PUT, ...)requestString- the path + query that follows the host, signed verbatim
-