Package com.thingworx.resources.security
Class SecurityServices
- All Implemented Interfaces:
IConfigurableObject
,INotScriptFriendly
,ISupportsDeprecation
,IDiffableObject
,IAvatar
,IEntityLifeCycleEvent
,IPersistable
,IServiceProvider
,ITaggableObject
,IDependencyScannableObject
,IEntityDefinition
,IPersistableObject<String>
,IDesignTimeSecurable
,IDesignTimeSecurableEntity
,IRunTimeSecurable
,IRunTimeSecurableEntity
,ISecurable
,IVisibilitySecurable
,IVisibilitySecurableEntity
,IAspectContainer
,INamedObject
,Serializable
- See Also:
-
Field Summary
Fields inherited from class com.thingworx.entities.RootEntity
BASIC_PROPERTY_DEFINITIONS, EXCLUDED_ENTITY_TYPES_IN_PROJECT
Fields inherited from class com.thingworx.types.NamedObject
NAME_COMPARATOR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSanitizeBatchHtml
(org.json.JSONObject batch, String policy) Service Category: Service Description: Sanitizes the specified batch of HTML strings using the rules defined by the specified Policy.SanitizeHtml
(String html, String policy) Service Category: Service Description: Sanitizes the specified HTML string using the rules defined by the specified Policy.Methods inherited from class com.thingworx.resources.Resource
getEntityType
Methods inherited from class com.thingworx.entities.ServiceProviderEntity
getInstancePublicServiceDefinitions, getInstanceServiceDefinition, getInstanceServiceDefinitions, initializeEntity, preInitializeEntity, processAPIServiceRequest, processServiceRequest
Methods inherited from class com.thingworx.entities.RootEntity
AddConfigurationTableDefinition, AddConfigurationTableDefinition, addDesignTimePermission, AddDesignTimePermission, addRunTimePermission, AddRunTimePermission, AddTags, addVisibilityPermission, AddVisibilityPermission, CheckDesignTimePermission, CheckDesignTimePermissionForGroup, CheckDesignTimePermissionForUser, CheckPermission, CheckPermissionForGroup, CheckPermissionForUser, cleanupEntity, DeleteAllConfigurationTableRows, DeleteConfigurationTable, DeleteConfigurationTableRows, DeleteConfigurationTableRows, deleteDesignTimePermission, DeleteDesignTimePermission, deleteRunTimePermission, DeleteRunTimePermission, deleteVisibilityPermission, DeleteVisibilityPermission, dispose, getAspects, GetAvatar, getAvatarContent, GetAvatarURL, GetConfigurationChangeHistory, getConfigurationSetting, getConfigurationTable, GetConfigurationTable, GetConfigurationTableDefinition, GetConfigurationTableRow, GetConfigurationTables, GetDescription, getDesignTimePermissions, GetDesignTimePermissions, GetDesignTimePermissionsAsJSON, getDocumentationContent, getEntityTypeAsString, GetEventDefinition, GetEventDefinitions, GetHomeMashup, GetIncomingDependencies, GetIncomingDependenciesAsNetwork, GetInstanceMetadataAsJSON, GetInstanceMetadataWithPermissionsAsJSON, GetLastModifiedDate, GetMetadata, GetMetadataAsJSON, GetMetadataWithPermissionsAsJSON, GetOutgoingDependencies, GetOutgoingDependenciesAsNetwork, getOwner, GetOwner, GetPermissionsForCurrentUser, GetPermissionsForGroup, GetPermissionsForUser, GetProjectName, GetPropertyDefinition, GetPropertyDefinitions, getRunTimePermissions, GetRunTimePermissions, GetRunTimePermissionsAsJSON, GetServiceDefinition, GetServiceDefinitions, getStringConfigurationSetting, getStringConfigurationSettingWithDefault, GetSummaryInformation, getTags, GetTags, GetTagsAsInfoTable, getVisibilityPermissions, GetVisibilityPermissions, GetVisibilityPermissionsAsJSON, HasIncomingDependencies, HasOutgoingDependencies, isEditable, isEditableExtensionObject, isEditableSystemObject, isExtensionObject, IsMultiRowTable, isOwner, isSystemObject, isThemeObject, isVisible, isVisible, ListDeprecatedUsage, persistDesignTimePermissions, persistRunTimePermissions, persistVisibilityPermissions, RemoveTags, SaveConfigurationTables, SetAvatar, setConfigurationSetting, SetConfigurationTable, SetConfigurationTableRows, SetDescription, setDesignTimePermissions, SetDesignTimePermissionsAsJSON, setDocumentationContent, setExtensionObject, SetHomeMashup, setLastModifiedDate, SetMultiRowConfigurationTable, setOwner, SetOwner, SetProjectName, setRunTimePermissions, SetRunTimePermissionsAsJSON, setStringConfigurationSetting, SetTags, setVisibilityPermissions, SetVisibilityPermissionsAsJSON, toJSON, toJSONDefinition, UpdateProjectDependencies, validateConfiguration
Methods inherited from class com.thingworx.persistence.common.PersistableNamedObject
getID, hasID, isTransient
Methods inherited from class com.thingworx.types.NamedObject
getDescription, getName, setDescription, setName, toValueCollection
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.thingworx.types.INamedObject
getDescription, getName
Methods inherited from interface com.thingworx.entities.interfaces.IPersistable
getID, hasID
Methods inherited from interface com.thingworx.security.permissions.ISecurable
getID, getName
Methods inherited from interface com.thingworx.deprecation.ISupportsDeprecation
getDeprecated, isDeprecated, isDeprecatedBefore, since
-
Constructor Details
-
SecurityServices
protected SecurityServices()
-
-
Method Details
-
SanitizeHtml
@ThingworxExtensionApiMethod(since={8,5,1}) public InfoTable SanitizeHtml(String html, String policy) throws Exception - Service Category:
- Service Description:
- Sanitizes the specified HTML string using the rules defined by the specified Policy. Valid Policy names are: "default", "blog", "wiki", "none".
Sanitizes the specified HTML string using the rules defined by the specified Policy.The returned
InfoTable
will contain one row.The "
HtmlSanitizationResult
" DataShape describes the returned InfoTable, and defines the following fields:- "
policy
" : the name of the policy specified when this Service was invoked - "
sanitizationId
" : the arbitrary, but unique, identifier for this result (useful for logging, etc) - "
sanitizedHtml
" : the resulting sanitized HTML string
- Parameters:
html
- the non-null HTML String to sanitizepolicy
- the name of the Policy defining the rules by which the specified HTML string is to be sanitized- Returns:
- a non-null, single-row InfoTable, defined by the "
HtmlSanitizationResult
" DataShape, containing the sanitized results - Throws:
Exception
- ifhtml
is null, or ifpolicy
does not match a valid policy name
-
SanitizeBatchHtml
@ThingworxExtensionApiMethod(since={8,5,4}) public InfoTable SanitizeBatchHtml(org.json.JSONObject batch, String policy) throws Exception - Service Category:
- Service Description:
- Sanitizes the specified batch of HTML strings using the rules defined by the specified Policy. Valid Policy names are: "default", "blog", "wiki", "none". The keys within the "batch" parameter are arbitrary, but must be unique to the batch. The expected JSON syntax for the "batch" parameter is: {"key-1":"html-string-to-sanitize-1", "key-2":"html-string-to-sanitize-2", ... }.
Sanitizes the specified batch HTML strings using the rules defined by the specified Policy.The format of the specified
batch
must be:{ "<key-1>" : "<html-string-to-sanitize-1>", "<key-2>" : "<html-string-to-sanitize-2>", ... }
...where the arbitrary keys must be unique to the batch.The returned
InfoTable
will contain one row for every key/value pair in the specifiedbatch
.The "
HtmlSanitizationBatchResult
" DataShape describes the returned InfoTable, and defines the following fields:- "
batchId
" : the arbitrary, but unique, identifier for the batch that produced these results (useful for logging, etc) - "
policy
" : the name of the policy specified when this Service was invoked - "
key
" : the key passed into this Service for a given HTML string - "
sanitizationId
" : the arbitrary, but unique, identifier for the result of sanitizing the HTML string keyed by thekey
in the specified batch (useful for logging, etc) - "
sanitizedHtml
" : the resulting sanitized HTML string for thekey
- Parameters:
batch
- the non-null JSON object containing arbitrary (but unique to the batch) keys, whose corresponding values are the HTML strings to sanitizepolicy
- the name of the Policy defining the rules by which the specified HTML string is to be sanitized- Returns:
- a non-null, multi-row InfoTable, defined by the "
HtmlSanitizationBatchResult
" DataShape, containing the sanitized results - Throws:
Exception
- ifbatch
is null, or contains duplicate or null keys, or contains null or non-alphanumeric values, or ifpolicy
does not match a valid policy name
-