aws/internal/ini
Minimal INI parser, sized for the AWS shared credentials file and the
flat parts of ~/.aws/config. Supports the subset:
[section-name]headerskey = valueproperties (whitespace around=trimmed)#and;whole-line comments- blank lines
Out of scope for now (we’ll grow into these when SSO and assume-role providers need them):
- line continuation for multi-line values
- sub-properties (nested key/value inside a property)
- inline
#/;comments mid-value
Errors carry the offending line number so the surfaced message can point the user at the broken line of their credentials file.
Types
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,
)