Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more authentication methods #103

Merged
merged 18 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions conda-store-server/conda_store_server/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,20 @@ class CondaStoreServer(Application):
config=True,
)

secret_key = Unicode(
"super_secret_key",
config=True,
help="A secret key needed for some authentication methods, session storage, etc.",
)

def initialize(self, *args, **kwargs):
super().initialize(*args, **kwargs)
self.load_config_file(self.config_file)

def start(self):
app = Flask(__name__)
CORS(app, resources={r"/api/v1/*": {"origins": "*"}})
app.secret_key = self.secret_key

if self.enable_api:
app.register_blueprint(views.app_api)
Expand All @@ -76,9 +83,7 @@ def start(self):
app.register_blueprint(views.app_metrics)

app.conda_store = CondaStore(parent=self, log=self.log)
app.authentication = self.authentication_class(
parent=self, log=self.log, app=app
)
app.authentication = self.authentication_class(parent=self, log=self.log)

# add dynamic routes
for route, method, func in app.authentication.routes:
Expand All @@ -89,6 +94,6 @@ def start(self):
app.conda_store.configuration.update_storage_metrics(
app.conda_store.db, app.conda_store.store_directory
)
app.conda_store.ensure_conda_channels()
# app.conda_store.ensure_conda_channels()
jaimergp marked this conversation as resolved.
Show resolved Hide resolved

app.run(debug=True, host=self.address, port=self.port)
Loading