Skip to content

Commit

Permalink
Setup project.
Browse files Browse the repository at this point in the history
  • Loading branch information
IanLuites committed May 10, 2017
1 parent 1704955 commit a5d8eea
Show file tree
Hide file tree
Showing 9 changed files with 203 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
/deps
erl_crash.dump
*.ez
/docs
/doc

16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
sudo: false
language: elixir
elixir:
- 1.4.2
otp_release:
- 19.3
install:
- mix local.rebar --force # for Elixir 1.3.0 and up
- mix local.hex --force
- mix deps.get
after_script:
- MIX_ENV=test mix do deps.get, compile, inch.report, coveralls.travis
cache:
directories:
- _build
- deps
81 changes: 81 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Überauth Steam

[![Hex.pm](https://img.shields.io/hexpm/v/ueberauth_steam.svg "Hex")](https://hex.pm/packages/ueberauth_steam)
[![Build Status](https://travis-ci.org/shinyscorpion/ueberauth_steam.svg?branch=master)](https://travis-ci.org/shinyscorpion/ueberauth_steam)
[![Coverage Status](https://coveralls.io/repos/github/shinyscorpion/ueberauth_steam/badge.svg?branch=master)](https://coveralls.io/github/shinyscorpion/ueberauth_steam?branch=master)
[![Inline docs](http://inch-ci.org/github/shinyscorpion/ueberauth_steam.svg?branch=master)](http://inch-ci.org/github/shinyscorpion/ueberauth_steam)
[![Deps Status](https://beta.hexfaktor.org/badge/all/github/shinyscorpion/ueberauth_steam.svg)](https://beta.hexfaktor.org/github/shinyscorpion/ueberauth_steam)
[![Hex.pm](https://img.shields.io/hexpm/l/ueberauth_steam.svg "License")](LICENSE)

> Steam OpenID strategy for Überauth.
## Installation

1. Obtain an Steam Web API Key at [Steam Dev](https://steamcommunity.com/login/home/?goto=%2Fdev%2Fapikey).

1. Add `:ueberauth_steam` to your list of dependencies in `mix.exs`:

```elixir
def deps do
[{:ueberauth_steam, "~> 0.1"}]
end
```

1. Add the strategy to your applications:

```elixir
def application do
[applications: [:ueberauth_steam]]
end
```

1. Add Steam to your Überauth configuration:

```elixir
config :ueberauth, Ueberauth,
providers: [
steam: {Ueberauth.Strategy.Steam, []}
]
```

1. Update your provider configuration:

```elixir
config :ueberauth, Ueberauth.Strategy.Steam,
api_key: System.get_env("STEAM_API_KEY")
```

1. Include the Überauth plug in your controller:

```elixir
defmodule MyApp.AuthController do
use MyApp.Web, :controller
plug Ueberauth
...
end
```

1. Create the request and callback routes if you haven't already:
```elixir
scope "/auth", MyApp do
pipe_through :browser
get "/:provider", AuthController, :request
get "/:provider/callback", AuthController, :callback
end
```
1. Your controller needs to implement callbacks to deal with `Ueberauth.Auth` and `Ueberauth.Failure` responses.
For an example implementation see the [Überauth Example](https://github.com/ueberauth/ueberauth_example) application.
## Calling
Depending on the configured URL you can initialize the request through:
/auth/steam
## License
Please see [LICENSE](LICENSE) for licensing details.
1 change: 1 addition & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use Mix.Config
7 changes: 7 additions & 0 deletions coveralls.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"skip_files": [
],
"coverage_options": {
"minimum_coverage": 100
}
}
5 changes: 5 additions & 0 deletions lib/ueberauth_steam.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
defmodule UeberauthSteam do
@moduledoc ~S"""
Steam OpenID for Überauth.
"""
end
67 changes: 67 additions & 0 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
defmodule UeberauthSteam.Mixfile do
use Mix.Project

def project do
[
app: :ueberauth_steam,
description: "Steam OpenID Strategy for Überauth.",
version: "0.1.0",
elixir: "~> 1.4",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
deps: deps(),
package: package(),

# Testing
test_coverage: [tool: ExCoveralls],
preferred_cli_env: ["coveralls": :test, "coveralls.detail": :test, "coveralls.post": :test, "coveralls.html": :test],
dialyzer: [ignore_warnings: "dialyzer.ignore-warnings"],

# Docs
name: "Überauth Steam",
source_url: "https://github.com/shinyscorpion/ueberauth_steam",
homepage_url: "https://github.com/shinyscorpion/ueberauth_steam",
docs: [
main: "readme",
extras: ["README.md"],
],
]
end

def package do
[
name: :ueberauth_steam,
maintainers: ["Ian Luites"],
licenses: ["MIT"],
files: [
"lib/ueberauth", "lib/ueberauth_steam.ex", "mix.exs", "README*", "LICENSE*", # Elixir
],
links: %{
"GitHub" => "https://github.com/shinyscorpion/ueberauth_steam",
},
]
end

def application do
[extra_applications: [:logger]]
end

defp deps do
[
# Dependencies
{:httpoison, "~> 0.11"},
{:poison, "~> 3.1"},
{:ueberauth, "~> 0.4"},

# Testing
{:meck, "~> 0.8.4", only: :test},

# Code Maintenance
{:credo, "~> 0.7", only: [:dev, :test]},
{:dialyxir, "~> 0.5", only: [:dev], runtime: false},
{:ex_doc, "~> 0.15", only: :dev},
{:excoveralls, "~> 0.6", only: :test},
{:inch_ex, "~> 0.5", only: [:dev, :test]},
]
end
end
22 changes: 22 additions & 0 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
%{"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], []},
"certifi": {:hex, :certifi, "1.1.0", "c9b71a547016c2528a590ccfc28de786c7edb74aafa17446b84f54e04efc00ee", [:rebar3], []},
"credo": {:hex, :credo, "0.7.4", "0c33bcce4d574ce6df163cbc7d1ecb22de65713184355bd3be81cc4ab0ecaafa", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, optional: false]}]},
"dialyxir": {:hex, :dialyxir, "0.5.0", "5bc543f9c28ecd51b99cc1a685a3c2a1a93216990347f259406a910cf048d1d7", [:mix], []},
"earmark": {:hex, :earmark, "1.2.1", "7ad3f203ab84d31832814483c834e006cf88949f061a4b50d7e783147572280f", [:mix], []},
"ex_doc": {:hex, :ex_doc, "0.15.1", "d5f9d588fd802152516fccfdb96d6073753f77314fcfee892b15b6724ca0d596", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, optional: false]}]},
"excoveralls": {:hex, :excoveralls, "0.6.3", "894bf9254890a4aac1d1165da08145a72700ff42d8cb6ce8195a584cb2a4b374", [:mix], [{:exjsx, "~> 3.0", [hex: :exjsx, optional: false]}, {:hackney, ">= 0.12.0", [hex: :hackney, optional: false]}]},
"exjsx": {:hex, :exjsx, "3.2.1", "1bc5bf1e4fd249104178f0885030bcd75a4526f4d2a1e976f4b428d347614f0f", [:mix], [{:jsx, "~> 2.8.0", [hex: :jsx, optional: false]}]},
"hackney": {:hex, :hackney, "1.8.0", "8388a22f4e7eb04d171f2cf0285b217410f266d6c13a4c397a6c22ab823a486c", [:rebar3], [{:certifi, "1.1.0", [hex: :certifi, optional: false]}, {:idna, "4.0.0", [hex: :idna, optional: false]}, {:metrics, "1.0.1", [hex: :metrics, optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, optional: false]}, {:ssl_verify_fun, "1.1.1", [hex: :ssl_verify_fun, optional: false]}]},
"httpoison": {:hex, :httpoison, "0.11.2", "9e59f17a473ef6948f63c51db07320477bad8ba88cf1df60a3eee01150306665", [:mix], [{:hackney, "~> 1.8.0", [hex: :hackney, optional: false]}]},
"idna": {:hex, :idna, "4.0.0", "10aaa9f79d0b12cf0def53038547855b91144f1bfcc0ec73494f38bb7b9c4961", [:rebar3], []},
"inch_ex": {:hex, :inch_ex, "0.5.6", "418357418a553baa6d04eccd1b44171936817db61f4c0840112b420b8e378e67", [:mix], [{:poison, "~> 1.5 or ~> 2.0 or ~> 3.0", [hex: :poison, optional: false]}]},
"jsx": {:hex, :jsx, "2.8.2", "7acc7d785b5abe8a6e9adbde926a24e481f29956dd8b4df49e3e4e7bcc92a018", [:mix, :rebar3], []},
"meck": {:hex, :meck, "0.8.4", "59ca1cd971372aa223138efcf9b29475bde299e1953046a0c727184790ab1520", [:make, :rebar], []},
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], []},
"mime": {:hex, :mime, "1.1.0", "01c1d6f4083d8aa5c7b8c246ade95139620ef8effb009edde934e0ec3b28090a", [:mix], []},
"mimerl": {:hex, :mimerl, "1.0.2", "993f9b0e084083405ed8252b99460c4f0563e41729ab42d9074fd5e52439be88", [:rebar3], []},
"oauth2": {:hex, :oauth2, "0.9.1", "cac86d87f35ec835bfe4c791263bdb88c0d8bf1617d64f555ede4e9d913e35ef", [:mix], [{:hackney, "~> 1.7", [hex: :hackney, optional: false]}]},
"plug": {:hex, :plug, "1.3.5", "7503bfcd7091df2a9761ef8cecea666d1f2cc454cbbaf0afa0b6e259203b7031", [:mix], [{:cowboy, "~> 1.0.1 or ~> 1.1", [hex: :cowboy, optional: true]}, {:mime, "~> 1.0", [hex: :mime, optional: false]}]},
"poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], []},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.1", "28a4d65b7f59893bc2c7de786dec1e1555bd742d336043fe644ae956c3497fbe", [:make, :rebar], []},
"ueberauth": {:hex, :ueberauth, "0.4.0", "bc72d5e5a7bdcbfcf28a756e34630816edabc926303bdce7e171f7ac7ffa4f91", [:mix], [{:plug, "~> 1.2", [hex: :plug, optional: false]}]}}
1 change: 1 addition & 0 deletions test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ExUnit.start()

0 comments on commit a5d8eea

Please sign in to comment.