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()
|
return self.aws_info.get_region()
|
||||||
|
|
||||||
def get_auth_users(self):
|
def get_auth_users(self):
|
||||||
return [
|
if self._is_registered():
|
||||||
# TODO change this to propper registration?
|
return self._config.get_users()
|
||||||
User(1, 'monkey', self.hash_secret(self._instance_id))
|
else:
|
||||||
]
|
return []
|
||||||
|
|
|
@ -20,7 +20,7 @@ def init_jwt(app):
|
||||||
|
|
||||||
def identity(payload):
|
def identity(payload):
|
||||||
user_id = payload['identity']
|
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)
|
JWT(app, authenticate, identity)
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,10 @@ from monkey_island.cc.resources.auth.auth_user import User
|
||||||
class UserStore:
|
class UserStore:
|
||||||
users = []
|
users = []
|
||||||
username_table = {}
|
username_table = {}
|
||||||
userid_table = {}
|
user_id_table = {}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def set_users(users: List[User]):
|
def set_users(users: List[User]):
|
||||||
UserStore.users = users
|
UserStore.users = users
|
||||||
UserStore.username_table = {u.username: u for u in UserStore.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 React from 'react';
|
||||||
import {BrowserRouter as Router, Redirect, Route, Switch} from 'react-router-dom';
|
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 RunServerPage from 'components/pages/RunServerPage';
|
||||||
import ConfigurePage from 'components/pages/ConfigurePage';
|
import ConfigurePage from 'components/pages/ConfigurePage';
|
||||||
|
|
Loading…
Reference in New Issue