Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DLVR-6993] merge upstream #2

Open
wants to merge 68 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
18c4e2f
loosen dependency
kelostrada Oct 2, 2017
95a169d
Merge pull request #19 from geeksoftteam/master
sobolevn Oct 2, 2017
0a5f645
Add ability to set state (#20)
Virviil Nov 7, 2017
8593962
Version 0.2.3 release
sobolevn Nov 7, 2017
bd8386a
Version 0.2.3 release
sobolevn Nov 7, 2017
0d60af0
WIP: adds failing test, refs #21 (#22)
sobolevn Nov 19, 2017
653090b
Version 0.2.4
sobolevn Nov 19, 2017
15ae873
Bump excoveralls from 0.6.1 to 0.8.0 (#23)
dependabot[bot] Jan 17, 2018
f83c7ab
Bump ex_doc from 0.15.0 to 0.18.1 (#26)
dependabot[bot] Jan 17, 2018
362e0c9
Bump oauth2 from 0.8.3 to 0.9.2 (#29)
dependabot[bot] Jan 18, 2018
d3baaac
Bump excoveralls from 0.8.0 to 0.8.1 (#31)
dependabot[bot] Jan 29, 2018
7f78ddf
Bump ex_doc from 0.18.1 to 0.18.2 (#33)
dependabot[bot] Jan 30, 2018
1dab735
Bump ex_doc from 0.18.2 to 0.18.3 (#34)
dependabot[bot] Feb 16, 2018
54bed4f
Typo? (#36)
asiniy Feb 27, 2018
f1ad0d6
VK now requires version ("v") request field. (#37)
versilov Mar 2, 2018
24c86b8
Updates elixir version and deps versions
sobolevn Apr 10, 2018
5ba39eb
Sets elixir 1.4 as minimal version
sobolevn Apr 10, 2018
efb98f4
Fixes docs creation
sobolevn Apr 10, 2018
d4d70c1
Bump exvcr from 0.10.1 to 0.10.2 (#40)
dependabot[bot] Apr 16, 2018
6cbbe84
Bump credo from 0.9.1 to 0.9.2 (#41)
dependabot[bot] Apr 20, 2018
6ccecee
Bump excoveralls from 0.8.1 to 0.9.0 (#45)
dependabot[bot] Jun 11, 2018
09402b1
Bump ex_doc from 0.18.3 to 0.18.4 (#47)
dependabot[bot] Jul 16, 2018
ae838ba
Bump excoveralls from 0.9.0 to 0.9.1 (#46)
dependabot[bot] Jul 16, 2018
e097cb2
Bump ex_doc from 0.18.4 to 0.19.1 (#50)
dependabot[bot] Aug 6, 2018
7b14b95
Bump excoveralls from 0.9.1 to 0.9.2 (#51)
dependabot[bot] Aug 13, 2018
9984628
Bump oauth2 from 0.9.2 to 0.9.3 (#52)
dependabot[bot] Aug 14, 2018
4fc8c5c
Bump exvcr from 0.10.2 to 0.10.3 (#54)
dependabot[bot] Sep 25, 2018
8054846
Bump oauth2 from 0.9.3 to 0.9.4 (#56)
dependabot[bot] Oct 19, 2018
ff0c9f4
Bump excoveralls from 0.9.2 to 0.10.1 (#57)
dependabot[bot] Oct 23, 2018
ca189cc
Bump excoveralls from 0.10.1 to 0.10.2 (#58)
dependabot[bot] Oct 29, 2018
c3c3dd8
Bump excoveralls from 0.10.2 to 0.10.3 (#59)
dependabot[bot] Nov 19, 2018
ecf63c1
Bump ex_doc from 0.19.1 to 0.19.2 (#61)
dependabot[bot] Dec 24, 2018
6276933
Bump excoveralls from 0.10.3 to 0.10.4 (#62)
dependabot[bot] Jan 7, 2019
f891fc2
Bump ex_doc from 0.19.2 to 0.19.3 (#63)
dependabot[bot] Jan 22, 2019
9787c6f
Bump excoveralls from 0.10.4 to 0.10.5 (#65)
dependabot[bot] Feb 4, 2019
63817d9
Bump excoveralls from 0.10.5 to 0.10.6 (#67)
dependabot[bot] Mar 4, 2019
84f8d2e
Bump ueberauth from 0.5.0 to 0.6.1 (#71)
dependabot[bot] Mar 15, 2019
2675f8c
Bump ex_doc from 0.19.3 to 0.20.0 (#73)
dependabot[bot] Apr 3, 2019
1458452
Bump ex_doc from 0.20.0 to 0.20.1 (#74)
dependabot[bot] Apr 4, 2019
9c75e72
Bump ex_doc from 0.20.1 to 0.20.2 (#76)
dependabot[bot] Apr 16, 2019
cde3d2b
Bump excoveralls from 0.10.6 to 0.11.0 (#78)
dependabot[bot] May 3, 2019
61714e3
Bump excoveralls from 0.11.0 to 0.11.1 (#79)
dependabot[bot] May 13, 2019
1ce3538
Update OTP 20 release, remove OTP 18.3 (#87)
versilov Jul 23, 2019
7f8b55e
Quoted keyword "coveralls": generates warning.
versilov Jul 22, 2019
392feca
Merge pull request #85 from versilov/patch-1
Virviil Jul 23, 2019
ceae58e
Generates warning "conn is not used"
versilov Jul 22, 2019
ecd6596
Merge pull request #86 from versilov/patch-2
Virviil Jul 23, 2019
fa069ab
Bump excoveralls from 0.11.1 to 0.11.2 (#89)
dependabot-preview[bot] Aug 19, 2019
58b773e
Bump ex_doc from 0.20.2 to 0.21.1 (#84)
dependabot-preview[bot] Aug 19, 2019
9ad3e47
Bump ex_doc from 0.21.1 to 0.21.2 (#91)
dependabot-preview[bot] Aug 30, 2019
aea63d9
Bump exvcr from 0.10.3 to 0.10.4 (#93)
dependabot-preview[bot] Sep 9, 2019
42bd697
Bump ueberauth from 0.6.1 to 0.6.2 (#94)
dependabot-preview[bot] Sep 12, 2019
6c11532
Create FUNDING.yml
sobolevn Sep 12, 2019
5992634
Bump exvcr from 0.10.4 to 0.11.0 (#97)
dependabot-preview[bot] Oct 21, 2019
849307d
Bump excoveralls from 0.11.2 to 0.12.0 (#96)
dependabot-preview[bot] Oct 21, 2019
4eae878
Bump excoveralls from 0.12.0 to 0.12.1 (#98)
dependabot-preview[bot] Nov 25, 2019
55d60fb
Bump excoveralls from 0.12.1 to 0.12.2 (#99)
dependabot-preview[bot] Jan 22, 2020
e53bedb
Bump ex_doc from 0.21.2 to 0.21.3 (#102)
dependabot-preview[bot] Jan 31, 2020
9ccfc5c
Bump exvcr from 0.11.0 to 0.11.1 (#104)
dependabot-preview[bot] Feb 25, 2020
9b42f1b
Update API version param (#109)
ARtoriouSs Sep 15, 2020
e87b6e2
Version 0.4.0 release
sobolevn Oct 1, 2020
0b0713f
chore: add workflows
yordis Oct 17, 2021
398ff17
chore: add formatter file
yordis Oct 17, 2021
9cde395
chore: format code
yordis Oct 17, 2021
25d2343
chore: save mix lock
yordis Oct 17, 2021
503bafa
Merge remote-tracking branch 'upstream/master' into DLVR-6993-merge-u…
maxp36 Oct 13, 2023
5ac8ccf
[DLVR-6993] update deps
maxp36 Oct 13, 2023
7fb5bac
[DLVR-6993] fix csrf
maxp36 Oct 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 0 additions & 129 deletions .credo.exs

This file was deleted.

4 changes: 4 additions & 0 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Used by "mix format"
[
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
]
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Order is important. The last matching pattern takes the most precedence.
# Default owners for everything in the repo.
* @ueberauth/developers
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

patreon: sobolevn
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Continuous Integration

on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- 'master'
jobs:
Test:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v1

- name: Set up Elixir
uses: erlef/setup-elixir@v1
with:
elixir-version: '1.11'
otp-version: '22.3'

- name: Install Dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Run Tests
run: mix test

Linting:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v1

- name: Set up Elixir
uses: erlef/setup-elixir@v1
with:
elixir-version: '1.11'
otp-version: '22.3'

- name: Install Dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Run Formatter
run: mix format --check-formatted

- name: Run Credo
run: mix credo
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Hexpm Release

on:
release:
types: [published]

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Elixir
uses: erlef/setup-elixir@v1
with:
elixir-version: '1.11'
otp-version: '22.3'
- name: Restore dependencies cache
uses: actions/cache@v2
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Run Hex Publish
run: mix hex.publish --yes
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
erlang 23.2.3
elixir 1.11
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ language: elixir
sudo: false

elixir:
- 1.2
- 1.3
- 1.6
- 1.5
- 1.4

otp_release:
- 17.4
- 18.1
- 20.3
- 19.3

env: MIX_ENV=test

script:
- mix coveralls.travis && mix credo --strict
- mix credo --strict
- mix coveralls.travis

notifications:
email: false
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## v0.4.0

* Fixes VK API version

## v0.3.1

* Fixes docs generation

## v0.3.0

* Updates requirements versions
* Fixes failing tests

## v0.2.4

* Fixes `state` issue, see https://github.com/sobolevn/ueberauth_vk/issues/21

## v0.2.3

* Adds `state` parameter

## v0.2.2

* Fixed `ex_doc` version
Expand Down
39 changes: 34 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Requirements

We support `elixir` versions `1.2` and bellow.
We support `elixir` versions `1.4` and above.

## Installation

Expand All @@ -17,7 +17,7 @@ We support `elixir` versions `1.2` and bellow.
```elixir
def deps do
# installation via hex:
[{:ueberauth_vk, "~> 0.2"}]
[{:ueberauth_vk, "~> 0.3"}]
# if you want to use github:
# [{:ueberauth_vk, github: "sobolevn/ueberauth_vk"}]
end
Expand Down Expand Up @@ -73,11 +73,11 @@ We support `elixir` versions `1.2` and bellow.

For an example implementation see the [Überauth Example](https://github.com/ueberauth/ueberauth_example) application.

## Calling
## Customizing

Depending on the configured url you can initial the request through: `/auth/vk`
You can customize [multiple fields](https://vk.com/dev/auth_sites), such as `default_scope`, `default_display`, `default_state`, `profile_fields`, and `uid_field`.

Or with options: `/auth/vk?scope=friends,video,offline`
### Scope

By default the requested scope is `"public_profile"`. Scope can be configured either explicitly as a `scope` query value on the request path or in your configuration:

Expand All @@ -88,6 +88,8 @@ config :ueberauth, Ueberauth,
]
```

### Profile Fields

You can also provide custom fields for user profile:

```elixir
Expand All @@ -99,6 +101,33 @@ config :ueberauth, Ueberauth,

See [VK API Method Reference > User](https://vk.com/dev/users.get) for full list of fields.

### State

You can also set the custom field called [`state`](https://github.com/sobolevn/ueberauth_vk/pull/20). It is used to prevent "man in the middle" attacks.

```elixir
config :ueberauth, Ueberauth,
providers: [
vk: {Ueberauth.Strategy.VK, [default_state: "secret-state-value"]}
]
```

This state will be passed to you in the callback as `/auth/vk?state=<session_id>` and will be available in the success struct.

### UID Field

You can use alternate fields to identify users. For example, you can use `email`.

```elixir
config :ueberauth, Ueberauth,
providers: [
vk: {Ueberauth.Strategy.VK, [
default_scope: "email",
uid_field: :email
]}
]
```


## License

Expand Down
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ use Mix.Config
# import_config "#{Mix.env}.exs"
# import_config "#{Mix.env}.exs"

if Mix.env == :test, do: import_config "test.exs"
if Mix.env() == :test, do: import_config("test.exs")
7 changes: 6 additions & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@ use Mix.Config

config :ueberauth, Ueberauth,
providers: [
vk: { Ueberauth.Strategy.VK, [] },
vk: {Ueberauth.Strategy.VK, []}
]

config :ueberauth, Ueberauth.Strategy.VK.OAuth,
client_id: "appid",
client_secret: "secret",
redirect_uri: "/callback"

config :exvcr,
vcr_cassette_library_dir: "test/fixtures/vcr_cassettes"

config :plug, :validate_header_keys_during_test, true
Loading
Loading