forked from p15670423/monkey
Added registration to aws, small typo fixes
This commit is contained in:
parent
85275f6141
commit
8c428aa44d
|
@ -23,7 +23,7 @@ class AwsEnvironment(Environment):
|
|||
return self.aws_info.get_region()
|
||||
|
||||
def get_auth_users(self):
|
||||
return [
|
||||
# TODO change this to propper registration?
|
||||
User(1, 'monkey', self.hash_secret(self._instance_id))
|
||||
]
|
||||
if self._is_registered():
|
||||
return self._config.get_users()
|
||||
else:
|
||||
return []
|
||||
|
|
|
@ -20,7 +20,7 @@ def init_jwt(app):
|
|||
|
||||
def identity(payload):
|
||||
user_id = payload['identity']
|
||||
return user_store.UserStore.userid_table.get(user_id, None)
|
||||
return user_store.UserStore.user_id_table.get(user_id, None)
|
||||
|
||||
JWT(app, authenticate, identity)
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@ from monkey_island.cc.resources.auth.auth_user import User
|
|||
class UserStore:
|
||||
users = []
|
||||
username_table = {}
|
||||
userid_table = {}
|
||||
user_id_table = {}
|
||||
|
||||
@staticmethod
|
||||
def set_users(users: List[User]):
|
||||
UserStore.users = users
|
||||
UserStore.username_table = {u.username: u for u in UserStore.users}
|
||||
UserStore.userid_table = {u.id: u for u in UserStore.users}
|
||||
UserStore.user_id_table = {u.id: u for u in UserStore.users}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react';
|
||||
import {BrowserRouter as Router, Redirect, Route, Switch} from 'react-router-dom';
|
||||
import {Container, Row} from 'react-bootstrap';
|
||||
import {Container} from 'react-bootstrap';
|
||||
|
||||
import RunServerPage from 'components/pages/RunServerPage';
|
||||
import ConfigurePage from 'components/pages/ConfigurePage';
|
||||
|
|
Loading…
Reference in New Issue