-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Schema Extraction Preprocessor (#182)
- Loading branch information
Showing
73 changed files
with
3,267 additions
and
463 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"title": "Serialized schema types for API Security", | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$defs": { | ||
"type": { | ||
"oneOf": [ | ||
{ | ||
"enum": [0, 1, 2, 4, 8, 16], | ||
"description": "scalar types" | ||
}, | ||
{ | ||
"type": "array", | ||
"description": "array of types", | ||
"items": { | ||
"$ref": "#" | ||
}, | ||
"minItems": 1 | ||
}, | ||
{ | ||
"type": "object", | ||
"description": "record type", | ||
"additionalProperties": { | ||
"$ref": "#" | ||
} | ||
} | ||
] | ||
}, | ||
"metadata": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"pattern": "^[A-Za-z][A-Za-z0-9\\.\\-\\_:\\/]{0,199}$" | ||
}, | ||
"minItems": 1 | ||
} | ||
}, | ||
"type": "array", | ||
"prefixItems": [ | ||
{ "$ref": "#/$defs/type" }, | ||
{ "$ref": "#/$defs/metadata" } | ||
], | ||
"minItems": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Unless explicitly stated otherwise all files in this repository are | ||
// dual-licensed under the Apache-2.0 License or BSD-3-Clause License. | ||
// | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2021 Datadog, Inc. | ||
|
||
#pragma once | ||
|
||
#include <memory> | ||
#include <string> | ||
#include <string_view> | ||
#include <vector> | ||
|
||
#include <utils.hpp> | ||
|
||
namespace ddwaf::generator { | ||
|
||
class base { | ||
public: | ||
using ptr = std::unique_ptr<base>; | ||
|
||
base() = default; | ||
virtual ~base() = default; | ||
base(const base &) = default; | ||
base(base &&) = default; | ||
base &operator=(const base &) = default; | ||
base &operator=(base &&) = default; | ||
|
||
virtual ddwaf_object generate(const ddwaf_object *input) = 0; | ||
}; | ||
|
||
} // namespace ddwaf::generator |
Oops, something went wrong.