feat(39): users()->updateProfilePhoto + deleteProfilePhoto — admin-token multipart upload#40
Open
jordanpartridge wants to merge 1 commit into
Open
feat(39): users()->updateProfilePhoto + deleteProfilePhoto — admin-token multipart upload#40jordanpartridge wants to merge 1 commit into
jordanpartridge wants to merge 1 commit into
Conversation
…ken multipart upload
Adds a clean swap for the lexi-agent SetProfilePhoto tool: a multipart
POST /users/{id}/image (accepts file path, SplFileInfo, or stream) and
the matching DELETE for resetting to the default avatar.
Bots can't update their own avatar with their own token — pair the
package with a second named connection that holds an admin-grade token,
documented in README "Multi-server > Admin-token operations".
Mattermost::fake() recorder gains assertProfilePhotoUpdated and
assertProfilePhotoReset, both filterable by user id.
Closes #39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /api/v4/users/{user_id}/imagerequest and the matchingDELETEfor reset-to-default.Users::updateProfilePhoto(string $userId, string|SplFileInfo|resource $image, ?string $filename = null)andUsers::deleteProfilePhoto(string $userId)on the resource.MattermostFake::assertProfilePhotoUpdated()/assertProfilePhotoReset()(filter by user id, exposed on the facade).Mattermost::connection('admin').This unblocks the last direct
MattermostServicecall site in synapse-sentinel/lexi.Test plan
vendor/bin/pest --compact— 347 passed (619 assertions), 16 integration skipped (no docker)vendor/bin/pint --test— cleanvendor/bin/phpstan analyse— level 8, no errorsdocker compose up -dand runvendor/bin/pest --testsuite=Integrationto exercise the admin-token round-trip and the bot-token rejection pathCloses #39