communication: use MAS for internal password logins

This commit is contained in:
Brad Stein 2026-01-01 12:57:00 -03:00
parent 0f1f34c52a
commit 554061711c
4 changed files with 13 additions and 4 deletions

View File

@ -29,7 +29,7 @@ spec:
- name: MATRIX_BASE
value: http://othrys-synapse-matrix-synapse:8008
- name: AUTH_BASE
value: http://othrys-synapse-matrix-synapse:8008
value: http://matrix-authentication-service:8080
- name: BOT_USER
value: atlasbot
- name: BOT_PASS

View File

@ -19,6 +19,8 @@ spec:
env:
- name: SYNAPSE_BASE
value: http://othrys-synapse-matrix-synapse:8008
- name: AUTH_BASE
value: http://matrix-authentication-service:8080
- name: SEEDER_USER
value: othrys-seeder
- name: SEEDER_PASS
@ -39,10 +41,11 @@ spec:
NOUN = ["otter","falcon","comet","ember","grove","harbor","meadow","raven","river","summit"]
BASE = os.environ["SYNAPSE_BASE"]
AUTH_BASE = os.environ.get("AUTH_BASE", BASE)
OTHRYS = "!orejZnVfvbAmwQDYba:live.bstein.dev"
def login(user, password):
r = requests.post(f"{BASE}/_matrix/client/v3/login", json={
r = requests.post(f"{AUTH_BASE}/_matrix/client/v3/login", json={
"type": "m.login.password",
"identifier": {"type": "m.id.user", "user": user},
"password": password,

View File

@ -22,6 +22,8 @@ spec:
env:
- name: SYNAPSE_BASE
value: http://othrys-synapse-matrix-synapse:8008
- name: AUTH_BASE
value: http://matrix-authentication-service:8080
- name: SEEDER_USER
value: othrys-seeder
- name: SEEDER_PASS
@ -39,6 +41,7 @@ spec:
import os, requests, urllib.parse
BASE = os.environ["SYNAPSE_BASE"]
AUTH_BASE = os.environ.get("AUTH_BASE", BASE)
ROOM_ALIAS = "#othrys:live.bstein.dev"
MESSAGE = (
"Invite guests: share https://live.bstein.dev/#/room/#othrys:live.bstein.dev?action=join "
@ -48,7 +51,7 @@ spec:
def auth(token): return {"Authorization": f"Bearer {token}"}
def login(user, password):
r = requests.post(f"{BASE}/_matrix/client/v3/login", json={
r = requests.post(f"{AUTH_BASE}/_matrix/client/v3/login", json={
"type": "m.login.password",
"identifier": {"type": "m.id.user", "user": user},
"password": password,

View File

@ -20,6 +20,8 @@ spec:
env:
- name: SYNAPSE_BASE
value: http://othrys-synapse-matrix-synapse:8008
- name: AUTH_BASE
value: http://matrix-authentication-service:8080
- name: SEEDER_USER
value: othrys-seeder
- name: SEEDER_PASS
@ -44,9 +46,10 @@ spec:
import os, requests, urllib.parse
BASE = os.environ["SYNAPSE_BASE"]
AUTH_BASE = os.environ.get("AUTH_BASE", BASE)
def login(user, password):
r = requests.post(f"{BASE}/_matrix/client/v3/login", json={
r = requests.post(f"{AUTH_BASE}/_matrix/client/v3/login", json={
"type": "m.login.password",
"identifier": {"type": "m.id.user", "user": user},
"password": password,