kmx.io/ex_ovh/docs/mix_task_advanced.md

Download

Mix Task (Advanced)

Generate client config

The hubic mix task makes requests to the Hubic Api on the user’s behalf to get details such as the referesh token and then generates a configuration which can copied and pasted into config.exs.

The environment variables generated by the task are automatically save to a .env file. It is best to ensure that this file is outside version control.

Shell Input:

mix ovh \
--login=<username-ovh> \
--password=<password> \
--appdescription='Ovh Application for my app' \
--endpoint='ovh-eu' \
--apiversion='1.0' \
--redirecturi='http://localhost:4000/' \
--accessrules='get-[/*]::put-[/me,/cdn]::post-[/me,/cdn]::delete-[]' \
--appname='my_app'
--clientname='OvhClient'

Shell Output:

config :my_app, MyApp.OvhClient,
    ovh: [
      application_key: System.get_env("MY_APP_OVH_CLIENT_APPLICATION_KEY"),
      application_secret: System.get_env("MY_APP_OVH_CLIENT_APPLICATION_SECRET"),
      consumer_key: System.get_env("MY_APP_OVH_CLIENT_CONSUMER_KEY"),
      endpoint: System.get_env("MY_APP_OVH_CLIENT_ENDPOINT"),
      api_version: System.get_env("MY_APP_OVH_CLIENT_API_VERSION") || "1.0"
    ]

Terms explained:

source .env

Source

Download