2.0.0 • Published 7 months ago

@labdigital/federated-token-apollo v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Federated Token - Apollo Plugin

npm

This package provides support for both Apollo Server (including Gateway). It processes the token and forwards it to downstream services and also reads new/updated tokens from downstream services.

It provides three Apollo specific classes:

  • GatewayAuthPlugin - An Apollo plugin for the GraphQL gateway that verifies the signature of the token passed and decrypts the embedded JWE property. It stores the verified and decrypted token on the context as federatedToken.

  • FederatedGraphQLDataSource - An Apollo GraphQL data source used in the GraphQL Gateway which passes the federatedToken from the context to the datasource (federated service) as x-access-token HTTP header.

  • FederatedAuthPlugin - An Apollo plugin for federated services that reads the token passed in the x-access-token header and stores it on the context as federatedToken.

When a federated services creates a new token (when non exist) it can also return a refresh token in the x-refresh-token header. The gateway will then encrypt all refresh tokens and encrypt them before passing them to the client as x-refresh-token header.

1.0.2

1 year ago

1.0.0

1 year ago

1.6.0-beta.1

9 months ago

1.6.0-beta.2

9 months ago

1.7.0

8 months ago

1.6.1

8 months ago

1.6.0-beta.3

9 months ago

1.4.3

11 months ago

1.6.0

9 months ago

1.4.2

11 months ago

1.4.1

11 months ago

1.0.4

1 year ago

2.0.0-beta.2

7 months ago

2.0.0-beta.1

7 months ago

2.0.0-beta.0

7 months ago

2.0.0

7 months ago

1.0.0-beta.1

1 year ago

1.0.0-beta.0

1 year ago

0.13.2

2 years ago

0.13.1

2 years ago

0.13.0

2 years ago