Class CocoPharmaPlatformSecurityConnectorTokenBased
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.metadatasecurity.connectors.OpenMetadataPlatformSecurityConnector
org.odpi.openmetadata.metadatasecurity.samples.CocoPharmaPlatformSecurityConnectorTokenBased
- All Implemented Interfaces:
SecureConnectorExtension
,VirtualConnectorExtension
,OpenMetadataPlatformSecurity
public class CocoPharmaPlatformSecurityConnectorTokenBased
extends OpenMetadataPlatformSecurityConnector
CocoPharmaPlatformSecurityConnector overrides the default behavior for the security connector
to allow requests the Coco Pharmaceutical's server administrator APIs. In this example,
only Gary Geeke is allowed to issue these requests.
To generate a JWT for this example, we used the following payload:
{
"sub": "garygeeke",
"name": "Gary Geeke",
"actions":["platform-administrator","platform-operator","platform-investigator"],
"iat": {Epoch timestamp},
"exp": {Epoch timestamp}
}
-
Nested Class Summary
Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
ConnectorBase.ProtectedConnection
-
Field Summary
Fields inherited from class org.odpi.openmetadata.metadatasecurity.connectors.OpenMetadataPlatformSecurityConnector
connectorName, messageFormatter, serverRootURL
Fields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
auditLog, connectedAssetProperties, connectionBean, connectionProperties, connectorInstanceId, embeddedConnectors, secretsStoreConnectorMap
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Check that the calling user is authorized to issue diagnostic requests to the OMAG Server Platform.void
Check that the calling user is authorized to issue operator requests to the OMAG Server Platform.void
validateUserForNewServer
(String userId) Check that the calling user is authorized to create new servers.Methods inherited from class org.odpi.openmetadata.metadatasecurity.connectors.OpenMetadataPlatformSecurityConnector
disconnect, logConnectorDisconnecting, logConnectorStarting, logRecord, setServerPlatformURL, start, throwUnauthorizedPlatformAccess
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
combineConfigurationProperties, disconnectConnectors, equals, getArrayConfigurationProperty, getAssetTypeName, getBooleanConfigurationProperty, getConnectedAssetProperties, getConnection, getConnectorInstanceId, getDateConfigurationProperty, getIntConfigurationProperty, getLongConfigurationProperty, getNetworkAddresses, getStringConfigurationProperty, getSuppliedPlaceholderProperties, hashCode, initialize, initializeConnectedAssetProperties, initializeEmbeddedConnectors, initializeSecretsStoreConnector, isActive, logExceptionRecord, logRecord, logRecord, throwMissingConfigurationProperty, throwMissingResource, throwNoAsset, throwWrongTypeOfAsset, throwWrongTypeOfResource, throwWrongTypeOfRootSchema, toString
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector
clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, setStatisticProperty, setStatisticTimestamp
-
Constructor Details
-
CocoPharmaPlatformSecurityConnectorTokenBased
public CocoPharmaPlatformSecurityConnectorTokenBased()
-
-
Method Details
-
validateUserForNewServer
Check that the calling user is authorized to create new servers.- Specified by:
validateUserForNewServer
in interfaceOpenMetadataPlatformSecurity
- Overrides:
validateUserForNewServer
in classOpenMetadataPlatformSecurityConnector
- Parameters:
userId
- calling user- Throws:
UserNotAuthorizedException
- the user is not authorized to access this platform
-
validateUserAsOperatorForPlatform
Check that the calling user is authorized to issue operator requests to the OMAG Server Platform.- Specified by:
validateUserAsOperatorForPlatform
in interfaceOpenMetadataPlatformSecurity
- Overrides:
validateUserAsOperatorForPlatform
in classOpenMetadataPlatformSecurityConnector
- Parameters:
userId
- calling user- Throws:
UserNotAuthorizedException
- the user is not authorized to issue operator commands to this platform
-
validateUserAsInvestigatorForPlatform
Check that the calling user is authorized to issue diagnostic requests to the OMAG Server Platform.- Specified by:
validateUserAsInvestigatorForPlatform
in interfaceOpenMetadataPlatformSecurity
- Overrides:
validateUserAsInvestigatorForPlatform
in classOpenMetadataPlatformSecurityConnector
- Parameters:
userId
- calling user- Throws:
UserNotAuthorizedException
- the user is not authorized to issue diagnostic commands to this platform
-