# `Arcadic.Identifier`
[🔗](https://github.com/baselabs/arcadic/blob/baselabs_arcadic-v4.0.1/lib/arcadic/identifier.ex#L5)

Allowlist validation for identifiers arcadic places into a URL path or a
statement (database names, labels, property names).

Values are never identifiers — they ride the `params` map. This guards the
identifier surface only. A failure carries the
invalid-SHAPE fact only, never the offending string (it may be attacker-
controlled or contain a secret).

# `valid?`

```elixir
@spec valid?(term()) :: boolean()
```

Boolean form of `validate/1`.

# `validate`

```elixir
@spec validate(term()) :: :ok | {:error, :invalid_identifier}
```

Returns `:ok` for a valid identifier, `{:error, :invalid_identifier}` otherwise.

## Examples

    iex> Arcadic.Identifier.validate("Person")
    :ok
    iex> Arcadic.Identifier.validate("1bad")
    {:error, :invalid_identifier}

# `validate_setting_key`

```elixir
@spec validate_setting_key(term()) :: :ok | {:error, :invalid_setting_key}
```

Validates a server/database setting KEY (dotted allowlist); value-free.

# `validate_url`

```elixir
@spec validate_url(term()) ::
  :ok
  | {:error,
     :empty
     | :too_long
     | :invalid_chars
     | :invalid_scheme
     | :invalid_uri
     | :not_a_string}
```

Validates a URL for interpolation into an `IMPORT`/`BACKUP`/`restore` command. Positive
RFC-3986 allowlist + scheme allowlist (`http`/`https`/`file`); value-free reasons.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
