westerveltco / django-opfield

A custom Django field for storing and securely accessing a 1Password vault item
https://django-opfield.westervelt.dev
MIT License
3 stars 0 forks source link

Add some proper integration tests #19

Open joshuadavidthomas opened 2 months ago

joshuadavidthomas commented 2 months ago

There's a little too much mocking for my liking in the test suite, but it seemed like the quickest way to test the library's functionality. I'd really like to add some actual integration tests that use a real 1Password vault.

I think the right idea would be to throw it behind a pytest mark that is skipped automatically. Then dedicate a whole 1Password vault for the tests, with the ability to automatically load some secrets (via a pytest fixture?) at the start of the test run that could then be used through out the run.

I would also want to use a service account that only had access to that single test vault.

joshuadavidthomas commented 2 months ago

Only thing that makes me hesitate is which 1Password account to use in CI? Locally I could have setup instructions for anyone to follow.

I imagine I could just use my company's account, but what happens if for whatever reason I no longer have access to it?

joshuadavidthomas commented 2 months ago

Can a free account access service accounts and/or Connect servers (#16)?

joshuadavidthomas commented 2 months ago

There is this: https://github.com/1Password/for-open-source