1- From d4a41bc0ebbb015e97e076e6040a3349ee0dab33 Mon Sep 17 00:00:00 2001
1+ From 8b5a296990a67b35b5fcd9047d79418e31b37f60 Mon Sep 17 00:00:00 2001
22From: Brecht Van Lommel <
[email protected] >
33Date: Fri, 10 May 2024 13:28:51 +0200
4- Subject: [PATCH] BLENDER: Blender ID goth provider
4+ Subject: [PATCH 01/14 ] BLENDER: Blender ID goth provider
55
66Provider authored by Matti Ranta and Arnd Marijnissen.
77---
88 go.mod | 1 +
9- go.sum | 2 +
9+ go.sum | 3 +
1010 public/assets/img/blenderid.png | 0
1111 .../auth/source/oauth2/blenderid/blenderid.go | 181 ++++++++++++++++++
1212 .../source/oauth2/blenderid/blenderid_test.go | 70 +++++++
@@ -15,7 +15,7 @@ Provider authored by Matti Ranta and Arnd Marijnissen.
1515 .../auth/source/oauth2/blenderid/session.go | 66 +++++++
1616 .../source/oauth2/blenderid/session_test.go | 51 +++++
1717 .../auth/source/oauth2/providers_custom.go | 11 ++
18- 10 files changed, 490 insertions(+)
18+ 10 files changed, 491 insertions(+)
1919 create mode 100644 public/assets/img/blenderid.png
2020 create mode 100644 services/auth/source/oauth2/blenderid/blenderid.go
2121 create mode 100644 services/auth/source/oauth2/blenderid/blenderid_test.go
@@ -25,36 +25,37 @@ Provider authored by Matti Ranta and Arnd Marijnissen.
2525 create mode 100644 services/auth/source/oauth2/blenderid/session_test.go
2626
2727diff --git a/go.mod b/go.mod
28- index 8752e6d196a8b..0bfd9342c7fe8 100644
28+ index d8e7e37152..af00e05199 100644
2929--- a/go.mod
3030+++ b/go.mod
31- @@ -235 ,6 +235 ,7 @@ require (
32- github.com/mitchellh/reflectwalk v1.0.2 // indirect
31+ @@ -258 ,6 +258 ,7 @@ require (
32+ github.com/mmcloughlin/avo v0.6.0 // indirect
3333 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
3434 github.com/modern-go/reflect2 v1.0.2 // indirect
3535+ github.com/mozillazg/go-unidecode v0.2.0 // indirect
3636 github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450 // indirect
3737 github.com/mschoch/smat v0.2.0 // indirect
38- github.com/nwaples/rardecode v1.1.3 // indirect
38+ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
3939diff --git a/go.sum b/go.sum
40- index 6a3e6dc7f645c..d59c282ce0411 100644
40+ index 968001e7f9..bce9ba2fd7 100644
4141--- a/go.sum
4242+++ b/go.sum
43- @@ -586,6 +586,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ
43+ @@ -590,6 +590,9 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w
44+ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
4445 github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
4546 github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
46- github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
47+ + github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
4748+ github.com/mozillazg/go-unidecode v0.2.0 h1:vFGEzAH9KSwyWmXCOblazEWDh7fOkpmy/Z4ArmamSUc=
4849+ github.com/mozillazg/go-unidecode v0.2.0/go.mod h1:zB48+/Z5toiRolOZy9ksLryJ976VIwmDmpQ2quyt1aA=
4950 github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450 h1:j2kD3MT1z4PXCiUllUJF9mWUESr9TWKS7iEKsQ/IipM=
5051 github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450/go.mod h1:skjdDftzkFALcuGzYSklqYd8gvat6F1gZJ4YPVbkZpM=
5152 github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg=
5253diff --git a/public/assets/img/blenderid.png b/public/assets/img/blenderid.png
5354new file mode 100644
54- index 0000000000000..e69de29bb2d1d
55+ index 0000000000..e69de29bb2
5556diff --git a/services/auth/source/oauth2/blenderid/blenderid.go b/services/auth/source/oauth2/blenderid/blenderid.go
5657new file mode 100644
57- index 0000000000000..671e5e4f541a5
58+ index 0000000000..671e5e4f54
5859--- /dev/null
5960+++ b/services/auth/source/oauth2/blenderid/blenderid.go
6061@@ -0,0 +1,181 @@
@@ -241,7 +242,7 @@ index 0000000000000..671e5e4f541a5
241242+ }
242243diff --git a/services/auth/source/oauth2/blenderid/blenderid_test.go b/services/auth/source/oauth2/blenderid/blenderid_test.go
243244new file mode 100644
244- index 0000000000000..2bf4c443d86ff
245+ index 0000000000..2bf4c443d8
245246--- /dev/null
246247+++ b/services/auth/source/oauth2/blenderid/blenderid_test.go
247248@@ -0,0 +1,70 @@
@@ -317,7 +318,7 @@ index 0000000000000..2bf4c443d86ff
317318+ }
318319diff --git a/services/auth/source/oauth2/blenderid/gitealize_usernames.go b/services/auth/source/oauth2/blenderid/gitealize_usernames.go
319320new file mode 100644
320- index 0000000000000..880516c8e28f1
321+ index 0000000000..880516c8e2
321322--- /dev/null
322323+++ b/services/auth/source/oauth2/blenderid/gitealize_usernames.go
323324@@ -0,0 +1,65 @@
@@ -388,7 +389,7 @@ index 0000000000000..880516c8e28f1
388389+ }
389390diff --git a/services/auth/source/oauth2/blenderid/gitealize_usernames_test.go b/services/auth/source/oauth2/blenderid/gitealize_usernames_test.go
390391new file mode 100644
391- index 0000000000000..7d633198e8886
392+ index 0000000000..7d633198e8
392393--- /dev/null
393394+++ b/services/auth/source/oauth2/blenderid/gitealize_usernames_test.go
394395@@ -0,0 +1,43 @@
@@ -437,7 +438,7 @@ index 0000000000000..7d633198e8886
437438+ }
438439diff --git a/services/auth/source/oauth2/blenderid/session.go b/services/auth/source/oauth2/blenderid/session.go
439440new file mode 100644
440- index 0000000000000..52a2d2174584c
441+ index 0000000000..52a2d21745
441442--- /dev/null
442443+++ b/services/auth/source/oauth2/blenderid/session.go
443444@@ -0,0 +1,66 @@
@@ -509,7 +510,7 @@ index 0000000000000..52a2d2174584c
509510+ }
510511diff --git a/services/auth/source/oauth2/blenderid/session_test.go b/services/auth/source/oauth2/blenderid/session_test.go
511512new file mode 100644
512- index 0000000000000..ab7fb974a5772
513+ index 0000000000..ab7fb974a5
513514--- /dev/null
514515+++ b/services/auth/source/oauth2/blenderid/session_test.go
515516@@ -0,0 +1,51 @@
@@ -565,15 +566,15 @@ index 0000000000000..ab7fb974a5772
565566+ a.Equal(s.String(), s.Marshal())
566567+ }
567568diff --git a/services/auth/source/oauth2/providers_custom.go b/services/auth/source/oauth2/providers_custom.go
568- index 65cf538ad7386..f6f49ada048aa 100644
569+ index 65cf538ad7..f6f49ada04 100644
569570--- a/services/auth/source/oauth2/providers_custom.go
570571+++ b/services/auth/source/oauth2/providers_custom.go
571572@@ -5,6 +5,7 @@ package oauth2
572-
573+
573574 import (
574575 "code.gitea.io/gitea/modules/setting"
575576+ "code.gitea.io/gitea/services/auth/source/oauth2/blenderid"
576-
577+
577578 "github.com/markbates/goth"
578579 "github.com/markbates/goth/providers/azureadv2"
579580@@ -120,4 +121,14 @@ func init() {
@@ -591,3 +592,6 @@ index 65cf538ad7386..f6f49ada048aa 100644
591592+ return blenderid.NewCustomisedURL(clientID, secret, callbackURL, custom.AuthURL, custom.TokenURL, custom.ProfileURL, scopes...), nil
592593+ }))
593594 }
595+ - -
596+ 2.45.2
597+
0 commit comments