aws/internal/ini

Minimal INI parser, sized for the AWS shared credentials file and the flat parts of ~/.aws/config. Supports the subset:

Out of scope for now (we’ll grow into these when SSO and assume-role providers need them):

Errors carry the offending line number so the surfaced message can point the user at the broken line of their credentials file.

Types

Parsed INI representation: section name -> property name -> value.

pub type Ini =
  dict.Dict(String, dict.Dict(String, String))
pub type ParseError {
  ParseError(line: Int, message: String)
}

Constructors

  • ParseError(line: Int, message: String)

Values

pub fn get_property(
  ini: dict.Dict(String, dict.Dict(String, String)),
  section section: String,
  key key: String,
) -> Result(String, Nil)

Look up a single property value inside a section.

pub fn parse(
  text: String,
) -> Result(
  dict.Dict(String, dict.Dict(String, String)),
  ParseError,
)
Search Document