Skip to content

Commit

Permalink
chore: migrating from inflector to cruet + updating references from 3…
Browse files Browse the repository at this point in the history
….1.1 to 3.1.2 (#588)
  • Loading branch information
joshfried-aws authored Nov 25, 2024
1 parent d996af5 commit de26750
Show file tree
Hide file tree
Showing 10 changed files with 149 additions and 99 deletions.
26 changes: 26 additions & 0 deletions ATTRIBUTION
Original file line number Diff line number Diff line change
Expand Up @@ -2863,3 +2863,29 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

--
chrislearn/cruet

Copyright 2017 Josh Teeter

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 changes: 13 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

160 changes: 92 additions & 68 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion guard-examples/library/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
cfn-guard = { version = "3.1.1", path = "../../guard" }
cfn-guard = { version = "3.1.2", path = "../../guard" }
anyhow = "1.0.81"
4 changes: 2 additions & 2 deletions guard-ffi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cfn-guard-ffi"
version = "3.1.1"
version = "3.1.2"
edition = "2018"
authors = ["Diwakar Chakravarthy", "John Tompkins", "Omkar Hegde", "Priya Padmanaban", "aws-cloudformation-developers <[email protected]>", "Tyler Southwick"]
description = "AWS CloudFormation Guard is an open-source general-purpose policy-as-code evaluation tool. It provides developers with a simple-to-use, yet powerful and expressive domain-specific language (DSL) to define policies and enables developers to validate JSON- or YAML- formatted structured data with those policies."
Expand All @@ -14,5 +14,5 @@ keywords = ["policy-as-code", "guard", "cfn-guard", "security", "compliance"]
crate-type = ["rlib", "dylib"]

[dependencies]
cfn-guard = { version = "3.1.1", path = "../guard" }
cfn-guard = { version = "3.1.2", path = "../guard" }
ffi-support = "0.4.4"
4 changes: 2 additions & 2 deletions guard-lambda/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cfn-guard-lambda"
version = "3.1.1"
version = "3.1.2"
authors = ["Diwakar Chakravarthy", "John Tompkins", "Omkar Hegde", "Priya Padmanaban",
"Bryan Ayala", "Kexiang Wang", "Akshay Rane", "Josh Fried", "aws-cloudformation-developers <[email protected]>"]
description = "Lambda version of cfn-guard. Checks JSON- or YAML- formatted structured data for policy compliance using a simple, policy-as-code, declarative syntax"
Expand All @@ -17,4 +17,4 @@ serde_derive = "1.0.92"
simple_logger = "4.0.0"
log = "0.4.6"
tokio = "1.24.2"
cfn-guard = { version = "3.1.1", path = "../guard" }
cfn-guard = { version = "3.1.2", path = "../guard" }
4 changes: 2 additions & 2 deletions guard/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cfn-guard"
version = "3.1.1"
version = "3.1.2"
edition = "2018"
authors = ["Diwakar Chakravarthy", "John Tompkins", "Omkar Hegde", "Priya Padmanaban",
"Bryan Ayala", "Kexiang Wang", "Akshay Rane", "Tyler Southwick", "Josh Fried", "aws-cloudformation-developers <[email protected]>"]
Expand Down Expand Up @@ -33,7 +33,7 @@ itertools = "0.4.7"
string-builder = "0.2.0"
enumflags2 = "0.7.7"
enumflags2_derive = "0.7.7"
Inflector = "0.11.4"
cruet = "0.14.0"
urlencoding = "2.1.0"
grep-searcher = "0.1.8"
grep-matcher = "0.1.5"
Expand Down
4 changes: 2 additions & 2 deletions guard/resources/validate/output-dir/structured.sarif
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"tool": {
"driver": {
"name": "cfn-guard",
"semanticVersion": "3.1.1",
"fullName": "cfn-guard 3.1.1",
"semanticVersion": "3.1.2",
"fullName": "cfn-guard 3.1.2",
"organization": "Amazon Web Services",
"downloadUri": "https://github.com/aws-cloudformation/cloudformation-guard",
"informationUri": "https://github.com/aws-cloudformation/cloudformation-guard",
Expand Down
16 changes: 8 additions & 8 deletions guard/src/rules/eval_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::rules::{
QueryResult, RecordTracer, RecordType, Status, TypeBlockCheck, UnResolved, UnaryValueCheck,
ValueCheck,
};
use inflector::cases::*;
use cruet::case::{camel, class, kebab, pascal, snake, title, train};
use lazy_static::lazy_static;
use serde::{Deserialize, Serialize};
use std::collections::{BTreeSet, HashMap};
Expand Down Expand Up @@ -316,13 +316,13 @@ type Converters = &'static [(fn(&str) -> bool, fn(&str) -> String)];
lazy_static! {
#[allow(clippy::type_complexity)]
static ref CONVERTERS: Converters = &[
(camelcase::is_camel_case, camelcase::to_camel_case),
(classcase::is_class_case, classcase::to_class_case),
(kebabcase::is_kebab_case, kebabcase::to_kebab_case),
(pascalcase::is_pascal_case, pascalcase::to_pascal_case),
(snakecase::is_snake_case, snakecase::to_snake_case),
(titlecase::is_title_case, titlecase::to_title_case),
(traincase::is_train_case, traincase::to_train_case),
(camel::is_camel_case, camel::to_camel_case),
(class::is_class_case, class::to_class_case),
(kebab::is_kebab_case, kebab::to_kebab_case),
(pascal::is_pascal_case, pascal::to_pascal_case),
(snake::is_snake_case, snake::to_snake_case),
(title::is_title_case, title::to_title_case),
(train::is_train_case, train::to_train_case),
];
}

Expand Down
2 changes: 1 addition & 1 deletion guard/tests/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ mod validate_tests {
#[case("yaml")]
#[case("json")]
#[case("junit")]
#[case("sarif")]
#[case::sarif("sarif")]
fn test_structured_output(#[case] output: &str) {
let mut reader = Reader::default();
let mut writer = Writer::new(WBVec(vec![])).expect("Failed to create writer.");
Expand Down

0 comments on commit de26750

Please sign in to comment.