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

Add request query parameter map to instruction struct #37

Merged
merged 1 commit into from
Nov 11, 2020

Conversation

anoadragon453
Copy link
Member

@anoadragon453 anoadragon453 commented Nov 9, 2020

This allows passing query parameters to a request while executing an instruction.

This will be useful for e.g sending server_name query parameters while attempting to join a room.

I've confirmed that Dendrite still passes all tests even with this change.

This allows passing query parameters to a request while executing
an instruction.
@kegsay
Copy link
Member

kegsay commented Nov 9, 2020

I don't see the use case here. Instructions are for pre-configuring a HS, which allows referencing via homeserver name e.g hs1. If we want to test ?server_name= then we'd need to write code for it, it wouldn't be done as a blueprint.

@anoadragon453
Copy link
Member Author

@kegsay This came out of #38 and wanting to stick a server_name on the /join/!room:id call that happens during a blueprint setup:

if event.Type == "m.room.member" && event.StateKey != nil &&
event.Content != nil && event.Content["membership"] != nil {
membership := event.Content["membership"].(string)
if membership == "join" {
path = "/_matrix/client/r0/join/$roomId"
method = "POST"
}
}

If the homeserver doesn't support parsing room IDs for domains then this command will fail.

Perhaps there's a better way to achieve this though?

@kegsay
Copy link
Member

kegsay commented Nov 11, 2020

Oh I see, is extracting the domain from the room ID non-spec then? I guess we'd need to add in some form of server name to the blueprint then yes.

@kegsay kegsay merged commit 9366ba5 into master Nov 11, 2020
@anoadragon453 anoadragon453 deleted the anoa/instr_query_params branch November 11, 2020 17:55
anoadragon453 added a commit that referenced this pull request Nov 17, 2020
* 'master' of github.com:matrix-org/complement:
  Add request query parameter map to instruction struct (#37)
  Add CA generation and mount it to /ca in containers (#28)
  Federation: return Content-Type header of 'application/json' by default (#35)
  Up the default version check iterations from 50 to 100 (#34)
  Provide an empty json dict to /createRoom instead of no body (#36)
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.

None yet

2 participants