801faf8
Revert "On unknown IQ, reply with proper error"
Click to expand commit body
This reverts commit b5f8cc47d6eccf8214a653612527cbf76724385d.
Apparently blather is running the handlers for *all* iq, not just the
ones unhandled by others.
Stephen Paul Weber
created
a17728a
merge in "On unknown IQ, reply with proper error"
Click to expand commit body
Thanks to @singpolyma for both reporting (#8) and fixing this.
See merge request !11 for the discussion and details behind the merge.
03173c7
add copyright notice for a98b0f9 missed in c25ea8c
Denver Gingerich
created
1ed11ad
response output was lost in translation in ff64421
Click to expand commit body
In the pre-refactor code, response.to_s looks something like this:
"#<Net::HTTPOK:0x00000002b8dad8>". After the refactor in ff64421 the
chosen replacement value (http.response) outputs the entire body of
the response instead, which is more than we're looking to log. So
remove it entirely ("#<EventMachine::HttpClient:0x00000001d6b810>",
the value of http.to_s, is even less useful than response.to_s was)
and just print the response code on its own in that line now.
This happens to fix an 80-column violation introduced in ff64421 as
well, which we should probably have checked by RuboCop at some point.
Denver Gingerich
created
8428742
relax some RuboCop restrictions; missed in 349d8b0
Denver Gingerich
created
540712f
merge in "Refactor mpx-catapult to use em_promise"
Click to expand commit body
Note that the EventMachine upgrade is required here since "1.0.1 fixes
a bug with the use of epoll, which goliath's runner enables", per the
merge discussion.
See merge request !7 for the discussion and details behind this merge.
Instead of writing our own, just use the built-in Goliath runner.
This changes the usage, new usage is:
REDIS_URL=redis://localhost:6379/0 bundle exec mpx-catapult.rb -p $PORT -s -v
There is a --help for more information (provided by Goliath).
Instead of using blocking I/O, use EventMachine.
To be consistent with the rest of the project, use em_promise
Stephen Paul Weber
created
349d8b0
only print certain request fields - not all needed
Denver Gingerich
created
c25ea8c
add requisite copyright notice for a98b0f9 changes
This looks very good to me and worked fine in my testing (including
most of the cases that result in errors being returned to the user).
The changes should make sgx-catapult much more performant (especially
as we handle more load) and are generally the right thing to do.
There are a couple of minor fixes that are included in these changes
that would ideally be broken out into separate commits, but I won't
push for those here as the important part is the resulting code.
See merge request !6 for the discussion and details behind this merge.
366c568
don't crash on register <remove/>; implement later
Denver Gingerich
created
c226d87
fix split: "undefined method `b' for nil:NilClass"
Denver Gingerich
created
b1da90f
don't hang on Exception; instead, log msg and quit
Click to expand commit body
This fix introduces several "C: Use 1 (not 0) spaces for indentation."
RuboCop offenses due to the introduction of begin/end blocks that seem
to be required inside each Ruby proc that needs a rescue section.
There wasn't an obvious RuboCop setting to disable, and it's probably
worth fixing in a better way eventually, so leave them in for now.
We did have to disable the RuboCop check for "rescue Exception", which
is used liberally in this commit. In our situation, doing so is ok,
since we really do want to catch every single type of exception. It's
fine to do so since we're exiting every time regardless of the issue.
Denver Gingerich
created
8e473bb
fix 777b17d indent - RuboCop doesn't check its cfg
Denver Gingerich
created
9054cf1
as promised, use 449bb69 fix everywhere (iq close)
Denver Gingerich
created
449bb69
merge "Should not crash if id or resource missing"
Click to expand commit body
This crash is particularly bad because it currently causes
sgx-catapult to get stuck. We'll fix that in a future commit. Also,
a future commit will apply this fix to the other tagged message send.
See merge request !5 for the discussion and details behind this merge.
Denver Gingerich
created
b4c5749
Should not crash if id or resource missing
Click to expand commit body
Since id is not strictly required on messages, and bare JIDs can
certainly send message stanzas.
Stephen Paul Weber
created
a8a3d6f
unescape JID from URL - fixes Cheogram users' URLs
Denver Gingerich
created
920259a
merge "Use a standard gateway type" - XEP-0030 fix
Click to expand commit body
I must not have looked at the spec when I wrote this disco value; it
seems pretty clear that "sms" is indeed the right string to use:
https://xmpp.org/registrar/disco-categories.html#gateway
See merge request !4 for the discussion and details behind this merge.
Denver Gingerich
created
9c33beb
merge "Switch to SecureRandom.uuid" - sleeker deps
Click to expand commit body
This does not appear to have any functional changes so I'm happy to
merge something that gives us fewer dependencies.
See merge request !3 for the discussion and details behind this merge.
f3ea0f3
treat identical registration as success; fixes #3
Click to expand commit body
Rather than always sending a <conflict/> error back if we encounter an
existing registration, we first check both the catapult_jid-<P> and
catapult_cred-<J> keys. If either or both of them exist and at least
one has a different value than the user's, then we still return a
<conflict/> error. Otherwise, we set the values that the user entered
and indicate a successful registration.
This has the added advantage of allowing a person to easily fix a
partial registration. Such a thing is unlikely, but possible, given
that the setting of catapult_jid-<P> and catapult_cred-<J> are not in
the same transaction, and sgx-catapult could go down mid-registration.
Making this change was much easier thanks to the a66b574 refactoring.
Denver Gingerich
created
a66b574
factor registration into method; no func'l change
Click to expand commit body
We did have to relax some RuboCop parameters a little bit to make this
happen. But I consider these worth it, as this also commit also fixes
two much more serious RuboCop infractions! Here are the relaxations:
* Metrics/ParameterLists - increase by 1 from default; need for method
* Style/AlignParameters - off, as RuboCop too dumb to check 8-col tabs
Denver Gingerich
created
dbfb76b
reduce LRANGE to please RuboCop, thanks to 8db4e68
Denver Gingerich
created
814b166
like c811dc0, use dynamic version in mpx-catapult
Denver Gingerich
created
c811dc0
print dynamic version string; no more manual bumps
Denver Gingerich
created
777b17d
merge stylistic lint changes and RuboCop settings
Click to expand commit body
The one item I might change later is to put the parens back on
user_cap_identities and user_cap_features, but it's not that big of a
deal so I'll leave them for now.
See merge request !2 for the discussion and details behind this merge.
Denver Gingerich
created
f3acaf5
fix registration failures; good return 'OK', not 1
Click to expand commit body
I have no idea how this ended up in here - it must have worked at some
point during testing, but something must have changed since then. In
any case, proper registration wasn't being heavily tested (since most
people get registered via the jmp-register "side channel") but we want
it to work, especially if we're going to have more Cheogram users.
Configure rubocop linter and fix some inconsistencies in the existing code.
Stephen Paul Weber
created
373688b
abe7480 ver bump; eventually: auto-print commit ID
Denver Gingerich
created
abe7480
merge in "Tell existing user they are registered"
Click to expand commit body
This is slightly related to #3 as we need to use <registered/> there
as well. And this commit should also make it less likely that the
user will hit the "tries to register again" case mentioned there.
See merge request !1 for the discussion and details behind this merge.