|
1 | 1 | # |
2 | 2 | # This file is part of Edgehog. |
3 | 3 | # |
4 | | -# Copyright 2022-2023 SECO Mind Srl |
| 4 | +# Copyright 2022-2026 SECO Mind Srl |
5 | 5 | # |
6 | 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
7 | 7 | # you may not use this file except in compliance with the License. |
@@ -30,14 +30,6 @@ defmodule Edgehog.Config do |
30 | 30 | alias Edgehog.Geolocation |
31 | 31 | alias Edgehog.Geolocation.Providers.GoogleGeocoding |
32 | 32 |
|
33 | | - @envdoc """ |
34 | | - Disables admin authentication. CHANGING IT TO TRUE IS GENERALLY A REALLY BAD IDEA IN A PRODUCTION ENVIRONMENT, IF YOU DON'T KNOW WHAT YOU ARE DOING. |
35 | | - """ |
36 | | - app_env :disable_admin_authentication, :edgehog, :disable_admin_authentication, |
37 | | - os_env: "DISABLE_ADMIN_AUTHENTICATION", |
38 | | - type: :boolean, |
39 | | - default: false |
40 | | - |
41 | 33 | @envdoc "The Admin API JWT public key." |
42 | 34 | app_env :admin_jwk, :edgehog, :admin_jwk, |
43 | 35 | os_env: "ADMIN_JWT_PUBLIC_KEY_PATH", |
@@ -67,14 +59,6 @@ defmodule Edgehog.Config do |
67 | 59 | type: :boolean, |
68 | 60 | default: false |
69 | 61 |
|
70 | | - @envdoc """ |
71 | | - Disables tenant authentication. CHANGING IT TO TRUE IS GENERALLY A REALLY BAD IDEA IN A PRODUCTION ENVIRONMENT, IF YOU DON'T KNOW WHAT YOU ARE DOING. |
72 | | - """ |
73 | | - app_env :disable_tenant_authentication, :edgehog, :disable_tenant_authentication, |
74 | | - os_env: "DISABLE_TENANT_AUTHENTICATION", |
75 | | - type: :boolean, |
76 | | - default: false |
77 | | - |
78 | 62 | @envdoc "The API key for the ipbase.com geolocation provider." |
79 | 63 | app_env :ipbase_api_key, :edgehog, :ipbase_api_key, |
80 | 64 | os_env: "IPBASE_API_KEY", |
@@ -112,12 +96,6 @@ defmodule Edgehog.Config do |
112 | 96 | type: GeocodingProviders, |
113 | 97 | default: [GoogleGeocoding] |
114 | 98 |
|
115 | | - @doc """ |
116 | | - Returns true if admin authentication is disabled. |
117 | | - """ |
118 | | - @spec admin_authentication_disabled?() :: boolean() |
119 | | - def admin_authentication_disabled?, do: disable_admin_authentication!() |
120 | | - |
121 | 99 | @doc """ |
122 | 100 | Returns true if edgehog should use an ssl connection with the database. |
123 | 101 | """ |
@@ -179,12 +157,6 @@ defmodule Edgehog.Config do |
179 | 157 | else: false |
180 | 158 | end |
181 | 159 |
|
182 | | - @doc """ |
183 | | - Returns true if tenant authentication is disabled. |
184 | | - """ |
185 | | - @spec tenant_authentication_disabled?() :: boolean() |
186 | | - def tenant_authentication_disabled?, do: disable_tenant_authentication!() |
187 | | - |
188 | 160 | @doc """ |
189 | 161 | Returns the list of geolocation modules to use. |
190 | 162 | """ |
@@ -215,11 +187,7 @@ defmodule Edgehog.Config do |
215 | 187 | """ |
216 | 188 | @spec validate_admin_authentication!() :: :ok | no_return() |
217 | 189 | def validate_admin_authentication! do |
218 | | - if admin_authentication_disabled?() do |
219 | | - :ok |
220 | | - else |
221 | | - admin_jwk!() |
222 | | - :ok |
223 | | - end |
| 190 | + admin_jwk!() |
| 191 | + :ok |
224 | 192 | end |
225 | 193 | end |
0 commit comments