OCSF.AuthProtocol (OCSF v0.1.0)

Copy Markdown View Source

OCSF authentication protocol identifiers.

Maps authentication protocol names to their OCSF 1.8 numeric identifiers. Used to populate the auth_protocol_id field on Authentication events.

See the OCSF auth_protocol_id definition.

Values

NameID
:Unknown0
:NTLM1
:Kerberos2
:Digest3
:OpenID4
:SAML5
:"OAUTH 2.0"6
:PAP7
:CHAP8
:EAP9
:RADIUS10
:"Basic Authentication"11
:LDAP12
:Other99

See OCSF.Class and OCSF.Activity for authentication event classes and activities.

Summary

Functions

Return values formatted for Ecto.Enum.

Return the name atom for the given numeric identifier.

Return the numeric identifier for the given name atom.

Return true if the given name or identifier is valid.

Return all values as a keyword list.

Functions

ecto_values()

@spec ecto_values() :: keyword()

Return values formatted for Ecto.Enum.

Examples

iex> {:"OAUTH 2.0", 6} in OCSF.AuthProtocol.ecto_values()
true

name(uid)

@spec name(integer()) :: atom() | nil

Return the name atom for the given numeric identifier.

Examples

iex> OCSF.AuthProtocol.name(5)
:SAML

iex> OCSF.AuthProtocol.name(6)
:"OAUTH 2.0"

iex> OCSF.AuthProtocol.name(42)
nil

uid(name)

@spec uid(atom()) :: integer() | nil

Return the numeric identifier for the given name atom.

Examples

iex> OCSF.AuthProtocol.uid(:SAML)
5

iex> OCSF.AuthProtocol.uid(:"OAUTH 2.0")
6

iex> OCSF.AuthProtocol.uid(:NonExistent)
nil

valid?(name)

@spec valid?(atom() | integer()) :: boolean()

Return true if the given name or identifier is valid.

Examples

iex> OCSF.AuthProtocol.valid?(:SAML)
true

iex> OCSF.AuthProtocol.valid?(5)
true

iex> OCSF.AuthProtocol.valid?(:NonExistent)
false

values()

@spec values() :: [{atom(), integer()}]

Return all values as a keyword list.

Examples

iex> {:"OAUTH 2.0", 6} in OCSF.AuthProtocol.values()
true