cassette v1.2.3 Cassette.Config

Struct that represents Cassette configuration

Summary

Types

t()

The following keys are supported and may be defined in your application env

Functions

Returns a configuration based on what is set in application environment and default values

Resolves config by fetching environment variables when values are in the form

Types

t :: %Cassette.Config{base_authority: String.t, base_url: String.t, insecure: term, password: String.t, service: String.t, st_ttl: non_neg_integer, tgt_ttl: non_neg_integer, username: String.t, validation_ttl: non_neg_integer}

The following keys are supported and may be defined in your application env

  • username - the username to authenticate on cas server
  • password - the password to authenticate on cas server
  • base_url - the base url for your CAS server (do not include the login/)
  • base_authority - simplifies role checking, please refer to Cassette.User.has_role?/2
  • service - the CAS service to use when validating service tickets
  • tgt_ttl - the TGT cache time to live
  • st_ttl - the ST cache time to live
  • validation_ttl - the ST validation cache time to live
  • insecure - boolean to allow connection even with ssl certificate check fails

Any of those keys may be set in your Application environment (or the mix config/config.exs) as:

config :cassette, username: "john.doe"

Cassette.Servers call the resolve/1 function on this module to resolve any configuration using environment variables. To use an environment variable set the value to {:system, "SOME_ENVIRONMENT_VARIABLE"}.

Or in config.exs:

config :cassette, username: {:system, "CASSETTE_USERNAME"}
``

and configure your environment (provabably in something like `/etc/default/your_app`):

export CASSETTE_USERNAME=acme


Please check the [`Cassette.Config.default/0`](Cassette.Config.html#default/0) function.


Functions

default()

Specs

default :: t

Returns a configuration based on what is set in application environment and default values

Check Cassette.Config.t for key details

resolve(config)

Specs

resolve(t) :: t

Resolves config by fetching environment variables when values are in the form:

{:system, "SOME_ENVIRONMENT_VARIABLE"}

The value will be fetched from the SOME_ENVIRONMENT_VARIABLE variable. If that variable is nil, the default value in Cassette.Config.t will be used