chore: rename project
This commit is contained in:
parent
aa6c22348e
commit
30f83aaf82
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2021 yauthio
|
Copyright (c) 2021 authorizer
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
10
README.md
10
README.md
|
@ -1,13 +1,13 @@
|
||||||
# yauth
|
#authorizer
|
||||||
|
|
||||||
yauth (aka your-auth) is a complete open source authentication and authorization solution for your applications. Bring your database and have complete control over the authentication, authorization and user data. It is a microservice that can be deployed anywhere and connected any sql database.
|
authorizer (aka your-auth) is a complete open source authentication and authorization solution for your applications. Bring your database and have complete control over the authentication, authorization and user data. It is a microservice that can be deployed anywhere and connected any sql database.
|
||||||
|
|
||||||
This an [Auth0](https://auth0.com) opensource alternative.
|
This an [Auth0](https://auth0.com) opensource alternative.
|
||||||
|
|
||||||
Deploy YAuth Server with Postgres DB on Heroku and get a YAuth GraphQL endpoint in under 30 seconds
|
Deploy authorizer Server with Postgres DB on Heroku and get a authorizer GraphQL endpoint in under 30 seconds
|
||||||
|
|
||||||
[](https://heroku.com/deploy?template=https://github.com/yauthdev/yauth-heroku)
|
Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/authorizerdev/authorizer-heroku)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
### Flexible and easy to use
|
### Flexible and easy to use
|
||||||
|
@ -38,5 +38,5 @@ Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?
|
||||||
* Advanced options allow you to define your own routines to handle controlling what accounts are allowed to sign in, for encoding and decoding JSON Web Tokens and to set custom cookie security policies and session properties, so you can control who is able to sign in and how often sessions have to be re-validated.
|
* Advanced options allow you to define your own routines to handle controlling what accounts are allowed to sign in, for encoding and decoding JSON Web Tokens and to set custom cookie security policies and session properties, so you can control who is able to sign in and how often sessions have to be re-validated.
|
||||||
|
|
||||||
# License
|
# License
|
||||||
[MIT](https://github.com/yauthio/yauth/blob/main/LICENSE)
|
[MIT](https://github.com/authorizerdev/authorizer/blob/main/LICENSE)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Roadmap for yauth.io
|
# Roadmap for authorizer
|
||||||
|
|
||||||
This document contains detailed information about the project scope and future roadmap
|
This document contains detailed information about the project scope and future roadmap
|
||||||
|
|
||||||
|
@ -43,9 +43,9 @@ This document contains detailed information about the project scope and future r
|
||||||
- [ ] Allow user to view users
|
- [ ] Allow user to view users
|
||||||
- [ ] Allow user to define the JWT token field
|
- [ ] Allow user to define the JWT token field
|
||||||
- [x] A component library for react
|
- [x] A component library for react
|
||||||
- [x] Create YAuthProvider -> gives token, user, loading, setters
|
- [x] Create AuthorizerProvider -> gives token, user, loading, setters
|
||||||
- [x] Create YAuth component -> Complete Login/Signup & Forgot password solution
|
- [x] Create Authorizer component -> Complete Login/Signup & Forgot password solution
|
||||||
- [x] Create YAuthResetPassword component -> Component that can be used to verify forgot password token and reset the password
|
- [x] Create AuthorizerResetPassword component -> Component that can be used to verify forgot password token and reset the password
|
||||||
- [ ] Create a sdks
|
- [ ] Create a sdks
|
||||||
- [ ] NodeJS sdk which acts as a middleware and can be used to authenticate & authorize users
|
- [ ] NodeJS sdk which acts as a middleware and can be used to authenticate & authorize users
|
||||||
- [ ] Golang sdk which acts as a middleware and can be used to authenticate & authorize users
|
- [ ] Golang sdk which acts as a middleware and can be used to authenticate & authorize users
|
||||||
|
|
|
@ -10,8 +10,8 @@ services:
|
||||||
- POSTGRES_PASSWORD=postgres
|
- POSTGRES_PASSWORD=postgres
|
||||||
ports:
|
ports:
|
||||||
- 5432:5432
|
- 5432:5432
|
||||||
yauth:
|
authorizer:
|
||||||
image: lakhansamani/yauth:0.1.0-beta.0
|
image: lakhansamani/authorizer:0.1.0-beta.0
|
||||||
ports:
|
ports:
|
||||||
- 8080:8080
|
- 8080:8080
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|
|
@ -6,12 +6,12 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/authorizerdev/authorizer/server/enum"
|
||||||
"github.com/joho/godotenv"
|
"github.com/joho/godotenv"
|
||||||
"github.com/yauthdev/yauth/server/enum"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
YAUTH_ADMIN_SECRET = ""
|
ROOT_SECRET = ""
|
||||||
ENV = ""
|
ENV = ""
|
||||||
DB_TYPE = ""
|
DB_TYPE = ""
|
||||||
DB_URL = ""
|
DB_URL = ""
|
||||||
|
@ -55,7 +55,7 @@ func init() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("Error loading .env file")
|
log.Println("Error loading .env file")
|
||||||
}
|
}
|
||||||
YAUTH_ADMIN_SECRET = os.Getenv("YAUTH_ADMIN_SECRET")
|
ROOT_SECRET = os.Getenv("ROOT_SECRET")
|
||||||
ENV = os.Getenv("ENV")
|
ENV = os.Getenv("ENV")
|
||||||
DB_TYPE = os.Getenv("DB_TYPE")
|
DB_TYPE = os.Getenv("DB_TYPE")
|
||||||
DB_URL = os.Getenv("DB_URL")
|
DB_URL = os.Getenv("DB_URL")
|
||||||
|
@ -78,8 +78,8 @@ func init() {
|
||||||
// FACEBOOK_CLIENT_SECRET = os.Getenv("FACEBOOK_CLIENT_SECRET")
|
// FACEBOOK_CLIENT_SECRET = os.Getenv("FACEBOOK_CLIENT_SECRET")
|
||||||
FORGOT_PASSWORD_URI = strings.TrimPrefix(os.Getenv("FORGOT_PASSWORD_URI"), "/")
|
FORGOT_PASSWORD_URI = strings.TrimPrefix(os.Getenv("FORGOT_PASSWORD_URI"), "/")
|
||||||
VERIFY_EMAIL_URI = strings.TrimPrefix(os.Getenv("VERIFY_EMAIL_URI"), "/")
|
VERIFY_EMAIL_URI = strings.TrimPrefix(os.Getenv("VERIFY_EMAIL_URI"), "/")
|
||||||
if YAUTH_ADMIN_SECRET == "" {
|
if ROOT_SECRET == "" {
|
||||||
panic("Yauth admin secret is required")
|
panic("Root admin secret is required")
|
||||||
}
|
}
|
||||||
|
|
||||||
if ENV == "" {
|
if ENV == "" {
|
||||||
|
@ -107,7 +107,7 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if COOKIE_NAME == "" {
|
if COOKIE_NAME == "" {
|
||||||
COOKIE_NAME = "yauth"
|
COOKIE_NAME = "authorizer"
|
||||||
}
|
}
|
||||||
|
|
||||||
if SERVER_URL == "" {
|
if SERVER_URL == "" {
|
||||||
|
|
|
@ -3,8 +3,8 @@ package db
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/yauthdev/yauth/server/constants"
|
"github.com/authorizerdev/authorizer/server/constants"
|
||||||
"github.com/yauthdev/yauth/server/enum"
|
"github.com/authorizerdev/authorizer/server/enum"
|
||||||
"gorm.io/driver/mysql"
|
"gorm.io/driver/mysql"
|
||||||
"gorm.io/driver/postgres"
|
"gorm.io/driver/postgres"
|
||||||
"gorm.io/driver/sqlite"
|
"gorm.io/driver/sqlite"
|
||||||
|
@ -37,7 +37,7 @@ func init() {
|
||||||
log.Println("=> from db:", constants.DB_TYPE, constants.DB_URL)
|
log.Println("=> from db:", constants.DB_TYPE, constants.DB_URL)
|
||||||
ormConfig := &gorm.Config{
|
ormConfig := &gorm.Config{
|
||||||
NamingStrategy: schema.NamingStrategy{
|
NamingStrategy: schema.NamingStrategy{
|
||||||
TablePrefix: "yauth_",
|
TablePrefix: "authorizer_",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
if constants.DB_TYPE == enum.Postgres.String() {
|
if constants.DB_TYPE == enum.Postgres.String() {
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"net/smtp"
|
"net/smtp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/yauthdev/yauth/server/constants"
|
"github.com/authorizerdev/authorizer/server/constants"
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module github.com/yauthdev/yauth/server
|
module github.com/authorizerdev/authorizer/server
|
||||||
|
|
||||||
go 1.16
|
go 1.16
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ resolver:
|
||||||
# gqlgen will search for any type names in the schema in these go packages
|
# gqlgen will search for any type names in the schema in these go packages
|
||||||
# if they match it will use them, otherwise it will generate them.
|
# if they match it will use them, otherwise it will generate them.
|
||||||
autobind:
|
autobind:
|
||||||
- 'github.com/yauthdev/yauth/server/graph/model'
|
- 'github.com/authorizerdev/authorizer/server/graph/model'
|
||||||
|
|
||||||
# This section declares type mapping between the GraphQL and go type systems
|
# This section declares type mapping between the GraphQL and go type systems
|
||||||
#
|
#
|
||||||
|
|
|
@ -12,9 +12,9 @@ import (
|
||||||
|
|
||||||
"github.com/99designs/gqlgen/graphql"
|
"github.com/99designs/gqlgen/graphql"
|
||||||
"github.com/99designs/gqlgen/graphql/introspection"
|
"github.com/99designs/gqlgen/graphql/introspection"
|
||||||
|
"github.com/authorizerdev/authorizer/server/graph/model"
|
||||||
gqlparser "github.com/vektah/gqlparser/v2"
|
gqlparser "github.com/vektah/gqlparser/v2"
|
||||||
"github.com/vektah/gqlparser/v2/ast"
|
"github.com/vektah/gqlparser/v2/ast"
|
||||||
"github.com/yauthdev/yauth/server/graph/model"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// region ************************** generated!.gotpl **************************
|
// region ************************** generated!.gotpl **************************
|
||||||
|
@ -39,8 +39,7 @@ type ResolverRoot interface {
|
||||||
Query() QueryResolver
|
Query() QueryResolver
|
||||||
}
|
}
|
||||||
|
|
||||||
type DirectiveRoot struct {
|
type DirectiveRoot struct{}
|
||||||
}
|
|
||||||
|
|
||||||
type ComplexityRoot struct {
|
type ComplexityRoot struct {
|
||||||
Error struct {
|
Error struct {
|
||||||
|
@ -110,6 +109,7 @@ type MutationResolver interface {
|
||||||
ForgotPassword(ctx context.Context, params model.ForgotPasswordInput) (*model.Response, error)
|
ForgotPassword(ctx context.Context, params model.ForgotPasswordInput) (*model.Response, error)
|
||||||
ResetPassword(ctx context.Context, params model.ResetPassowrdInput) (*model.Response, error)
|
ResetPassword(ctx context.Context, params model.ResetPassowrdInput) (*model.Response, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type QueryResolver interface {
|
type QueryResolver interface {
|
||||||
Users(ctx context.Context) ([]*model.User, error)
|
Users(ctx context.Context) ([]*model.User, error)
|
||||||
Token(ctx context.Context) (*model.LoginResponse, error)
|
Token(ctx context.Context) (*model.LoginResponse, error)
|
||||||
|
@ -3130,7 +3130,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co
|
||||||
|
|
||||||
func (ec *executionContext) unmarshalInputForgotPasswordInput(ctx context.Context, obj interface{}) (model.ForgotPasswordInput, error) {
|
func (ec *executionContext) unmarshalInputForgotPasswordInput(ctx context.Context, obj interface{}) (model.ForgotPasswordInput, error) {
|
||||||
var it model.ForgotPasswordInput
|
var it model.ForgotPasswordInput
|
||||||
var asMap = obj.(map[string]interface{})
|
asMap := obj.(map[string]interface{})
|
||||||
|
|
||||||
for k, v := range asMap {
|
for k, v := range asMap {
|
||||||
switch k {
|
switch k {
|
||||||
|
@ -3150,7 +3150,7 @@ func (ec *executionContext) unmarshalInputForgotPasswordInput(ctx context.Contex
|
||||||
|
|
||||||
func (ec *executionContext) unmarshalInputLoginInput(ctx context.Context, obj interface{}) (model.LoginInput, error) {
|
func (ec *executionContext) unmarshalInputLoginInput(ctx context.Context, obj interface{}) (model.LoginInput, error) {
|
||||||
var it model.LoginInput
|
var it model.LoginInput
|
||||||
var asMap = obj.(map[string]interface{})
|
asMap := obj.(map[string]interface{})
|
||||||
|
|
||||||
for k, v := range asMap {
|
for k, v := range asMap {
|
||||||
switch k {
|
switch k {
|
||||||
|
@ -3178,7 +3178,7 @@ func (ec *executionContext) unmarshalInputLoginInput(ctx context.Context, obj in
|
||||||
|
|
||||||
func (ec *executionContext) unmarshalInputResendVerifyEmailInput(ctx context.Context, obj interface{}) (model.ResendVerifyEmailInput, error) {
|
func (ec *executionContext) unmarshalInputResendVerifyEmailInput(ctx context.Context, obj interface{}) (model.ResendVerifyEmailInput, error) {
|
||||||
var it model.ResendVerifyEmailInput
|
var it model.ResendVerifyEmailInput
|
||||||
var asMap = obj.(map[string]interface{})
|
asMap := obj.(map[string]interface{})
|
||||||
|
|
||||||
for k, v := range asMap {
|
for k, v := range asMap {
|
||||||
switch k {
|
switch k {
|
||||||
|
@ -3198,7 +3198,7 @@ func (ec *executionContext) unmarshalInputResendVerifyEmailInput(ctx context.Con
|
||||||
|
|
||||||
func (ec *executionContext) unmarshalInputResetPassowrdInput(ctx context.Context, obj interface{}) (model.ResetPassowrdInput, error) {
|
func (ec *executionContext) unmarshalInputResetPassowrdInput(ctx context.Context, obj interface{}) (model.ResetPassowrdInput, error) {
|
||||||
var it model.ResetPassowrdInput
|
var it model.ResetPassowrdInput
|
||||||
var asMap = obj.(map[string]interface{})
|
asMap := obj.(map[string]interface{})
|
||||||
|
|
||||||
for k, v := range asMap {
|
for k, v := range asMap {
|
||||||
switch k {
|
switch k {
|
||||||
|
@ -3234,7 +3234,7 @@ func (ec *executionContext) unmarshalInputResetPassowrdInput(ctx context.Context
|
||||||
|
|
||||||
func (ec *executionContext) unmarshalInputSignUpInput(ctx context.Context, obj interface{}) (model.SignUpInput, error) {
|
func (ec *executionContext) unmarshalInputSignUpInput(ctx context.Context, obj interface{}) (model.SignUpInput, error) {
|
||||||
var it model.SignUpInput
|
var it model.SignUpInput
|
||||||
var asMap = obj.(map[string]interface{})
|
asMap := obj.(map[string]interface{})
|
||||||
|
|
||||||
for k, v := range asMap {
|
for k, v := range asMap {
|
||||||
switch k {
|
switch k {
|
||||||
|
@ -3294,7 +3294,7 @@ func (ec *executionContext) unmarshalInputSignUpInput(ctx context.Context, obj i
|
||||||
|
|
||||||
func (ec *executionContext) unmarshalInputUpdateProfileInput(ctx context.Context, obj interface{}) (model.UpdateProfileInput, error) {
|
func (ec *executionContext) unmarshalInputUpdateProfileInput(ctx context.Context, obj interface{}) (model.UpdateProfileInput, error) {
|
||||||
var it model.UpdateProfileInput
|
var it model.UpdateProfileInput
|
||||||
var asMap = obj.(map[string]interface{})
|
asMap := obj.(map[string]interface{})
|
||||||
|
|
||||||
for k, v := range asMap {
|
for k, v := range asMap {
|
||||||
switch k {
|
switch k {
|
||||||
|
@ -3362,7 +3362,7 @@ func (ec *executionContext) unmarshalInputUpdateProfileInput(ctx context.Context
|
||||||
|
|
||||||
func (ec *executionContext) unmarshalInputVerifyEmailInput(ctx context.Context, obj interface{}) (model.VerifyEmailInput, error) {
|
func (ec *executionContext) unmarshalInputVerifyEmailInput(ctx context.Context, obj interface{}) (model.VerifyEmailInput, error) {
|
||||||
var it model.VerifyEmailInput
|
var it model.VerifyEmailInput
|
||||||
var asMap = obj.(map[string]interface{})
|
asMap := obj.(map[string]interface{})
|
||||||
|
|
||||||
for k, v := range asMap {
|
for k, v := range asMap {
|
||||||
switch k {
|
switch k {
|
||||||
|
|
|
@ -6,9 +6,9 @@ package graph
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/yauthdev/yauth/server/graph/generated"
|
"github.com/authorizerdev/authorizer/server/graph/generated"
|
||||||
"github.com/yauthdev/yauth/server/graph/model"
|
"github.com/authorizerdev/authorizer/server/graph/model"
|
||||||
"github.com/yauthdev/yauth/server/resolvers"
|
"github.com/authorizerdev/authorizer/server/resolvers"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (r *mutationResolver) Signup(ctx context.Context, params model.SignUpInput) (*model.Response, error) {
|
func (r *mutationResolver) Signup(ctx context.Context, params model.SignUpInput) (*model.Response, error) {
|
||||||
|
@ -65,5 +65,7 @@ func (r *Resolver) Mutation() generated.MutationResolver { return &mutationResol
|
||||||
// Query returns generated.QueryResolver implementation.
|
// Query returns generated.QueryResolver implementation.
|
||||||
func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }
|
func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }
|
||||||
|
|
||||||
type mutationResolver struct{ *Resolver }
|
type (
|
||||||
type queryResolver struct{ *Resolver }
|
mutationResolver struct{ *Resolver }
|
||||||
|
queryResolver struct{ *Resolver }
|
||||||
|
)
|
||||||
|
|
|
@ -2,9 +2,9 @@ package handlers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/99designs/gqlgen/graphql/handler"
|
"github.com/99designs/gqlgen/graphql/handler"
|
||||||
|
"github.com/authorizerdev/authorizer/server/graph"
|
||||||
|
"github.com/authorizerdev/authorizer/server/graph/generated"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/yauthdev/yauth/server/graph"
|
|
||||||
"github.com/yauthdev/yauth/server/graph/generated"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Defining the Graphql handler
|
// Defining the Graphql handler
|
||||||
|
|
|
@ -8,13 +8,13 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/authorizerdev/authorizer/server/constants"
|
||||||
|
"github.com/authorizerdev/authorizer/server/db"
|
||||||
|
"github.com/authorizerdev/authorizer/server/enum"
|
||||||
|
"github.com/authorizerdev/authorizer/server/oauth"
|
||||||
|
"github.com/authorizerdev/authorizer/server/session"
|
||||||
|
"github.com/authorizerdev/authorizer/server/utils"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/yauthdev/yauth/server/constants"
|
|
||||||
"github.com/yauthdev/yauth/server/db"
|
|
||||||
"github.com/yauthdev/yauth/server/enum"
|
|
||||||
"github.com/yauthdev/yauth/server/oauth"
|
|
||||||
"github.com/yauthdev/yauth/server/session"
|
|
||||||
"github.com/yauthdev/yauth/server/utils"
|
|
||||||
"golang.org/x/oauth2"
|
"golang.org/x/oauth2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,11 @@ package handlers
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/authorizerdev/authorizer/server/enum"
|
||||||
|
"github.com/authorizerdev/authorizer/server/oauth"
|
||||||
|
"github.com/authorizerdev/authorizer/server/session"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/yauthdev/yauth/server/enum"
|
|
||||||
"github.com/yauthdev/yauth/server/oauth"
|
|
||||||
"github.com/yauthdev/yauth/server/session"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func OAuthLoginHandler(provider enum.OAuthProvider) gin.HandlerFunc {
|
func OAuthLoginHandler(provider enum.OAuthProvider) gin.HandlerFunc {
|
||||||
|
|
|
@ -5,12 +5,12 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/authorizerdev/authorizer/server/constants"
|
||||||
|
"github.com/authorizerdev/authorizer/server/db"
|
||||||
|
"github.com/authorizerdev/authorizer/server/enum"
|
||||||
|
"github.com/authorizerdev/authorizer/server/session"
|
||||||
|
"github.com/authorizerdev/authorizer/server/utils"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/yauthdev/yauth/server/constants"
|
|
||||||
"github.com/yauthdev/yauth/server/db"
|
|
||||||
"github.com/yauthdev/yauth/server/enum"
|
|
||||||
"github.com/yauthdev/yauth/server/session"
|
|
||||||
"github.com/yauthdev/yauth/server/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func VerifyEmailHandler() gin.HandlerFunc {
|
func VerifyEmailHandler() gin.HandlerFunc {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package oauth
|
package oauth
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/yauthdev/yauth/server/constants"
|
"github.com/authorizerdev/authorizer/server/constants"
|
||||||
"golang.org/x/oauth2"
|
"golang.org/x/oauth2"
|
||||||
githubOAuth2 "golang.org/x/oauth2/github"
|
githubOAuth2 "golang.org/x/oauth2/github"
|
||||||
googleOAuth2 "golang.org/x/oauth2/google"
|
googleOAuth2 "golang.org/x/oauth2/google"
|
||||||
|
|
|
@ -7,10 +7,10 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/yauthdev/yauth/server/db"
|
"github.com/authorizerdev/authorizer/server/db"
|
||||||
"github.com/yauthdev/yauth/server/enum"
|
"github.com/authorizerdev/authorizer/server/enum"
|
||||||
"github.com/yauthdev/yauth/server/graph/model"
|
"github.com/authorizerdev/authorizer/server/graph/model"
|
||||||
"github.com/yauthdev/yauth/server/utils"
|
"github.com/authorizerdev/authorizer/server/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ForgotPassword(ctx context.Context, params model.ForgotPasswordInput) (*model.Response, error) {
|
func ForgotPassword(ctx context.Context, params model.ForgotPasswordInput) (*model.Response, error) {
|
||||||
|
|
|
@ -6,11 +6,11 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/yauthdev/yauth/server/db"
|
"github.com/authorizerdev/authorizer/server/db"
|
||||||
"github.com/yauthdev/yauth/server/enum"
|
"github.com/authorizerdev/authorizer/server/enum"
|
||||||
"github.com/yauthdev/yauth/server/graph/model"
|
"github.com/authorizerdev/authorizer/server/graph/model"
|
||||||
"github.com/yauthdev/yauth/server/session"
|
"github.com/authorizerdev/authorizer/server/session"
|
||||||
"github.com/yauthdev/yauth/server/utils"
|
"github.com/authorizerdev/authorizer/server/utils"
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@ package resolvers
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/yauthdev/yauth/server/graph/model"
|
"github.com/authorizerdev/authorizer/server/graph/model"
|
||||||
"github.com/yauthdev/yauth/server/session"
|
"github.com/authorizerdev/authorizer/server/session"
|
||||||
"github.com/yauthdev/yauth/server/utils"
|
"github.com/authorizerdev/authorizer/server/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Logout(ctx context.Context) (*model.Response, error) {
|
func Logout(ctx context.Context) (*model.Response, error) {
|
||||||
|
|
|
@ -4,10 +4,10 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/yauthdev/yauth/server/db"
|
"github.com/authorizerdev/authorizer/server/db"
|
||||||
"github.com/yauthdev/yauth/server/graph/model"
|
"github.com/authorizerdev/authorizer/server/graph/model"
|
||||||
"github.com/yauthdev/yauth/server/session"
|
"github.com/authorizerdev/authorizer/server/session"
|
||||||
"github.com/yauthdev/yauth/server/utils"
|
"github.com/authorizerdev/authorizer/server/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Profile(ctx context.Context) (*model.User, error) {
|
func Profile(ctx context.Context) (*model.User, error) {
|
||||||
|
|
|
@ -7,9 +7,9 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/yauthdev/yauth/server/db"
|
"github.com/authorizerdev/authorizer/server/db"
|
||||||
"github.com/yauthdev/yauth/server/graph/model"
|
"github.com/authorizerdev/authorizer/server/graph/model"
|
||||||
"github.com/yauthdev/yauth/server/utils"
|
"github.com/authorizerdev/authorizer/server/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ResendVerifyEmail(ctx context.Context, params model.ResendVerifyEmailInput) (*model.Response, error) {
|
func ResendVerifyEmail(ctx context.Context, params model.ResendVerifyEmailInput) (*model.Response, error) {
|
||||||
|
|
|
@ -4,9 +4,9 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/yauthdev/yauth/server/db"
|
"github.com/authorizerdev/authorizer/server/db"
|
||||||
"github.com/yauthdev/yauth/server/graph/model"
|
"github.com/authorizerdev/authorizer/server/graph/model"
|
||||||
"github.com/yauthdev/yauth/server/utils"
|
"github.com/authorizerdev/authorizer/server/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ResetPassword(ctx context.Context, params model.ResetPassowrdInput) (*model.Response, error) {
|
func ResetPassword(ctx context.Context, params model.ResetPassowrdInput) (*model.Response, error) {
|
||||||
|
|
|
@ -7,10 +7,10 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/yauthdev/yauth/server/db"
|
"github.com/authorizerdev/authorizer/server/db"
|
||||||
"github.com/yauthdev/yauth/server/enum"
|
"github.com/authorizerdev/authorizer/server/enum"
|
||||||
"github.com/yauthdev/yauth/server/graph/model"
|
"github.com/authorizerdev/authorizer/server/graph/model"
|
||||||
"github.com/yauthdev/yauth/server/utils"
|
"github.com/authorizerdev/authorizer/server/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Signup(ctx context.Context, params model.SignUpInput) (*model.Response, error) {
|
func Signup(ctx context.Context, params model.SignUpInput) (*model.Response, error) {
|
||||||
|
|
|
@ -5,11 +5,11 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/yauthdev/yauth/server/db"
|
"github.com/authorizerdev/authorizer/server/db"
|
||||||
"github.com/yauthdev/yauth/server/enum"
|
"github.com/authorizerdev/authorizer/server/enum"
|
||||||
"github.com/yauthdev/yauth/server/graph/model"
|
"github.com/authorizerdev/authorizer/server/graph/model"
|
||||||
"github.com/yauthdev/yauth/server/session"
|
"github.com/authorizerdev/authorizer/server/session"
|
||||||
"github.com/yauthdev/yauth/server/utils"
|
"github.com/authorizerdev/authorizer/server/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Token(ctx context.Context) (*model.LoginResponse, error) {
|
func Token(ctx context.Context) (*model.LoginResponse, error) {
|
||||||
|
|
|
@ -7,11 +7,11 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/yauthdev/yauth/server/db"
|
"github.com/authorizerdev/authorizer/server/db"
|
||||||
"github.com/yauthdev/yauth/server/enum"
|
"github.com/authorizerdev/authorizer/server/enum"
|
||||||
"github.com/yauthdev/yauth/server/graph/model"
|
"github.com/authorizerdev/authorizer/server/graph/model"
|
||||||
"github.com/yauthdev/yauth/server/session"
|
"github.com/authorizerdev/authorizer/server/session"
|
||||||
"github.com/yauthdev/yauth/server/utils"
|
"github.com/authorizerdev/authorizer/server/utils"
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/yauthdev/yauth/server/db"
|
"github.com/authorizerdev/authorizer/server/db"
|
||||||
"github.com/yauthdev/yauth/server/graph/model"
|
"github.com/authorizerdev/authorizer/server/graph/model"
|
||||||
"github.com/yauthdev/yauth/server/utils"
|
"github.com/authorizerdev/authorizer/server/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Users(ctx context.Context) ([]*model.User, error) {
|
func Users(ctx context.Context) ([]*model.User, error) {
|
||||||
|
|
|
@ -4,9 +4,9 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/yauthdev/yauth/server/db"
|
"github.com/authorizerdev/authorizer/server/db"
|
||||||
"github.com/yauthdev/yauth/server/graph/model"
|
"github.com/authorizerdev/authorizer/server/graph/model"
|
||||||
"github.com/yauthdev/yauth/server/utils"
|
"github.com/authorizerdev/authorizer/server/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func VerificationRequests(ctx context.Context) ([]*model.VerificationRequest, error) {
|
func VerificationRequests(ctx context.Context) ([]*model.VerificationRequest, error) {
|
||||||
|
|
|
@ -5,11 +5,11 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/yauthdev/yauth/server/db"
|
"github.com/authorizerdev/authorizer/server/db"
|
||||||
"github.com/yauthdev/yauth/server/enum"
|
"github.com/authorizerdev/authorizer/server/enum"
|
||||||
"github.com/yauthdev/yauth/server/graph/model"
|
"github.com/authorizerdev/authorizer/server/graph/model"
|
||||||
"github.com/yauthdev/yauth/server/session"
|
"github.com/authorizerdev/authorizer/server/session"
|
||||||
"github.com/yauthdev/yauth/server/utils"
|
"github.com/authorizerdev/authorizer/server/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func VerifyEmail(ctx context.Context, params model.VerifyEmailInput) (*model.LoginResponse, error) {
|
func VerifyEmail(ctx context.Context, params model.VerifyEmailInput) (*model.LoginResponse, error) {
|
||||||
|
|
|
@ -4,10 +4,10 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
|
"github.com/authorizerdev/authorizer/server/enum"
|
||||||
|
"github.com/authorizerdev/authorizer/server/handlers"
|
||||||
|
"github.com/authorizerdev/authorizer/server/oauth"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/yauthdev/yauth/server/enum"
|
|
||||||
"github.com/yauthdev/yauth/server/handlers"
|
|
||||||
"github.com/yauthdev/yauth/server/oauth"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func GinContextToContextMiddleware() gin.HandlerFunc {
|
func GinContextToContextMiddleware() gin.HandlerFunc {
|
||||||
|
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
|
"github.com/authorizerdev/authorizer/server/constants"
|
||||||
"github.com/go-redis/redis/v8"
|
"github.com/go-redis/redis/v8"
|
||||||
"github.com/yauthdev/yauth/server/constants"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type SessionStore struct {
|
type SessionStore struct {
|
||||||
|
|
|
@ -6,10 +6,10 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/authorizerdev/authorizer/server/constants"
|
||||||
|
"github.com/authorizerdev/authorizer/server/enum"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/golang-jwt/jwt"
|
"github.com/golang-jwt/jwt"
|
||||||
"github.com/yauthdev/yauth/server/constants"
|
|
||||||
"github.com/yauthdev/yauth/server/enum"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type UserAuthInfo struct {
|
type UserAuthInfo struct {
|
||||||
|
|
|
@ -5,8 +5,8 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
|
"github.com/authorizerdev/authorizer/server/constants"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/yauthdev/yauth/server/constants"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func SetCookie(gc *gin.Context, token string) {
|
func SetCookie(gc *gin.Context, token string) {
|
||||||
|
|
|
@ -3,8 +3,8 @@ package utils
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/yauthdev/yauth/server/constants"
|
"github.com/authorizerdev/authorizer/server/constants"
|
||||||
"github.com/yauthdev/yauth/server/email"
|
"github.com/authorizerdev/authorizer/server/email"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SendVerificationMail to send verification email
|
// SendVerificationMail to send verification email
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/yauthdev/yauth/server/constants"
|
"github.com/authorizerdev/authorizer/server/constants"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetDomainName() string {
|
func GetDomainName() string {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/authorizerdev/authorizer/server/constants"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/yauthdev/yauth/server/constants"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func IsSuperAdmin(gc *gin.Context) bool {
|
func IsSuperAdmin(gc *gin.Context) bool {
|
||||||
|
@ -11,5 +11,5 @@ func IsSuperAdmin(gc *gin.Context) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
return secret == constants.YAUTH_ADMIN_SECRET
|
return secret == constants.ROOT_SECRET
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,8 @@ package utils
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/authorizerdev/authorizer/server/constants"
|
||||||
"github.com/golang-jwt/jwt"
|
"github.com/golang-jwt/jwt"
|
||||||
"github.com/yauthdev/yauth/server/constants"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type UserInfo struct {
|
type UserInfo struct {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user