Skip to content

Extract code for embedded from mattermost-plugin-msteams plugin #11

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

Open
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

wiggin77
Copy link
Member

Summary

This is an extraction of the code needed for embedding MM in MS Teams or other M365 apps from the mattermost-plugin-msteams plugin.

Tested against the tsomrettam test tenant, and validated that SSO and notifications are working.

Ticket Link

https://mattermost.atlassian.net/browse/MM-63353

@wiggin77 wiggin77 requested a review from fmartingr April 15, 2025 03:34
@wiggin77 wiggin77 added the 2: Dev Review Requires review by a core committer label Apr 15, 2025
Copy link

@fmartingr fmartingr left a comment

Choose a reason for hiding this comment

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

LGTM. We should remove the routing behaviour in a follow-up PR.

Golangci-lint is failing, the CI installs one version of the CI and the Makefile is installing another, unsure if this has something to do with it. Also there are some issues with test since we are making an unexpected call to GetApp on plugin load, so it seems the test-helper is failing on every test.

closeCh := make(chan struct{})

// plugin.ClientMain with options allows for reattachment.
go plugin.ClientMain(

Choose a reason for hiding this comment

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

Probably needs th.appClientMock.On("GetApp", p.configuration.AppClientID).Return(&clientmodels.App{}, nil).Once() around to mock the checkCredentials call when the plugin activates.

wiggin77 and others added 2 commits April 15, 2025 09:49
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
@wiggin77
Copy link
Member Author

We should remove the routing behaviour in a follow-up PR.

I think/thought I did remove it in this PR. Do you mean remove it from the msteams-sync plugin?

@fmartingr
Copy link

We should remove the routing behaviour in a follow-up PR.

I think/thought I did remove it in this PR. Do you mean remove it from the msteams-sync plugin?

There were several pieces of logic for the routing (of the top of my mind):

  • The iframe.html router modifying the siteurl
  • The noroute parameter both in the HTML and in the backend
  • JWT handling of the audience based on the routing and developer mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2: Dev Review Requires review by a core committer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants