Skip to content

Commit

Permalink
Remove unneeded oauth config (#493)
Browse files Browse the repository at this point in the history
* Remove unneeded oauth config

* fix tests
  • Loading branch information
amCap1712 authored Dec 12, 2024
1 parent d516ad4 commit fe42b16
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion config.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ STRIPE_KEYS = {

# if developing payment integration locally, change this to your localhost url
SERVER_BASE_URL = "http://localhost:8000"
SERVER_NAME = "localhost:8000"

MUSICBRAINZ_SERVER = "https://beta.musicbrainz.org"

Expand Down
1 change: 0 additions & 1 deletion consul_config.py.ctmpl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ MAIL_FROM_DOMAIN = '''{{template "KEY" "mail_from_domain"}}'''
PREFERRED_URL_SCHEME = '''{{template "KEY" "preferred_url_scheme"}}'''

SERVER_BASE_URL = f"{PREFERRED_URL_SCHEME}://{MAIL_FROM_DOMAIN}"
SERVER_NAME = None

{{if service "pgbouncer-slave"}}
{{with index (service "pgbouncer-slave") 0}}
Expand Down
2 changes: 1 addition & 1 deletion develop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function invoke_docker_compose {
}

function invoke_manage {
invoke_docker_compose run --rm meb_web \
invoke_docker_compose run --rm web \
python3 manage.py \
"$@"
}
Expand Down
6 changes: 5 additions & 1 deletion frontend/js/src/forms/DeleteApplication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ function DeleteApplication({
<a href={cancel_url} className="btn btn-default">
Cancel
</a>
<button type="submit" className="btn btn-danger" style={{ marginLeft: "8px" }}>
<button
type="submit"
className="btn btn-danger"
style={{ marginLeft: "8px" }}
>
Delete
</button>
</div>
Expand Down
3 changes: 0 additions & 3 deletions oauth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ def create_app(debug=None, config_path=None):
"..", "config.py"
))

app.config["SERVER_BASE_URL"] = "http://localhost:8150"
app.config["SERVER_NAME"] = "localhost:8150"

# Load configuration files: If we're running under a docker deployment, wait until
# the consul configuration is available.
if deploy_env:
Expand Down
2 changes: 1 addition & 1 deletion oauth/tests/test_oauth_authorization_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ def test_oauth_authorize_logged_out(self):
self.assertEqual(parsed.path, "/login")

fragment_args = parse_qs(parsed.query)
self.assertEqual(unquote(fragment_args["returnto"][0]), f"http://{self.app.config['SERVER_NAME']}/oauth2/authorize?client_id={application['client_id']}&response_type=code&scope=test-scope-1&state=random-state&redirect_uri=https://example.com/callback")
self.assertEqual(unquote(fragment_args["returnto"][0]), f"http://localhost/oauth2/authorize?client_id={application['client_id']}&response_type=code&scope=test-scope-1&state=random-state&redirect_uri=https://example.com/callback")

@pytest.mark.skip
def test_oauth_authorize_parameter_reuse(self):
Expand Down
2 changes: 1 addition & 1 deletion oauth/tests/test_oauth_implicit.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def test_oauth_authorize_logged_out(self):
self.assertEqual(parsed.path, "/login")

fragment_args = parse_qs(parsed.query)
self.assertEqual(unquote(fragment_args["returnto"][0]), f"http://{self.app.config['SERVER_NAME']}/oauth2/authorize?client_id={application['client_id']}&response_type=token&scope=test-scope-1&state=random-state&redirect_uri=https://example.com/callback")
self.assertEqual(unquote(fragment_args["returnto"][0]), f"http://localhost/oauth2/authorize?client_id={application['client_id']}&response_type=token&scope=test-scope-1&state=random-state&redirect_uri=https://example.com/callback")

def test_oauth_authorize_multiple_redirect_uris(self):
application = self.create_oauth_app(redirect_uris=[
Expand Down

0 comments on commit fe42b16

Please sign in to comment.