Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Add that stinkin' API, mofo #5

Merged
merged 12 commits into from
Jan 3, 2020
Merged

Add that stinkin' API, mofo #5

merged 12 commits into from
Jan 3, 2020

Conversation

itsthejoker
Copy link
Member

@itsthejoker itsthejoker commented Jan 3, 2020

Description:

Allows us to point the bots at the website to do some serious cookin'.

Testing Instructions:

This requires that a couple things happen:

  1. all requests to the API (right now) must come from a staff user
  2. all requests to the API must contain a valid API key as a header under the key HTTP_X_API_KEY

beyond that, everything should just work. Tests are at 99%.

Checklist:

  • Code Quality
  • Pep-8
  • Tests (if applicable)
  • Success Criteria Met
  • Inline Documentation
  • Wiki Documentation (if applicable)

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>
Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>
Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>
Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>
Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>
Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>
Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>
Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>
Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>
Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>
Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>
Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>
@itsthejoker itsthejoker requested a review from a team as a code owner January 3, 2020 03:00
@itsthejoker itsthejoker merged commit 578750a into master Jan 3, 2020
@itsthejoker itsthejoker deleted the add-api branch January 3, 2020 16:10
@@ -1,6 +1,50 @@
import pytest
from rest_framework.test import APIClient, APIRequestFactory
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've generally seen automated tests in a completely different directory (e.g., named tests/) than the application code. If we were packaging up this project as a wheel--and yes, I am working toward that goal 😉--we would be including tests with the packaged assets, right?

Is there some way to exclude tests from what poetry packages up? Why did you decide to embed test code next to the application code instead of as a separate section?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/finswimmer/poetry/blob/0048b56de5e6e2eb0ba4e657a6c551616afbfdc8/tests/masonry/builders/fixtures/exclude_nested_data_toml/pyproject.toml#L12

As far as why put it as part of the application... that's... uh... just where it ended up? I'm not partial to it -- it was just easier to access there.

blossom/management/commands/bootstrap_site.py Show resolved Hide resolved
blossom/models.py Show resolved Hide resolved
blossom/payments/views.py Show resolved Hide resolved
else:
stripe.api_key = "sk_live_s0i8NF8WBfvio39nvqqzvJiG"
stripe.api_key = os.environ.get("STRIPE_PROD_KEY", "sk_live_abcdefghijk")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we instead replace this with something that throws an exception if it doesn't exist? Perhaps os.environ['STRIPE_PROD_KEY']?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially, but there are tests keyed to this value. See

assert "live" in stripe.api_key

blossom/api/bootstrap/helpers.py Show resolved Hide resolved
blossom/api/bootstrap/helpers.py Show resolved Hide resolved
blossom/api/bootstrap/db.py Show resolved Hide resolved
blossom/api/authentication.py Show resolved Hide resolved
@@ -2,9 +2,9 @@

![Image of Blossom, from 1998's Powerpuff Girls](https://vignette.wikia.nocookie.net/powerpuff/images/2/23/Blossom-pic.png/revision/latest?cb=20190329151816)

The website. The app. The everything. MUST REMAIN PRIVATE.
The website. The app. The everything.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Until we scrub the git history of all previous commits that included actual secrets, we should still keep this repo private.

itsthejoker added a commit that referenced this pull request May 14, 2021
# This is the 1st commit message:

wooo

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #2:

moving computers

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #3:

v1 complete

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #4:

documentation

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #5:

code cleanup and minor bug fixes

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #6:

progress

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #7:

finish feature

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #8:

cleanup and help text

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>
itsthejoker pushed a commit that referenced this pull request May 14, 2021
# This is the 1st commit message:

wooo

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #2:

moving computers

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #3:

v1 complete

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #4:

documentation

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #5:

code cleanup and minor bug fixes

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #6:

progress

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #7:

finish feature

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #8:

cleanup and help text

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #9:

working wiki integration

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #10:

wiki branding

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #11:

documentation

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>
itsthejoker pushed a commit that referenced this pull request May 14, 2021
# This is the 1st commit message:

wooo

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #2:

moving computers

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #3:

v1 complete

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #4:

documentation

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #5:

code cleanup and minor bug fixes

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #6:

progress

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #7:

finish feature

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #8:

cleanup and help text

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #9:

working wiki integration

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #10:

wiki branding

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #11:

documentation

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #12:

add migrations, update settings to allow for postgres db, and fix betterexceptions

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #13:

add graphical editor

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>

# This is the commit message #14:

usability fixes and a little fun

Signed-off-by: Joe Kaufeld <joe.kaufeld@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants