Skip to main content

shape_names

Function shape_names 

Source
pub fn shape_names() -> Vec<&'static str>
Expand description

The names of the credential shapes, in the order they are applied, then assignment.

The order is MJ_CAPTURE_SECRETS’ own, and it matters: the shapes are applied one after another, so an Anthropic key is named as one before the broader OpenAI shape could claim it.

use majordomus_cli::redaction::shape_names;

let names = shape_names();
assert_eq!(names.first(), Some(&"anthropic-key"));
assert_eq!(names.last(), Some(&"assignment"));
let anthropic = names.iter().position(|n| *n == "anthropic-key");
let openai = names.iter().position(|n| *n == "openai-key");
assert!(anthropic < openai);