Create data dictionaries
Data dictionaries allow organization administrators to define a dictionary of formats that should be used in APIs in their organization.
All organizations get a data dictionary with formats that follow standard patterns, such as date, email, hostname, or IP address. You can add more formats and edit the existing ones, for example, if your company conventions specify using a different date format than the default pattern provided. In addition to the standard data dictionary, you can add more data dictionaries, for example, to dedicate them to different kinds of formats used in your APIs.
- Click next to your username, and click Data dictionaries.
- To create a new data dictionary, click Add.
- Enter a name for the data dictionary and describe what kind of regular expressions it includes.
- Click Add data dictionary.
The new data dictionary is added to your organization, and you and other organization administrators can start adding data format entries to it.
Add data formats to a dictionary
Once you have at least one data dictionary, you can start adding format definitions for regular expressions to it. The most common case is regular expression patterns for string values, but you can also define format entries for enums.
- Click on the data dictionary you want.
- To create a new format entry in the dictionary, click Add format, and enter a name for it.
- Add a description for the format entry, such as what is it for, when it should be used, or anything else that makes it easier for developers to pick the right format.
- If you want to define an enum, switch the enum toggle on. Otherwise, the created format is a string.
- Define the parameters for the entry. For more details, see Types of formats.
The OpenAPI Specification defines the pattern format as ECMA Script. 42Crunch API Security Platform uses the pattern format PCRE1 compiled with the
PCRE_JAVASCRIPT_COMPAT
option which uses ECMA Script syntax for constructs where ECMA Script and PCRE would be different, such as the support of\U
and\u
for unicode. - If you want, set the sensitivity level of the data that the regular expression describes. You can also mark if the data is Personally Identifiable Information (PII) or falls under General Data Protection Regulation (GDPR), or if it is an object identifier.
- When ready, click Add format.
The format entry is added to the data dictionary, and can be now used in API definitions.
To edit an entry later, click > Update next to its name. You can also edit formats in the standard data dictionary.
Copy data dictionaries and formats
You can duplicate existing data dictionaries or format entries and then edit them as needed, so you do not have to start from scratch.
- Go to the data dictionary you want, and click > Copy. The data dictionary (including the formats in it) is copied and added to the list as a new data dictionary.
- To edit the formats in the new dictionary, click > Update on the format you want to edit, and change the details as needed.
- To duplicate an existing format as a new entry in the dictionary, click > Copy on the format, and update the details as needed.
Publish data dictionaries to users
By default, all data dictionaries start as available only to organization administrators. Once you think your data dictionary is ready for developers to use, you can publish it.
- Go to the data dictionary you want, and click > Update.
- Select Published, and click Update data dictionary
The data dictionary is now published and visible to all users in your organization as read-only.
Use patterns from data dictionaries in API definitions
Although only organization administrators can create or edit data dictionaries or format entries, all users in the organization can view the published data dictionaries in their organization and use patterns defined for strings in their API definitions.
- Click next to your username, and click Data dictionaries. You can see all published data dictionaries in your organization.
- Click on a data dictionary to view its contents.
- To view the details of a format, click to expand it.
- To copy the pattern defined for a string in your API definition, click next to the regular expression, and paste it into your API definition in an editor of your choice.
Reset the standard data dictionary
You cannot delete the standard data dictionary, but you can reset its contents to the default values it came with. Just go to the standard data dictionary, and click > Reset default formats. All edits and any additional formats you have added are removed and the standard data dictionary is reset back to its original form.
Delete a data dictionary
You can delete data dictionaries (except the standard data dictionary) you no longer need. Just click > Delete on the data dictionary you want to remove.
Deleting a data dictionary permanently removes it and the format definitions in it from 42Crunch Platform. This action cannot be undone.
Deleting a data dictionary does not remove the patterns from API definitions they have been used in.