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

chore: update configuration and logic to match latest server version #6

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ jobs:
command: |
cp node_modules/stelace-server/docker-*.yml .
cp node_modules/stelace-server/Dockerfile* .
- run:
name: Copy SSL certificates
command: |
mkdir -p test/ssl
cp node_modules/stelace-server/test/ssl/* test/ssl
- run:
name: Pull ElasticSearch docker image
command: |
Expand Down
32 changes: 28 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Env variables are needed to run tests with API server running
# This file was copied from stelace-server repo (Jan. 2020)
# This file was copied from stelace-server repo (Sept. 2020)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove the date of the last version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, I just copied the new .env.example and forgot to keep those lines. I'll fix that.

# development, test or production
NODE_ENV=development
Expand Down Expand Up @@ -53,7 +53,22 @@ POSTGRES_PORT=6543
POSTGRES_DB=stelace-core
POSTGRES_USER=user
POSTGRES_PASSWORD=password
POSTGRES_ADMIN_USER=postgres
POSTGRES_ADMIN_USER=user

# SSL options (not needed for local development, you may uncomment it for production when SSL is needed)
# If any of the following values isn’t empty, SSL connection with database will be established.
# POSTGRES_SSL=

# For following values, multiline is expected.
# Please pay attention to newlines, we recommend to replace newlines by newline character (\n for Unix),
# set the value in one line and put it between double quotes (e.g. "line1\nline2")

# SSL certificate (common extensions: .crt, .cert, .cer)
# POSTGRES_SSL_CERT=
# Private key (common extension: .key)
# POSTGRES_SSL_KEY=
# Certificate authority (common extensions: .pem, .der)
# POSTGRES_SSL_CA=

# Set host to 'elasticsearch' when using dockerized API
ELASTIC_SEARCH_HOST=127.0.0.1
Expand All @@ -62,12 +77,21 @@ ELASTIC_SEARCH_HOST=127.0.0.1
ELASTIC_SEARCH_PROTOCOL=http
ELASTIC_SEARCH_PORT=9200
ELASTIC_SEARCH_USER=elastic
ELASTIC_SEARCH_PASSWORD=changeme
ELASTIC_SEARCH_PASSWORD=elastic_password

# Load database settings from redis to support multiple databases
REMOTE_STORE=true


############
## EMAILS ##
############

# Comma-separated list of email adresses to send emails to,
# instead of real recipients, for debugging purposes.
DEBUG_EMAILS=


##########
## COTE ##
##########
Expand Down Expand Up @@ -102,5 +126,5 @@ INSTANCE_ID=

# AWS SSM
SECURE_ENV=false
# Can set multiple services (separate them by commas)
# Can set multiple services (comma-separated)
SECURE_ENV_SERVICE=
6 changes: 6 additions & 0 deletions services/stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,14 @@ module.exports = function createService (deps) {
page: 1
}

const headers = {
'x-stelace-version': '2019-05-20',
}

const { results: sameEvents } = await stelaceApiRequest('/events', {
platformId,
env,
headers,
payload: {
objectId: event.id,
nbResultsPerPage: 1,
Expand All @@ -114,6 +119,7 @@ module.exports = function createService (deps) {
await stelaceApiRequest('/events', {
platformId,
env,
headers,
method: 'POST',
payload: {
// https://stripe.com/docs/api/events/types
Expand Down
Loading