sso

package module
v0.0.0-...-24d45c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

README

SSO application - a simple ui application to register and sigin users.

This application was build to provide end to end testing example of ui application.

Is uses aerospike to store user profiles.

Prerequisites:

Enable ssh logic you your use on your machine (on osx System Preference / Sharing / Remote Login )

Install docker service

Download endly

Provide a username and password to login to your box.

endly -c=localhost

Verify that secret file were created

cat ~/.secret/localhost.json
Run reporter webservice workflow

Run the following command:

git clone https://github.com/viant/endly
cd endly/example/ui/sso/e2e/

run test with run workflow:

endly r=run

To check manager workflow tasks list

endly -t='?'
 

#Troubleshooting

to check you aerospike just run

docker exec -it db1 aql SELECT * FROM db1.users;

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseResponse

type BaseResponse struct {
	Status      string `json:"status"`
	Error       string `json:"error"`
	ErrorSource string `json:"errorSource"`
}

BaseResponse represents base response

type Config

type Config struct {
	Port         string
	IPLookupURL  string
	StaticRoutes []*StaticRoute
	DsConfig     *dsc.Config
}

Config represents sso config

type IpInfo

type IpInfo struct {
	Ip          string `json:"ip"`
	CountryCode string `json:"country_code"`
}

IpInfo represents an IP info

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents http server

func NewServer

func NewServer(config *Config, service Service) (*Server, error)

NewServer creates a new http server

func (*Server) Start

func (s *Server) Start()

Start start server

type Service

type Service interface {
	SignUp(*SignUpRequest, *http.Request) *SignUpResponse

	SignIn(*SignInRequest) *SignInResponse
}

Service represents sso service

func NewService

func NewService(config *Config) (Service, error)

NewService creates a new SSO service.

type SignInRequest

type SignInRequest struct {
	Email       string `json:"email"`
	Password    string `json:"password"`
	RememberMe  string `json:"rememberMe"`
	LandingPage string `json:"landingPage"`
}

SignInRequest represents signin request

type SignInResponse

type SignInResponse struct {
	*BaseResponse
	*User
	LandingPage string `json:"landingPage"`
}

SignInResponse represents signin response

type SignUpRequest

type SignUpRequest struct {
	*User
	DataOfBirth string `json:"dateOfBirth"`
	Password    string `json:"password"`
	LandingPage string `json:"landingPage"`
}

SignUpRequest represents signup request

func (*SignUpRequest) Validate

func (r *SignUpRequest) Validate() (string, error)

Validate check request all data if it is provided or valid.

type SignUpResponse

type SignUpResponse struct {
	*BaseResponse
	*User
	LandingPage string `json:"landingPage"`
}

SignUpResponse represents signup response

type StaticRoute

type StaticRoute struct {
	URI       string
	Directory string
}

StaticRoute represent a static route

type User

type User struct {
	Email          string     `json:"email" primaryKey:"true" column:"email"`
	Name           string     `json:"name" column:"name"`
	HashedPassword string     `json:"-" column:"hashedPassword"`
	DateOfBirth    *time.Time `json:"dateOfBirth" column:"dateOfBirth" `
}

User represents a user

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL