Skip to content

Commit

Permalink
Fix list connectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Hassine committed Jun 28, 2019
1 parent c5df94c commit 80d2f6f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ OpenCTI not only allows [imports]((https://opencti-platform.github.io/docs/guide

## Documentation and demonstration

If you want to know more on OpenCTI, you can read the [documentation on the tool](https://opencti-platform.github.io/docs). If you wish to discover how the OpenCTI platform is working, a [demonstration instance](https://demo.opencti.io) is available and open to everyone. You can access to the demonstration with any Google, Facebook or Github account, or use the demonstration credentials:

- Login: demo@opencti.io
- Password: demo

This instance is reset every night and is based on reference data maintened by the OpenCTI developers.
If you want to know more on OpenCTI, you can read the [documentation on the tool](https://opencti-platform.github.io/docs). If you wish to discover how the OpenCTI platform is working, a [demonstration instance](https://demo.opencti.io) is available and open to everyone. This instance is reset every night and is based on reference data maintened by the OpenCTI developers.

## Releases download

Expand Down
1 change: 0 additions & 1 deletion opencti-front/src/utils/Localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ const i18n = {
'Settings have been updated': 'Les paramètres ont été mis à jour',
'Export the entity': "Exporter l'entité",
'Display demo credentials': 'Afficher les identifiants de démo',
'Login: demo@opencti.io / Password: demo': 'Identifiant : demo@opencti.io / Mot de passe : demo',
// Menu
Dashboard: 'Tableau de bord',
Visualization: 'Visualisation',
Expand Down
34 changes: 19 additions & 15 deletions opencti-graphql/src/domain/connector.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { readdirSync, readFileSync, lstatSync } from 'fs';
import { join, basename } from 'path';
import uuid from 'uuid/v4';
import { isNil } from 'ramda';
import { isNil, filter } from 'ramda';
import {
commitWriteTx,
queryOne,
Expand All @@ -18,20 +18,24 @@ export const getConnectors = async () => {
.map(name => join(source, name))
.filter(isDirectory)
.map(connector => basename(connector));
return getDirectories(path).map(async connector => {
const connectorConfigTemplate = readFileSync(
`${path}/${connector}/config.json`
);
const connectorObject = await queryOne(
`match $x isa Connector; $x has connector_identifier "${connector}"; get $x;`,
['x']
);
return {
identifier: connector,
config_template: Buffer.from(connectorConfigTemplate).toString('base64'),
config: connectorObject ? connectorObject.x.connector_config : null
};
});
return filter(n => n !== '.github', getDirectories(path)).map(
async connector => {
const connectorConfigTemplate = readFileSync(
`${path}/${connector}/config.json`
);
const connectorObject = await queryOne(
`match $x isa Connector; $x has connector_identifier "${connector}"; get $x;`,
['x']
);
return {
identifier: connector,
config_template: Buffer.from(connectorConfigTemplate).toString(
'base64'
),
config: connectorObject ? connectorObject.x.connector_config : null
};
}
);
};

export const updateConfig = async (identifier, config) => {
Expand Down

0 comments on commit 80d2f6f

Please sign in to comment.