Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Dylan Staley
@dstaley
Just so I understand correctly, you're thinking of spawing a mock server, pointing the broker binary at that server via an environment variable, and then testing the requests to the mock server? If so, would those tests be Rust unit tests, or would this be part of the E2E test?
Stéphan Kochen
@stephank
@dstaley Yes, that's correct. The test harness does the mocking in-process, for example: https://github.com/portier/portier-broker/blob/793c5987e744c6a864f38aff4dc8abcd55eccef2/tests/e2e/src/mailbox.js#L50-L61
I think right there is an okay place to add support for that, inside an if (TEST_MAILER === "mailgun") { ... }
I found E2E testing easier in this case. Especially for the Agent stuff, I guessed unit testing would be more difficult. :)
Dylan Staley
@dstaley
Okay awesome! I think this gives me enough to get something started. Do you have any objections to using Jest as the test runner? That way we can focus on actually testing the broker instead of implementing test framework features.
Stéphan Kochen
@stephank
@dstaley Hmm, no idea, haven't used it. If you think it'd really reduce the amount of code, feel free to try. I'm also worried it's just more work and complexity. :)
Feels like most of the code in the E2E test harness right now is fairly specific to what we're testing?
Dylan Staley
@dstaley
Okay I'll take a stab without Jest! I saw it wasn't using a framework but I didn't look too closely at what it does and doesn't support
Dylan Staley
@dstaley
@stephank I spent some time today working on figuring out the best way to make assertions against network requests in the E2E test. In order to help me understand how all the pieces worked, and to give me some additional confidence things were working correctly, I wrote TypeScript-compatible JSDoc comments in the tests. The TypeScript compiler was able to pull types for every library except the node portier client. I went to look at how hard it would be to add types, and was surprised to see it was already in TypeScript! Would you mind if I also convert the E2E tests to TypeScript as well? (I can also send a PR to enable declaration emission for the node-portier library as well)
Stéphan Kochen
@stephank
@dstaley Sure! Though, I'm using node-portier in TS at $work and it works fine? Declarations should already be there.
Stéphan Kochen
@stephank
Hmm, maybe I'm wrong. It looks like we're only using it from small JS projects so far. But tsconfig has declarations enabled, so I'm guessing it's a packaging issue.
Dylan Staley
@dstaley
Yup we just need to add a "types" key to package.json
Stéphan Kochen
@stephank
I'm considering scrapping the public suffix list thing. :(
Thinking the semantics are too vague. Its real purpose is add checks to browser cookies after a domain has already been resolved (and thus verified existing). For example, this issue reiterates this: publicsuffix/list#570
So really, the question here is: do we support the use case of using the public suffix list on arbitrary inputs, or do we only support the use case of determining the public suffix for a domain which is in the DNS?
I guess the PR is still a better implementation of the ICANN TLD list. And we should still add the fetch & refresh code just for that. (Plus it adds allow/block lists)
But I kinda wanted to do a DNS check any way, so don't think the public suffix list adds much.
onli
@onli
sounds right, it should not be needed if we can confirm the domain exists before sending the email
The last time the problem was that the DNS lookup could not be made async?
Stéphan Kochen
@stephank
Think so, yes. Plus we need to do both MX and A lookups, which we can't do using OS facilities, I think. So I was thinking about adding an explicit resolver option, which enables the DNS check with explanation.
Stéphan Kochen
@stephank
I don't understand why PRs aren't built by github actions. Tried tweaking the workflow, but still not working. :/
PRs from outside of the org, that is
Stéphan Kochen
@stephank
Every now and then I see outlook.com fail our DMARC rules. I assume this is legit bad actors trying to send mail from portier.io, but I'm not sure if someone has an account there and can maybe do a quick check to see if https://demo.portier.io works?
Dylan Staley
@dstaley
@stephank no issues using my outlook.com email
onli
@onli
@stephank I let someone test it with hotmail.com and that worked as well
Stéphan Kochen
@stephank
Awesome, thanks! Guess it's nothing to worry about then. :)
colemickens
@colemickens:matrix.org
[m]
hello from the Matrix side
onli
@onli
Hey Matrixside
Stéphan Kochen
@stephank
Bleh, it looks like cargo cache is getting corrupted on macOS CI. I fixed it once for #227, but now it's broken again on master. Considering we should just disable cache. :/
onli
@onli
maybe something we can keep local only, .gitignore it?
onli
@onli
ah, ok
Dylan Staley
@dstaley:matrix.org
[m]
I think the issue can be fixed by using gnu-tar. actions/cache#403
It's going to be added to the macOS images in a few weeks
colemickens:matrix.org @colemickens:matrix.org waves at Dylan
Stéphan Kochen
@stephank
Oh, good catch! Will try that now
Stéphan Kochen
@stephank
Two consecutive builds went well, so looks good. :)
Bleh, we also need to figure out why Safari tests are timing out 50% of the time :/
jestarray
@jestarray
can portier be used for applications outside the web? i was thinking of using it to authenticate users for my game made in rust. I presume all I would need to do is to make a post request to the brokers /auth path?
Dylan Staley
@dstaley:matrix.org
[m]
Yup! Just make sure to set your Accept header to json so it doesn't serve redirects and HTML.