ExFTP.Auth.NoAuth (ExFTP v1.0.4)

View Source

When authenticator is ExFTP.Auth.NoAuth, this authenticator will completely ignore any supplied credentials and assume everything is authenticated.

๐Ÿ”’ Security

Don't use NoAuth for production servers.

โš™๏ธ Configuration

Keys

Example

  %{
    # ... ,
    authenticator: ExFTP.Auth.NoAuth,
    authenticator_config: %{}
  }

๐Ÿ‘€ See Also

๐Ÿ“– Resources

Summary

Functions

Assumes the user is always authenticated

Login will always succeed.

Always returns true

Functions

authenticated?(authenticator_state)

@spec authenticated?(authenticator_state :: ExFTP.Authenticator.authenticator_state()) ::
  boolean()

Assumes the user is always authenticated

๐Ÿท๏ธ Params

โคต๏ธ Returns

โœ… On Success

  `true`

๐Ÿ’ป Examples

iex> alias ExFTP.Auth.NoAuth
iex> NoAuth.authenticated?(%{authenticated: true})
true
iex> NoAuth.authenticated?(%{})
true

๐Ÿ“– Resources

login(password, authenticator_state)

@spec login(
  password :: ExFTP.Authenticator.password(),
  authenticator_state :: ExFTP.Authenticator.authenticator_state()
) :: {:ok, ExFTP.Authenticator.authenticator_state()} | {:error, term()}

Login will always succeed.

๐Ÿท๏ธ Params

โคต๏ธ Returns

โœ… On Success

  {:ok, authenticator_state}

๐Ÿ’ป Examples

iex> alias ExFTP.Auth.NoAuth
iex> {:ok, _auth_state} = NoAuth.login("password", %{username: "jsmith"})
iex> {:ok, _} = NoAuth.login("password", %{})
iex> {:ok, _} = NoAuth.login("password", %{username: "root"})

valid_user?(username)

@spec valid_user?(username :: ExFTP.Authenticator.username()) :: boolean()

Always returns true

๐Ÿท๏ธ Params

โคต๏ธ Returns

โœ… On Success

  `true`

๐Ÿ’ป Examples

iex> alias ExFTP.Auth.NoAuth
iex> NoAuth.valid_user?("jsmith")
true
iex> NoAuth.valid_user?("root")
true