Skip to content

Commit

Permalink
Small fixes (#13)
Browse files Browse the repository at this point in the history
* fix linting

* add docker compose dev
  • Loading branch information
gunzip committed Feb 18, 2020
1 parent 534c2d0 commit c34beb0
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 31 deletions.
7 changes: 0 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM circleci/node:10.14.2 as builder

RUN sudo apt-get -y install --no-install-recommends libunwind8=1.1-4.1

WORKDIR /usr/src/app

COPY /src /usr/src/app/src
Expand All @@ -16,11 +14,6 @@ RUN sudo chmod -R 777 /usr/src/app \
FROM node:10.14.2-alpine
LABEL maintainer="https://pagopa.gov.it"

# Install major CA certificates to cover
# https://github.com/SparebankenVest/azure-key-vault-to-kubernetes integration
RUN apk update && \
apk add ca-certificates

WORKDIR /usr/src/app

COPY /package.json /usr/src/app/package.json
Expand Down
10 changes: 0 additions & 10 deletions TODO.md

This file was deleted.

8 changes: 8 additions & 0 deletions docker-compose.override.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: "2.2"

services:
io-spid-commons:
image: node:10.14.2-alpine
working_dir: /usr/src/app
volumes:
- ".:/usr/src/app"
4 changes: 2 additions & 2 deletions src/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ const appConfig: IApplicationConfig = {
const serviceProviderConfig: IServiceProviderConfig = {
IDPMetadataUrl:
"https://registry.spid.gov.it/metadata/idp/spid-entities-idps.xml",
spidValidatorUrl: "http://localhost:8080",
idpMetadataRefreshIntervalMillis: 120000,
organization: {
URL: "https://example.com",
Expand All @@ -67,7 +66,8 @@ const serviceProviderConfig: IServiceProviderConfig = {
attributes: ["email", "name", "familyName", "fiscalNumber", "mobilePhone"],
name: "Required attrs"
},
spidTestEnvUrl: "https://spid-testenv2:8088"
spidTestEnvUrl: "https://spid-testenv2:8088",
spidValidatorUrl: "http://localhost:8080"
};

const redisClient = redis.createClient({
Expand Down
4 changes: 2 additions & 2 deletions src/strategy/redis_cache_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ export const overrideCacheProvider = (): CacheProvider => {
return {
// saves the key with the optional value
// invokes the callback with the value saved
save(key, value, callback): void {
save(_, value, callback): void {
const v = {
createdAt: new Date(),
value
};
callback(null, v);
},
// invokes 'callback' and passes the value if found, null otherwise
get(key, callback): void {
get(_, callback): void {
callback(null, {});
},
// removes the key from the cache, invokes `callback` with the
Expand Down
2 changes: 1 addition & 1 deletion src/utils/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export interface IServiceProviderConfig {
name: string;
};
publicCert: string;
spidValidatorUrl: string | undefined;
idpMetadataRefreshIntervalMillis: number;
spidValidatorUrl?: string;
}

export interface ISpidStrategyOptions {
Expand Down
10 changes: 1 addition & 9 deletions src/utils/saml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,7 @@
import { distanceInWordsToNow, isAfter, subDays } from "date-fns";
import { Request as ExpressRequest } from "express";
import { difference, flatten } from "fp-ts/lib/Array";
import {
Either,
fromOption,
fromPredicate,
isLeft,
left,
right,
toError
} from "fp-ts/lib/Either";
import { Either, fromOption, fromPredicate, toError } from "fp-ts/lib/Either";
import { not } from "fp-ts/lib/function";
import {
fromEither,
Expand Down

0 comments on commit c34beb0

Please sign in to comment.