# SmeeFeds

`SmeeFeds` is a small federation management extension to [Smee]( for use in
research, testing and development.

[Smee]( has tools for handling the sources of SAML metadata but 
nothing to represent the publishers of metadata. SmeeFeds adds a few tools for handling federations and includes a large
collection of information about research and education federations.

[![Hex pm](](
[![API Docs](](
![Github Elixir CI](

## Features

* Easily find information on National Research and Education organisation (NREN) federations.
* Filter and group federations by location or EU membership
* Use federation records directly with Smee to download metadata from aggregates or MDQ servers
* Export lists of federation information as CSV, JSON or Markdown documents

The top level `SmeeFeds` module has tools for selecting individual federation details or lists of many at once.
SmeeFeds contain more tools for handling federations, such as:

* `SmeeFeds.Federation` - tools for accessing data such as metadata download URLs, contacts, homepages, and so on.
* `SmeeFeds.Export` - convert lists of federations into data for export, or simple text reports
* `SmeeFeds.Filter` - filter lists of federations by various criteria


SmeeFeds comes with a built-in list of federations, using information gathered from various sources on the Internet.

This collection of information is for use by **researchers, developers and testers**. 


Metadata is the bedrock of trust and information security in SAML federations. DO NOT use metadata URLs, certificates 
and certificate fingerprints to download and use metadata in live services without confirming each detail yourself.

If you must use SmeeFeds as part of a production service, then after information has been verified you can export only
the verified information you need as a JSON file and set it as the new default using 
`:smee_feds, :data_file` config setting in your application.

There is absolutely no guarantee or warranty that the data in SmeeFeds is correct, and it is not supported by any of 
the federations listed. It's totally unofficial. 

## Examples

### Listing all known federations, then selecting those in the EU, and listing their unique IDs
Each federation record has an ID for convenience

|> SmeeFeds.ids()

### Using with Smee to download UK Access Management Federation metadata, pick a random entity and get its XML
Useful for testing

random_xml = SmeeFeds.get(:ukamf)
|> SmeeFeds.Federation.aggregate()
|> Smee.fetch!()
|> Smee.Metadata.random_entity()
|> Smee.Entity.xml()

### Finding an MDQ service 
Very few MDQ services are present in the data, but they can be used as follows:

cern_idp = SmeeFeds.get(:incommon)
|> SmeeFeds.Federation.mdq()
|> MDQ.lookup!("")

### Getting a list of specific federations and writing their details to disk as a JSON file or CSV
The JSON file can be used a new default set of federations. The CSV is a simpler, lossy summary.

json = SmeeFeds.federations([:wayf, :haka, :dfnaai, :swamid])
|> SmeeFeds.Export.json()
File.write!("feds.json", json)

csv = SmeeFeds.federations([:wayf, :haka, :dfnaai, :swamid])
       |> SmeeFeds.Export.csv()
File.write!("feds.csv", csv)

## Installation

If [available in Hex](, the package can be installed
by adding `smee_feds` to your list of dependencies in `mix.exs`:

def deps do
    {:smee_feds, "~> 0.1.0"}

SmeeFeds requires [Smee](, which has its own unusual requirements, so
please make sure you read the documentation for installing Smee before using SmeeFeds.

## Uses

The main reason SmeeFeds was hurriedly put together on a Sunday afternoon is that I needed to test Smee with a variety
of federations, and my various scattered notes and comments and tests with URLs and certificate fingerprints were becoming a nuisance.

It's possibly an over-engineered solution to that problem but it was fun.

## Alternatives and Sources

The best source of this information is the websites of the federations themselves, and the best way to find those
websites is to read the websites of Edugain and REFEDS.

* [Edugain]( "eduGAIN comprises over 80 participant federations connecting more than 8,000 Identity and Service Providers" 
* [REFEDS]( "REFEDS is a community of practitioners actively engaged in access and identity work within their home countries and supportive of standards-compliant developments to enhance international collaboration"
* [MET]( "Metadata explorer tool is a fast way to find federations, entities, and their relations through entity/federation metadata file information."

## Documentation

Documentation can be generated with [ExDoc](
and published on [HexDocs]( Once published, the docs can
be found at <>.

## Contributing

You can request new features by creating an [issue](,
or submit a [pull request]( with your contribution.

If you are comfortable working with Python but Smee's Elixir code is unfamiliar then this blog post may help: 
[Elixir For Humans Who Know Python](

## Copyright and License

Copyright (c) 2023 Digital Identity Ltd, UK

SmeeFeds is Apache 2.0 licensed.

## Disclaimer
Smee is not endorsed by The Shibboleth Foundation or any of the NREN's described within.
The API will definitely change considerably in the first few releases after 0.1.0 - it is not stable!