### Sample Entry in dictionary.json
Source: https://github.com/agntcy/oasf/blob/main/CONTRIBUTING.md
An example entry for the 'dictionary.json' file, defining a 'locators' object with its caption and description.
```json
"locators": {
"caption": "Record Locators",
"description": "Locators provide actual artifact locators of the data's record. For example, this can reference sources such as helm charts, docker images, binaries, and so on.",
```
--------------------------------
### Install Elixir Build Tools
Source: https://github.com/agntcy/oasf/blob/main/server/README.md
Installs Hex and Rebar, essential build tools for Elixir projects. Use --force to bypass confirmation prompts.
```shell
mix local.hex --force && mix local.rebar --force
```
--------------------------------
### Define Object References
Source: https://github.com/agntcy/oasf/blob/main/CONTRIBUTING.md
Example of how to add a list of web links as references to an object definition, including a description and URL for each reference.
```json
"references": [
{
"description": "A2A Card Data Schema",
"url": "https://github.com/a2aproject/A2A/blob/v0.3.0/specification/grpc/a2a.proto"
}
]
```
--------------------------------
### Reload Schema with Specific Extension
Source: https://github.com/agntcy/oasf/blob/main/server/README.md
Reloads the schema including only the 'example' extension. The folder path is relative to SCHEMA_DIR.
```elixir
Schema.reload(["extensions/example"])
```
--------------------------------
### Run Schema Server with IEx
Source: https://github.com/agntcy/oasf/blob/main/server/README.md
Starts the Phoenix server for the OASF schema using IEx. Requires SCHEMA_DIR and SCHEMA_EXTENSION environment variables to be set. Access the server at localhost:8080.
```shell
SCHEMA_DIR=../schema SCHEMA_EXTENSION=extensions iex -S mix phx.server
```
--------------------------------
### Define a Locator Object in JSON
Source: https://github.com/agntcy/oasf/blob/main/CONTRIBUTING.md
Example of a 'locator' object definition in JSON format, specifying its caption, description, inheritance, name, and attributes.
```json
{
"caption": "Locator",
"description": "Locators provide actual artifact locators of the data's record. For example, this can reference sources such as Helm charts, Docker images, binaries, and so on.",
"extends": "object",
"name": "locator",
"attributes": {
"type": {
"caption": "Type",
"description": "Describes the type of the release manifest pointed by its URI. Allowed values MAY be defined for common manifest types.",
"requirement": "required",
"enum": {
"unspecified": {
"caption": "Unspecified"
},
"helm_chart": {
"caption": "Helm Chart"
},
"container_image": {
"caption": "Container Image"
},
"package": {
"caption": "Package"
},
"source_code": {
"caption": "Source Code"
},
"binary": {
"caption": "Binary"
},
"url": {
"caption": "URL"
}
}
},
"urls": {
"caption": "URLs",
"description": "Specifies an array of URLs from which this object MAY be downloaded. Value MUST conform to RFC 1738. Value SHOULD use the http and https schemes, as defined in RFC 7230.",
"requirement": "required"
},
"annotations": {
"caption": "Annotations",
"description": "Additional metadata associated with the record locator.",
"requirement": "optional"
}
}
}
```
--------------------------------
### Example Deprecated Field
Source: https://github.com/agntcy/oasf/blob/main/CONTRIBUTING.md
Demonstrates how to deprecate a specific field within a JSON schema definition. The 'packages' field is marked for deprecation with a message and version.
```json
"packages": {
"@deprecated": {
"message": "Use the affected_packages attribute instead.",
"since": "1.0.0"
},
"caption": "Software Packages",
"description": "List of vulnerable packages as identified by the security product",
"is_array": true,
"type": "package"
}
```
--------------------------------
### Enable Hot Reload for Schema Changes
Source: https://github.com/agntcy/oasf/blob/main/README.md
Start an interactive session to enable hot-reloading specifically for schema changes. Backend changes still require re-running 'task build && task up'.
```shell
task reload
```
--------------------------------
### Example Deprecated Object
Source: https://github.com/agntcy/oasf/blob/main/CONTRIBUTING.md
Illustrates deprecating an entire object in a JSON schema. The 'finding' object is deprecated, with instructions to use 'finding_info' instead, and specifies the version.
```json
{
"caption": "Finding",
"description": "The Finding object describes metadata related to a security finding generated by a security tool or system.",
"extends": "object",
"name": "finding",
"@deprecated": {
"message": "Use the new finding_info object.",
"since": "1.0.0"
},
"attributes": {...}
}
```
--------------------------------
### Include Attributes from Another File
Source: https://github.com/agntcy/oasf/blob/main/CONTRIBUTING.md
Example of using the '$include' attribute to incorporate attributes from another JSON schema file into the current object definition.
```json
"attributes": {
"$include": [
"profiles/host.json"
],
...
}
```
--------------------------------
### Specify Array Field in Dictionary
Source: https://github.com/agntcy/oasf/blob/main/CONTRIBUTING.md
Example of how to indicate that a field defined in the dictionary is an array. Add the 'is_array' key with a boolean value of true.
```json
"is_array":
true
```
--------------------------------
### Define Attribute Constraints
Source: https://github.com/agntcy/oasf/blob/main/CONTRIBUTING.md
Example of defining constraints on attribute requirements for an object, using 'at_least_one' to specify that at least one of the listed attributes must be present.
```json
"constraints": {
"at_least_one": [
"id",
"name"
]
}
```
--------------------------------
### Fetch and Compile Dependencies
Source: https://github.com/agntcy/oasf/blob/main/server/README.md
Navigates to the server directory and fetches/compiles project dependencies using Mix.
```shell
cd server
mix do deps.get, deps.compile
```
--------------------------------
### Build Project Dependencies and Artifacts
Source: https://github.com/agntcy/oasf/blob/main/README.md
Fetch project dependencies and build all artifacts, including Helm charts and Docker images, using Taskfile.
```shell
task deps
task build
```
--------------------------------
### Run Test Suite
Source: https://github.com/agntcy/oasf/blob/main/CONTRIBUTING.md
Execute the project's test suite using this command. Ensure all tests pass before submitting changes.
```bash
task test
```
--------------------------------
### Deploy OASF Locally with Multiple Versions and Debug Logging
Source: https://github.com/agntcy/oasf/blob/main/README.md
Combine deployment of multiple versions with debug logging by setting both the Helm values path and the LOG_LEVEL environment variable.
```shell
LOG_LEVEL=debug HELM_VALUES_PATH=./install/charts/oasf/values-test-versions.yaml task up
```
--------------------------------
### Define Extension Metadata
Source: https://github.com/agntcy/oasf/blob/main/CONTRIBUTING.md
Create an extension.json file to define the extension's name, UID, and other metadata. This is required for any new extension.
```json
{
"caption": "New Extension",
"name": "new_ex",
"uid": 123,
"version": "0.0.0"
}
```
--------------------------------
### Deploy OASF Server Locally
Source: https://github.com/agntcy/oasf/blob/main/README.md
Build the server image and deploy OASF services locally using a Kind cluster. This command also sets up port forwarding for local access.
```shell
IMAGE_TAG=latest task build:server
task up
```
--------------------------------
### Deploy OASF Locally with Multiple Versions
Source: https://github.com/agntcy/oasf/blob/main/README.md
Deploy OASF services with multiple versions by specifying a custom values file for Helm. This allows testing different versions simultaneously.
```shell
HELM_VALUES_PATH=./install/charts/oasf/values-test-versions.yaml task up
```
--------------------------------
### Deploy OASF Server Locally with Debug Logging
Source: https://github.com/agntcy/oasf/blob/main/README.md
Deploy OASF services locally with increased log verbosity by setting the LOG_LEVEL environment variable.
```shell
LOG_LEVEL=debug task up
```
--------------------------------
### Reload Schema with Extensions
Source: https://github.com/agntcy/oasf/blob/main/server/README.md
Forces a reload of the schema, including specified extension folders. Pass a list of folder paths as strings.
```elixir
Schema.reload(["", "", ...])
```
--------------------------------
### Clone OASF Repository
Source: https://github.com/agntcy/oasf/blob/main/README.md
Use this command to clone the OASF project repository from GitHub.
```shell
git clone https://github.com/agntcy/oasf.git
```
--------------------------------
### Test Local Schema Changes
Source: https://github.com/agntcy/oasf/blob/main/server/README.md
Runs project tests, specifically validating JSON files and attribute definitions within the schema. Requires SCHEMA_DIR and SCHEMA_EXTENSION environment variables to be set.
```shell
SCHEMA_DIR=../schema SCHEMA_EXTENSION=extensions mix test
```
--------------------------------
### Define Object Properties
Source: https://github.com/agntcy/oasf/blob/main/CONTRIBUTING.md
Use this structure to define properties of an object, such as 'caption', 'description', and 'type'. Include 'is_array' if the object is an array.
```json
{
"type": "locator",
"is_array": true
}
```
--------------------------------
### Compile Elixir Source Code
Source: https://github.com/agntcy/oasf/blob/main/server/README.md
Compiles the Elixir source code for the project using the Mix build tool.
```shell
mix compile
```
--------------------------------
### Reload Schema with All Extensions in Folder
Source: https://github.com/agntcy/oasf/blob/main/server/README.md
Reloads the schema with all extensions located in the 'extensions' folder, relative to SCHEMA_DIR.
```elixir
Schema.reload(["extensions"])
```
--------------------------------
### Define a Field in the Dictionary
Source: https://github.com/agntcy/oasf/blob/main/CONTRIBUTING.md
Sample JSON entry for defining a new field in the OASF attribute dictionary. Ensure the 'name' is unique and populate 'caption', 'description', and 'type' accordingly.
```json
"name": {
"caption": "Name",
"description": "The name of the entity. See specific usage.",
"type": "string_t"
}
```
--------------------------------
### Reload Core Schema
Source: https://github.com/agntcy/oasf/blob/main/server/README.md
Reloads the core schema without any extensions.
```elixir
Schema.reload()
```
--------------------------------
### Cleanup OASF Local Deployment
Source: https://github.com/agntcy/oasf/blob/main/README.md
Remove all resources created during the local deployment, including ephemeral Kind clusters and Docker containers.
```shell
task down
```
--------------------------------
### Reload Schema with External Extensions
Source: https://github.com/agntcy/oasf/blob/main/server/README.md
Reloads the schema with extensions located outside the SCHEMA_DIR. Accepts absolute or relative paths.
```elixir
Schema.reload(["/home/schema/cloud", "../dev-ext"])
```
--------------------------------
### Amend Commit with Sign-off
Source: https://github.com/agntcy/oasf/blob/main/CONTRIBUTING.md
Use this command to add a sign-off to a commit that has already been made. This is useful if you forgot to include it initially.
```sh
git commit --amend --signoff
```
--------------------------------
### Deprecate Attribute Flag
Source: https://github.com/agntcy/oasf/blob/main/CONTRIBUTING.md
Use this JSON property to mark an attribute for deprecation. Include a message explaining the reason and the alternative, along with the version since which it has been deprecated.
```json
"@deprecated": {
"message": "Use the ALTERNATE_ATTRIBUTE attribute instead.",
"since": "semver"
}
```
--------------------------------
### Add Sign-off to Commit Message
Source: https://github.com/agntcy/oasf/blob/main/CONTRIBUTING.md
Include a sign-off in your commit message to certify that you wrote the code or have the right to pass it on. This is required for pull requests.
```text
Signed-off-by: Random J Developer
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.