docker-postfix icon indicating copy to clipboard operation
docker-postfix copied to clipboard

Integration tests for XOAuth2

Open imartinezortiz opened this issue 5 years ago • 2 comments

Hi, although during the development I realized that the refresh_token is the only relevant secret regarding the XOAuth2 authentication, I just verified that I could run ./integration-test.sh xoauth2 with the token file that I had since last week. So I think that you can enable integration tests by:

  1. Login once with the testing account to obtain refresh_token and access_token
  2. Store these secrets as github secrets.
  3. Generate the .env with using the stored secrets to initialize XOAUTH2_INITIAL_ACCESS_TOKEN and XOAUTH2_INITIAL_REFRESH_TOKEN.

Although in a proper installation these variables are only used once to initialize the internal token database, seems that the XOAuth2 library can refresh the access_token without problem.

imartinezortiz avatar Nov 10 '20 22:11 imartinezortiz

Lovely, I'll check.

What I did initially (and didn't work):

  • get RT and AC
  • run tests (ok)
  • wait a bit over an hour
  • run the tests again (tests failed this time)

I haven't explored further, but you might be right -- I'll check.

bokysan avatar Nov 12 '20 11:11 bokysan

Yesterday I setup (with the same secrets) a instance of the latest container in a different machine and it worked. The only thing it is that I have enabled 2FA for that account.

imartinezortiz avatar Nov 12 '20 11:11 imartinezortiz