Skip to content

Commit f95544b

Browse files
Merge pull request #69 from OpenFuturePlatform/SA-46_Get_rid_of_old_API_keys
Sa 46 get rid of old api keys
2 parents 533e07d + c909302 commit f95544b

64 files changed

Lines changed: 216 additions & 2145 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docker-compose/open-api.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: '3.1'
2+
3+
services:
4+
5+
open-api-postgres:
6+
image: postgres
7+
container_name: open-api-postgres
8+
restart: always
9+
ports:
10+
- "5434:5432"
11+
environment:
12+
POSTGRES_USER: root
13+
POSTGRES_PASSWORD: root
14+
volumes:
15+
- open-api-postgres-data:/var/lib/postgres
16+
17+
volumes:
18+
open-api-postgres-data:

frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"eject": "react-scripts eject"
4343
},
4444
"devDependencies": {
45+
"http-proxy-middleware": "^2.0.2",
4546
"lodash": "^4.17.20"
4647
},
4748
"browserslist": {

frontend/src/App.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { fetchGlobalProperties } from './actions/global-properties';
44
import { fetchUser } from './actions/index';
55
import { connect } from 'react-redux';
66
import Scaffolds from './scenes/Scaffolds';
7-
import Keys from './scenes/Keys';
87
import Header from './components/Header';
98
import GatewayApplication from "./scenes/GatewayApplication";
109
import { Container } from 'semantic-ui-react';
@@ -39,7 +38,6 @@ class App extends Component {
3938
return (
4039
<Switch>
4140
<Route path="/scaffolds" component={Scaffolds} />
42-
<Route path="/keys" component={Keys} />
4341
<Route path="/applications" component={GatewayApplication} />
4442
<Redirect from="*" to="/scaffolds" />
4543
</Switch>

frontend/src/actions/deploy-contract.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export const deployEthereumContractByApi = formValues => async dispatch => {
2121
return scaffold.address;
2222
};
2323

24-
export const compileEthereumContract = (openKey, properties) => async dispatch => {
25-
return await dispatch(apiPost(getEthereumScaffoldDoCompile(), { openKey, properties }));
24+
export const compileEthereumContract = (properties) => async dispatch => {
25+
return await dispatch(apiPost(getEthereumScaffoldDoCompile(), { properties }));
2626
};
2727

2828
export const processDeploy = async (contract, bin, platformAddress, formValues) => {
@@ -44,7 +44,7 @@ export const deployEthereumContractByMetaMask = formValues => async (dispatch, g
4444
const {
4545
globalProperties: { platformAddress }
4646
} = getState();
47-
const { abi, bin } = await dispatch(compileEthereumContract(formValues.openKey, formValues.properties));
47+
const { abi, bin } = await dispatch(compileEthereumContract(formValues.properties));
4848
const contract = new web3.eth.Contract(JSON.parse(abi));
4949
const newContractInstance = await processDeploy(contract, bin, platformAddress, formValues);
5050
const address = newContractInstance.options.address;

frontend/src/actions/keys.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

frontend/src/components/Header.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ class Header extends Component {
3030
<Dropdown.Item text='Open' as={Link} to={'/scaffolds/open'}/>
3131
</Dropdown.Menu>
3232
</Dropdown>
33-
{/*<Link className="item" to={'/keys'}>
34-
Key Management
35-
</Link>*/}
3633
<Link className="item" to={'/applications'}>
3734
Applications
3835
</Link>

frontend/src/scenes/EthereumScaffoldForm.js

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ import {MIN_BALANCE} from '../const/index';
1717
import {getMetaMaskErrorMessage} from '../selectors/getMetaMaskError';
1818
import {TemplateSelect} from '../components/TemplateSelect';
1919
import {WalletSelect} from '../components/WalletSelect';
20-
import {fetchKeys} from '../actions/keys';
2120
import {t} from '../utils/messageTexts';
2221

2322
class EthereumScaffoldForm extends Component {
2423
componentDidMount() {
25-
this.props.actions.fetchKeys();
2624
if (!this.props.byApiMethod) {
2725
this.props.actions.subscribeEthAccount();
2826
this.initDeveloperAddressValidation();
@@ -93,8 +91,8 @@ class EthereumScaffoldForm extends Component {
9391
};
9492

9593
render() {
96-
const { formValues, invalid, scaffoldFieldsErrors, openKeyOptions, byApiMethod } = this.props;
97-
const fieldErrors = _.flatten(scaffoldFieldsErrors).length !== 0 ? true : false;
94+
const { formValues, invalid, scaffoldFieldsErrors, byApiMethod } = this.props;
95+
const fieldErrors = _.flatten(scaffoldFieldsErrors).length !== 0;
9896
const disableSubmit = invalid || fieldErrors;
9997
const developerAddressValidations = !byApiMethod ? [this.validateBalance] : [];
10098

@@ -107,17 +105,6 @@ class EthereumScaffoldForm extends Component {
107105
<Grid.Column width={16} style={{ paddingTop: '10px' }}>
108106
<TemplateSelect />
109107
</Grid.Column>
110-
<Grid.Column width={16} style={{ paddingTop: '10px' }}>
111-
<Field
112-
key={1}
113-
className="ui selection fluid dropdown"
114-
placeholder="Choose Developer API Key"
115-
component={DropdownField}
116-
options={openKeyOptions}
117-
type="text"
118-
name="openKey"
119-
/>
120-
</Grid.Column>
121108
<Grid.Column width={16}>
122109
<Field
123110
key={2}
@@ -257,9 +244,7 @@ const getValues = getFormValues('scaffoldCreationForm');
257244
const mapStateToProps = state => {
258245
const formValues = getValues(state) || {};
259246
const initialValues = state.scaffoldFeilds;
260-
const openKey = state.auth ? state.auth.openKeys : undefined;
261247
const scaffoldFieldsErrors = validateScaffoldProperties(formValues.properties || []);
262-
const openKeyOptions = state.keys.filter(it => it.enabled).map(it => ({ text: it.value, value: it.value }));
263248
const ethAccount = state.ethAccount;
264249
const byApiMethod = state.auth.byApiMethod;
265250
const metaMaskError = getMetaMaskErrorMessage(state);
@@ -270,9 +255,7 @@ const mapStateToProps = state => {
270255
byApiMethod,
271256
ethAccount,
272257
formValues,
273-
openKey,
274-
scaffoldFieldsErrors,
275-
openKeyOptions
258+
scaffoldFieldsErrors
276259
};
277260
};
278261

@@ -282,8 +265,7 @@ const mapDispatchToProps = dispatch => ({
282265
convertCurrencies,
283266
deployEthereumContract,
284267
subscribeEthAccount,
285-
unsubscribeEthAccount,
286-
fetchKeys
268+
unsubscribeEthAccount
287269
},
288270
dispatch
289271
)

frontend/src/scenes/GatewayApplicationSummary.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import {fetchGatewayApplicationDetails} from "../actions/gateways";
77

88
import {GatewayApplicationWallet} from "../components/GatewayApplicationWallet";
99
import {getGatewayApplicationWallet} from "../actions/gateway-wallet";
10-
import {KeyGenerate} from "../components/KeyGenerate";
11-
import {WalletGenerate} from "../components/GatewayApplicationWalletGenerate";
1210
import {GatewayKeyGenerate} from "../components/GatewayApplicationKeyGenerate";
1311

1412
class GatewayApplicationSummary extends Component {

frontend/src/scenes/Keys.js

Lines changed: 0 additions & 68 deletions
This file was deleted.

frontend/src/scenes/OpenScaffoldForm.js

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,14 @@ import {connect} from 'react-redux';
44
import {Field, FieldArray, getFormValues, reduxForm} from 'redux-form';
55
import {withRouter} from 'react-router-dom';
66
import {Button, Grid} from 'semantic-ui-react';
7-
import {DropdownField} from 'react-semantic-redux-form';
87
import {asyncValidate, validate, validateScaffoldProperties, warn} from '../utils/validation';
98
import ScaffoldField from '../components-ui/inputs/Field';
109
import {saveOpenScaffold} from '../actions/deploy-contract';
11-
import {fetchKeys} from '../actions/keys';
1210
import {TemplateSelect} from "../components/TemplateSelect";
1311
import ScaffoldPropertyFields from "../components-ui/inputs/PropertyFields";
1412

1513
class OpenScaffoldForm extends Component {
1614

17-
componentDidMount() {
18-
this.props.actions.fetchKeys();
19-
}
20-
2115
handleOnSubmit = async e => {
2216
const {actions, history, formValues} = this.props;
2317
e.preventDefault();
@@ -31,7 +25,7 @@ class OpenScaffoldForm extends Component {
3125
};
3226

3327
render() {
34-
const { invalid: disableSubmit,formValues, scaffoldFieldsErrors, openKeyOptions } = this.props;
28+
const { invalid: disableSubmit,formValues, scaffoldFieldsErrors } = this.props;
3529

3630
return (
3731
<form onSubmit={this.handleOnSubmit}>
@@ -40,17 +34,6 @@ class OpenScaffoldForm extends Component {
4034
<Grid.Column width={16} style={{ paddingTop: '10px' }}>
4135
<TemplateSelect />
4236
</Grid.Column>
43-
<Grid.Column width={16} style={{paddingTop: '10px'}}>
44-
<Field
45-
key={1}
46-
className="ui selection fluid dropdown"
47-
placeholder="Choose Developer API Key"
48-
component={DropdownField}
49-
options={openKeyOptions}
50-
type="text"
51-
name="openKey"
52-
/>
53-
</Grid.Column>
5437
<Grid.Column width={16}>
5538
<Field
5639
key={2}
@@ -168,24 +151,19 @@ const getValues = getFormValues('openScaffoldCreationForm');
168151
const mapStateToProps = state => {
169152
const formValues = getValues(state) || {};
170153
const initialValues = state.scaffoldFeilds;
171-
const openKey = state.auth ? state.auth.openKeys : undefined;
172154
const scaffoldFieldsErrors = validateScaffoldProperties(formValues.properties || []);
173-
const openKeyOptions = state.keys.filter(it => it.enabled).map(it => ({text: it.value, value: it.value}));
174155

175156
return {
176157
formValues,
177158
initialValues,
178-
openKey,
179159
scaffoldFieldsErrors,
180-
openKeyOptions
181160
};
182161
};
183162

184163
const mapDispatchToProps = dispatch => ({
185164
actions: bindActionCreators(
186165
{
187-
saveOpenScaffold: saveOpenScaffold,
188-
fetchKeys
166+
saveOpenScaffold: saveOpenScaffold
189167
},
190168
dispatch
191169
)

0 commit comments

Comments
 (0)