Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support deployments using Matrix Authentication Service #577

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

H-Shay
Copy link
Contributor

@H-Shay H-Shay commented Feb 26, 2025

  • Adds a config option for MAS credentials
  • Detects whether MAS is in use by presence of MAS credentials
  • Fetches and manages MAS admin token
  • Adjusts relevant endpoints (/deactivate, /admin, /lock, /unlock) if MAS is in use

Also adds support for locking users in both MAS and non-MAS deployments.

@H-Shay H-Shay requested a review from a team as a code owner February 26, 2025 20:22
@H-Shay H-Shay requested a review from turt2live February 26, 2025 21:52
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me - thanks! A few code style things to look at.

If you get a chance to add tests for the lock commands in particular, that would be good too.

}
}

public async deactivateMasUser(userId: string): Promise<void> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slight inconsistency in naming: is it MAS or Mas in functions? (either is fine - we should match existing styles if there's examples).

Comment on lines +83 to +91
await axios({
method: "post",
url: url,
headers: {
"User-Agent": "Mjolnir",
"Content-Type": "application/json; charset=UTF-8",
"Authorization": `Bearer ${accessToken.token.access_token}`,
},
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moving the axios calls to a doRequest function would be best, so if we need to update something it's a single code site. The getAccessToken() call can be in that function too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants