Packages

Set of plugs implementing FDSN web services specification

Current section

Files

Jump to
fdsn_plugs README.md
Raw

README.md

# FdsnPlugs
[![coverage report](https://gricad-gitlab.univ-grenoble-alpes.fr/OSUG/RESIF/fdsn_plugs/badges/main/coverage.svg)](https://gricad-gitlab.univ-grenoble-alpes.fr/OSUG/RESIF/fdsn_plugs/-/commits/main)
[![hex.pm](https://img.shields.io/hexpm/v/fdsn_plugs.svg)](https://hex.pm/packages/fdsn_plugs)
[![hexdocs.pm](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/fdsn_plugs/)
Collection of plugs related to FDSN webservices.
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `fdsn_plugs` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:fdsn_plugs, "~> 0.8.0"}
]
end
```
## Usage
This module provides two supersets of plugs : FdsnDataselectPlugs and FdsnAvailabilityPlugs useful to implement respectively dataselect and availability webservices.
### Phoenix
Add the plug collection of your services in your plugs pipeline:
``` elixir
pipeline :fdsn do
plug :accepts, ["json", "text", "mseed"]
plug FdsnDataselectPlugs
end
```
### EIDA Json token support
To enable EIDA token support in your application, you need to launch the JWKS retrieval.
For Phoenix applications, add in your `application.ex`:
``` elixir
children = [
{FdsnPlugs.EidaJwkStrategy, time_interval: 600_000, jwks_url: "https://geofon.gfz.de/eas2/jwk", first_fetch_sync: true}
]
```
The `first_fetch_sync` has to be set to `true`.