Commit Graph

42 Commits

Author SHA1 Message Date
jlestel
c8fed077bb Fix 401 on direct Fleet API calls (#4095)
* feat: endpoints by env

* fix: typo

* fix: useless env

* fix: format

* fix: distinct auth domain and url

* format

* fix: force issuer url if needed

* feat: new streaming based on vin

* fix refresh

* revert

* up

* feat: no need for access token / refresh token if the TOKEN env var is present

* feat: update login if token env var exists

* feat: add ENV var to allow insecure wss

* fix: remove TESLA_CN

* fix(naming): TESLA_API_URL to TESLA_API_DOMAIN

* feat: add an env var to allo invalid certs on WSS

* doc: add API domains env vars description

* fix: typo

* feat: add env var to change log level

* fix: APP_LOG_LEVEL

* feat: add TOKEN documention and wording

* fix: refacto insecure param

* feat: naming and doc

* fix: missing env var usage

* fix: rebound variable issuer_url

* fix: compilation warning on the issuer_url variable

* fix: format code

* fix: issuer_url assignments

* feat: customize polling intervals

* typo

* update doc

* typo

* add online interval

* add POLLING_ONLINE_INTERVAL

* format

* add minimum interval

* Add minimum on fetch parameter

* typo

* format

* respect immediate fetch, add charging interval

* add log level

* Respect log_level

* format

* use LOG_LEVEL env var to facilitate debug

* revert on log_level

* format

* typo

* format again

* revert on default error intervals

* Add a note in MD about polling settings

* not let the user set intervals via env variables shorter than our defaults

* Fix 401 on direct Fleet API

* try to fix in prod context

* log test

* up

* up

* format

* revert on log

* Update refresh.ex

---------

Co-authored-by: Julien <julien@citio.digital>
2024-07-27 14:06:57 +02:00
jlestel
2c4639e32d feat: allow Fleet API users to change client_id (#3984)
Co-authored-by: Julien <julien@citio.digital>
2024-06-26 10:58:31 +02:00
jlestel
4313409323 feat: Dynamic endpoints and token to use official Tesla API (self-hosted or from third party provider) (#3903)
* feat: endpoints by env

* fix: typo

* fix: useless env

* fix: format

* fix: distinct auth domain and url

* format

* fix: force issuer url if needed

* feat: new streaming based on vin

* fix refresh

* revert

* up

* feat: no need for access token / refresh token if the TOKEN env var is present

* feat: update login if token env var exists

* feat: add ENV var to allow insecure wss

* fix: remove TESLA_CN

* fix(naming): TESLA_API_URL to TESLA_API_DOMAIN

* feat: add an env var to allo invalid certs on WSS

* doc: add API domains env vars description

* fix: typo

* feat: add env var to change log level

* fix: APP_LOG_LEVEL

* feat: add TOKEN documention and wording

* fix: refacto insecure param

* feat: naming and doc

* fix: missing env var usage

* fix: rebound variable issuer_url

* fix: compilation warning on the issuer_url variable

* fix: format code

* fix: issuer_url assignments

---------

Co-authored-by: Julien <julien@citio.digital>
2024-05-27 11:03:23 +02:00
Jakob Lichterfeld
10995a3ce5 Revert "Dynamic endpoints and token to use official Tesla API (self-hosted or from third party provider) (#3866)"
This reverts commit 263f207dc9.
2024-05-20 14:07:26 +02:00
jlestel
263f207dc9 Dynamic endpoints and token to use official Tesla API (self-hosted or from third party provider) (#3866)
* feat: endpoints by env

* fix: typo

* fix: useless env

* fix: format

* fix: distinct auth domain and url

* format

* fix: force issuer url if needed

* feat: new streaming based on vin

* fix refresh

* revert

* up

* feat: no need for access token / refresh token if the TOKEN env var is present

* feat: update login if token env var exists

* feat: add ENV var to allow insecure wss

* fix: remove TESLA_CN

* fix(naming): TESLA_API_URL to TESLA_API_DOMAIN

* feat: add an env var to allo invalid certs on WSS

* doc: add API domains env vars description

* fix: typo

* feat: add env var to change log level

* fix: APP_LOG_LEVEL

* feat: add TOKEN documention and wording

* fix: refacto insecure param

* feat: naming and doc

* fix: missing env var usage

---------

Co-authored-by: Julien <julien@citio.digital>
2024-05-20 13:11:13 +02:00
Adrian Kumpf
2b3e127259 Handle invalid JWTs 2022-07-15 12:35:35 +02:00
Adrian Kumpf
8aa772872a Remove support for logins with username/password 2022-01-21 19:09:32 +01:00
Adrian Kumpf
3d1697a909 Don't parse issuer URL twice 2022-01-19 10:12:25 +01:00
Adrian Kumpf
9c9564ecc7 Exchange Chinese SSO tokens 2021-10-31 16:56:36 +01:00
Adrian Kumpf
e4234b4f25 Split auth code into smaller modules 2021-08-30 16:16:21 +02:00
Adrian Kumpf
c630ec662a Handle captcha appearing after submitting form 2021-08-30 15:06:17 +02:00
Adrian Kumpf
70b5717ae1 Make Tesla's WAF happy 2021-08-06 15:04:55 +02:00
Adrian Kumpf
be76577d5b Enter captcha code in a separate view
Addresses #1836
2021-07-16 18:28:25 +02:00
Adrian Kumpf
34d8fb7887 Fix login with captcha for accounts outside of China 2021-07-16 16:05:13 +02:00
Adrian Kumpf
88fc27efb1 Change default auth headers 2021-07-16 14:48:01 +02:00
Adrian Kumpf
99c5bc8ccc Fix login for Chinese accounts 2021-07-08 12:15:25 +02:00
Adrian Kumpf
543d53a879 Fix login with captcha 2021-07-08 10:46:00 +02:00
Adrian Kumpf
efef6ca887 Fix sign-in for Chinese accounts 2021-06-02 19:10:45 +02:00
Adrian Kumpf
1a90cdeadf Allow to sign in w/o captcha
Addresses #1658
2021-06-02 11:24:45 +02:00
Adrian Kumpf
4b4ac82cd2 Handle errors when loading captcha 2021-06-01 10:49:33 +02:00
Adrian Kumpf
e557152dfb Consolidate return types 2021-06-01 10:41:26 +02:00
Adrian Kumpf
6050657876 Remove compression middleware 2021-06-01 01:06:10 +02:00
Adrian Kumpf
c5f4b11888 Re-add login hint 2021-06-01 01:05:08 +02:00
Adrian Kumpf
b161f33c0c Show error message if account is locked 2021-06-01 00:53:35 +02:00
Adrian Kumpf
827f5aa33d Support Tesla's captcha verification 2021-06-01 00:53:32 +02:00
Iulius
ff74185ab7 typo in code_challenge_method fixed (#1571)
the code_challenge_method should be S256
2021-04-27 12:26:52 +02:00
Adrian Kumpf
535be718fc Tweak user agent randomization 2021-03-17 18:29:18 +01:00
Adrian Kumpf
0a2364656d Set another user agent for auth requests 2021-03-16 17:45:37 +01:00
Adrian Kumpf
6d31adba00 Use Mix.Project.config/0 to get version at compile time 2021-03-13 21:06:12 +01:00
Adrian Kumpf
4c9fc7e392 Update user agent used for API requests 2021-03-13 13:14:02 +01:00
Adrian Kumpf
9fee2b5afe Change default auth headers 2021-03-10 19:47:54 +01:00
Adrian Kumpf
1384023bf5 Change default headers to make Tesla WAF happy
Addresses #1369
2021-02-21 10:45:49 +01:00
Adrian Kumpf
b1991f541e Add support for v3 API tokens in China (#1300)
* Add support for v3 API tokens in China

* Add support for refreshing tokens in China

* Log auth requests without debug output

* Log failed requests to the Owner API
2021-02-06 17:28:29 +01:00
Adrian Kumpf
9ca3830f04 Refresh access tokens with new auth endpoint 2021-01-30 19:20:49 +01:00
Adrian Kumpf
3bb2d3086f Remove support for legacy auth 2021-01-30 18:06:13 +01:00
Adrian Kumpf
d825fc1723 Allow to use the legacy authentication API 2020-12-29 15:05:38 +01:00
Adrian Kumpf
bb7df800a5 Allow to enter MFA codes 2020-12-20 22:18:52 +01:00
Adrian Kumpf
bf37134995 Small refactoring 2020-12-19 21:54:36 +01:00
Adrian Kumpf
42ac182b97 Use Tesla client with custom auth middleware 2020-12-19 21:08:10 +01:00
Adrian Kumpf
df6b96b1c8 Implement MFA flow 2020-12-19 21:07:55 +01:00
Adrian Kumpf
60631907ef Replace mojito with finch 2020-05-14 14:11:20 +02:00
Adrian Kumpf
d301ac86f6 Include customized :tesla_api package 2019-12-15 15:36:26 +01:00