View Source AshAuthentication.Igniter (ash_authentication v4.2.0)

Codemods for working with AshAuthentication

Summary

Functions

Adds a new strategy to the authentication.strategies section of a resource

Adds a secret to a secret module that reads from application env

Adds a strategy to the authentication.strategies section of a resource

Returns true if the given resource defines an attribute with the provided name

Functions

Link to this function

add_new_strategy(igniter, resource, type, name, contents)

View Source
@spec add_new_strategy(
  Igniter.t(),
  Ash.Resource.t(),
  type :: atom(),
  name :: atom(),
  contents :: String.t()
) :: Igniter.t()

Adds a new strategy to the authentication.strategies section of a resource

Link to this function

add_secret_from_env(igniter, module, resource, path, env_key)

View Source
@spec add_secret_from_env(Igniter.t(), module(), Ash.Resource.t(), [atom()], atom()) ::
  Igniter.t()

Adds a secret to a secret module that reads from application env

Link to this function

add_strategy(igniter, resource, contents)

View Source
@spec add_strategy(
  Igniter.t(),
  Ash.Resource.t(),
  contents :: String.t()
) :: Igniter.t()

Adds a strategy to the authentication.strategies section of a resource

Link to this function

defines_strategy(igniter, resource, constructor, name)

View Source
@spec defines_strategy(
  Igniter.t(),
  Ash.Resource.t(),
  constructor :: atom(),
  name :: atom()
) ::
  {Igniter.t(), true | false}

Returns true if the given resource defines an attribute with the provided name