services

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package services ...

Package services ...

Package services ...

Package services ...

Package services ...

Package services ...

Package services ...

Package services ...

Package services ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowedURI

type AllowedURI struct {
	ID       int64  `json:"id"`
	URI      string `json:"uri"`
	ClientID int64  `json:"clientId"`
}

AllowedURI AllowedURI

type AllowedURIResponse

type AllowedURIResponse struct {
	Success bool  `json:"success"`
	ID      int64 `json:"id"`
	Code    int   `json:"code"`
}

AllowedURIResponse resp

type Client

type Client struct {
	ClientID     int64         `json:"clientId"`
	Secret       string        `json:"secret"`
	Name         string        `json:"name"`
	WebSite      string        `json:"webSite"`
	Email        string        `json:"email"`
	Enabled      bool          `json:"enabled"`
	Paid         bool          `json:"paid"`
	RedirectURIs []RedirectURI `json:"redirectUrls"`
}

Client client

type ClientResponse

type ClientResponse struct {
	Success  bool  `json:"success"`
	ClientID int64 `json:"id"`
	Code     int   `json:"code"`
}

ClientResponse resp

type ClientRole

type ClientRole struct {
	ID       int64  `json:"id"`
	ClientID int64  `json:"clientId"`
	Role     string `json:"role"`
	Used     bool
}

ClientRole ClientRole

type ClientRoleResponse

type ClientRoleResponse struct {
	Success bool  `json:"success"`
	ID      int64 `json:"id"`
	Code    int   `json:"code"`
}

ClientRoleResponse resp

type GrantType

type GrantType struct {
	ID        int64  `json:"id"`
	ClientID  int64  `json:"clientId"`
	GrantType string `json:"grantType"`
}

GrantType GrantType

type GrantTypeResponse

type GrantTypeResponse struct {
	Success bool  `json:"success"`
	ID      int64 `json:"id"`
	Code    int   `json:"code"`
}

GrantTypeResponse resp

type MockOauth2Service

type MockOauth2Service struct {
	Token    string
	ClientID string
	//APIKey   string
	//UserID string
	//Hashed string
	Host  string
	Proxy px.Proxy
	Log   *lg.Logger

	MockClientResponse *ClientResponse
	MockClient         *Client
	MockClientCode     int
	MockClientList     *[]Client
	MockClientListCode int

	MockAllowedURIResponse *AllowedURIResponse
	MockAllowedURI         *AllowedURI
	MockAllowedURICode     int
	MockAllowedURIList     *[]AllowedURI
	MockAllowedURIListCode int

	MockClientRoleResponse *ClientRoleResponse
	MockClientRoleList     *[]ClientRole
	MockClientRoleListCode int

	MockGrantTypeResponse *GrantTypeResponse
	MockGrantTypeList     *[]GrantType
	MockGrantTypeListCode int

	MockRedirectURIResponse *RedirectURIResponse
	MockRedirectURIList     *[]RedirectURI
	MockRedirectURIListCode int

	MockRoleURIResponse *RoleURIResponse
	MockRoleURIList     *[]RoleURI
	MockRoleURIListCode int

	MockUserResponse *UserResponse
	MockUser         *User
	MockUserCode     int
	MockUserList     *[]User
	MockUserListCode int
	MockRoleList     *[]Role
	MockRoleListCode int
}

MockOauth2Service MockOauth2Service

func (*MockOauth2Service) AddAllowedURI

func (s *MockOauth2Service) AddAllowedURI(au *AllowedURI) *AllowedURIResponse

AddAllowedURI AddAllowedURI

func (*MockOauth2Service) AddClient

func (s *MockOauth2Service) AddClient(client *Client) *ClientResponse

AddClient AddClient

func (*MockOauth2Service) AddClientRole

func (s *MockOauth2Service) AddClientRole(cr *ClientRole) *ClientRoleResponse

AddClientRole AddClientRole

func (*MockOauth2Service) AddGrantType

func (s *MockOauth2Service) AddGrantType(rd *GrantType) *GrantTypeResponse

AddGrantType AddGrantType

func (*MockOauth2Service) AddRedirectURI

func (s *MockOauth2Service) AddRedirectURI(rd *RedirectURI) *RedirectURIResponse

AddRedirectURI AddRedirectURI

func (*MockOauth2Service) AddRoleURI

func (s *MockOauth2Service) AddRoleURI(ru *RoleURI) *RoleURIResponse

AddRoleURI AddRoleURI

func (*MockOauth2Service) AddUser

func (s *MockOauth2Service) AddUser(user *User) *UserResponse

AddUser AddUser

func (*MockOauth2Service) DeleteAllowedURI

func (s *MockOauth2Service) DeleteAllowedURI(id string) *AllowedURIResponse

DeleteAllowedURI DeleteAllowedURI

func (*MockOauth2Service) DeleteClient

func (s *MockOauth2Service) DeleteClient(id string) *ClientResponse

DeleteClient DeleteClient

func (*MockOauth2Service) DeleteClientRole

func (s *MockOauth2Service) DeleteClientRole(id string) *ClientRoleResponse

DeleteClientRole DeleteClientRole

func (*MockOauth2Service) DeleteGrantType

func (s *MockOauth2Service) DeleteGrantType(id string) *GrantTypeResponse

DeleteGrantType DeleteGrantType

func (*MockOauth2Service) DeleteRedirectURI

func (s *MockOauth2Service) DeleteRedirectURI(id string) *RedirectURIResponse

DeleteRedirectURI DeleteRedirectURI

func (*MockOauth2Service) DeleteRoleURI

func (s *MockOauth2Service) DeleteRoleURI(ru *RoleURI) *RoleURIResponse

DeleteRoleURI DeleteRoleURI

func (*MockOauth2Service) DeleteUser

func (s *MockOauth2Service) DeleteUser(username string, clientID string) *UserResponse

DeleteUser DeleteUser

func (*MockOauth2Service) GetAllowedURI

func (s *MockOauth2Service) GetAllowedURI(id string) (*AllowedURI, int)

GetAllowedURI GetAllowedURI

func (*MockOauth2Service) GetAllowedURIList

func (s *MockOauth2Service) GetAllowedURIList(clientID string) (*[]AllowedURI, int)

GetAllowedURIList GetAllowedURIList

func (*MockOauth2Service) GetClient

func (s *MockOauth2Service) GetClient(clientID string) (*Client, int)

GetClient GetClient

func (*MockOauth2Service) GetClientList

func (s *MockOauth2Service) GetClientList() (*[]Client, int)

GetClientList GetClientList

func (*MockOauth2Service) GetClientRoleList

func (s *MockOauth2Service) GetClientRoleList(clientID string) (*[]ClientRole, int)

GetClientRoleList GetClientRoleList

func (*MockOauth2Service) GetGrantTypeList

func (s *MockOauth2Service) GetGrantTypeList(clientID string) (*[]GrantType, int)

GetGrantTypeList GetGrantTypeList

func (*MockOauth2Service) GetNew

func (s *MockOauth2Service) GetNew() Service

GetNew GetNew

func (*MockOauth2Service) GetRedirectURIList

func (s *MockOauth2Service) GetRedirectURIList(clientID string) (*[]RedirectURI, int)

GetRedirectURIList GetRedirectURIList

func (*MockOauth2Service) GetRoleList

func (s *MockOauth2Service) GetRoleList() (*[]Role, int)

GetRoleList GetRoleList

func (*MockOauth2Service) GetRoleURIList

func (s *MockOauth2Service) GetRoleURIList(uID string) (*[]RoleURI, int)

GetRoleURIList GetRoleURIList

func (*MockOauth2Service) GetUser

func (s *MockOauth2Service) GetUser(username string, clientID string) (*User, int)

GetUser GetUser

func (*MockOauth2Service) GetUserList

func (s *MockOauth2Service) GetUserList() (*[]User, int)

GetUserList GetUserList

func (*MockOauth2Service) SearchClient

func (s *MockOauth2Service) SearchClient(client *Client) (*[]Client, int)

SearchClient SearchClient

func (*MockOauth2Service) SearchUserList

func (s *MockOauth2Service) SearchUserList(clientID string) (*[]User, int)

SearchUserList SearchUserList

func (*MockOauth2Service) SetToken

func (s *MockOauth2Service) SetToken(token string)

SetToken SetToken

func (*MockOauth2Service) UpdateAllowedURI

func (s *MockOauth2Service) UpdateAllowedURI(au *AllowedURI) *AllowedURIResponse

UpdateAllowedURI UpdateAllowedURI

func (*MockOauth2Service) UpdateClient

func (s *MockOauth2Service) UpdateClient(client *Client) *ClientResponse

UpdateClient UpdateClient

func (*MockOauth2Service) UpdateUser

func (s *MockOauth2Service) UpdateUser(user UpdateUser) *UserResponse

UpdateUser UpdateUser

type Oauth2Service

type Oauth2Service struct {
	Token    string
	ClientID string
	//APIKey   string
	//UserID string
	//Hashed string
	Host     string
	UserHost string
	Proxy    px.Proxy
	Log      *lg.Logger
}

Oauth2Service Oauth2Service

func (*Oauth2Service) AddAllowedURI

func (a *Oauth2Service) AddAllowedURI(au *AllowedURI) *AllowedURIResponse

AddAllowedURI add

func (*Oauth2Service) AddClient

func (c *Oauth2Service) AddClient(client *Client) *ClientResponse

AddClient add template

func (*Oauth2Service) AddClientRole

func (r *Oauth2Service) AddClientRole(cr *ClientRole) *ClientRoleResponse

AddClientRole AddClientRole

func (*Oauth2Service) AddGrantType

func (g *Oauth2Service) AddGrantType(rd *GrantType) *GrantTypeResponse

AddGrantType AddGrantType

func (*Oauth2Service) AddRedirectURI

func (r *Oauth2Service) AddRedirectURI(rd *RedirectURI) *RedirectURIResponse

AddRedirectURI AddRedirectURI

func (*Oauth2Service) AddRoleURI

func (r *Oauth2Service) AddRoleURI(ru *RoleURI) *RoleURIResponse

AddRoleURI add

func (*Oauth2Service) AddUser

func (u *Oauth2Service) AddUser(user *User) *UserResponse

AddUser add

func (*Oauth2Service) DeleteAllowedURI

func (a *Oauth2Service) DeleteAllowedURI(id string) *AllowedURIResponse

DeleteAllowedURI delete DeleteAllowedURI

func (*Oauth2Service) DeleteClient

func (c *Oauth2Service) DeleteClient(id string) *ClientResponse

DeleteClient delete DeleteClient

func (*Oauth2Service) DeleteClientRole

func (r *Oauth2Service) DeleteClientRole(id string) *ClientRoleResponse

DeleteClientRole delete DeleteClientRole

func (*Oauth2Service) DeleteGrantType

func (g *Oauth2Service) DeleteGrantType(id string) *GrantTypeResponse

DeleteGrantType delete DeleteGrantType

func (*Oauth2Service) DeleteRedirectURI

func (r *Oauth2Service) DeleteRedirectURI(id string) *RedirectURIResponse

DeleteRedirectURI delete DeleteRedirectURI

func (*Oauth2Service) DeleteRoleURI

func (r *Oauth2Service) DeleteRoleURI(ru *RoleURI) *RoleURIResponse

DeleteRoleURI add

func (*Oauth2Service) DeleteUser

func (u *Oauth2Service) DeleteUser(username string, clientID string) *UserResponse

DeleteUser delete

func (*Oauth2Service) GetAllowedURI

func (a *Oauth2Service) GetAllowedURI(id string) (*AllowedURI, int)

GetAllowedURI get GetAllowedURI

func (*Oauth2Service) GetAllowedURIList

func (a *Oauth2Service) GetAllowedURIList(clientID string) (*[]AllowedURI, int)

GetAllowedURIList get GetAllowedURIList list

func (*Oauth2Service) GetClient

func (c *Oauth2Service) GetClient(clientID string) (*Client, int)

GetClient get GetClient

func (*Oauth2Service) GetClientList

func (c *Oauth2Service) GetClientList() (*[]Client, int)

GetClientList get client list

func (*Oauth2Service) GetClientRoleList

func (r *Oauth2Service) GetClientRoleList(clientID string) (*[]ClientRole, int)

GetClientRoleList get GetClientRoleList list

func (*Oauth2Service) GetGrantTypeList

func (g *Oauth2Service) GetGrantTypeList(clientID string) (*[]GrantType, int)

GetGrantTypeList get GetGrantTypeList list

func (*Oauth2Service) GetNew

func (s *Oauth2Service) GetNew() Service

GetNew GetNew

func (*Oauth2Service) GetRedirectURIList

func (r *Oauth2Service) GetRedirectURIList(clientID string) (*[]RedirectURI, int)

GetRedirectURIList get GetRedirectURIList list

func (*Oauth2Service) GetRoleList

func (u *Oauth2Service) GetRoleList() (*[]Role, int)

GetRoleList get role list

func (*Oauth2Service) GetRoleURIList

func (r *Oauth2Service) GetRoleURIList(uID string) (*[]RoleURI, int)

GetRoleURIList get GetRoleURIList list

func (*Oauth2Service) GetUser

func (u *Oauth2Service) GetUser(username string, clientID string) (*User, int)

GetUser get

func (*Oauth2Service) GetUserList

func (u *Oauth2Service) GetUserList() (*[]User, int)

GetUserList get user list

func (*Oauth2Service) SearchClient

func (c *Oauth2Service) SearchClient(client *Client) (*[]Client, int)

SearchClient SearchClient

func (*Oauth2Service) SearchUserList

func (u *Oauth2Service) SearchUserList(clientID string) (*[]User, int)

SearchUserList search by client

func (*Oauth2Service) SetToken

func (s *Oauth2Service) SetToken(token string)

SetToken SetToken

func (*Oauth2Service) UpdateAllowedURI

func (a *Oauth2Service) UpdateAllowedURI(au *AllowedURI) *AllowedURIResponse

UpdateAllowedURI update UpdateAllowedURI

func (*Oauth2Service) UpdateClient

func (c *Oauth2Service) UpdateClient(client *Client) *ClientResponse

UpdateClient update UpdateClient

func (*Oauth2Service) UpdateUser

func (u *Oauth2Service) UpdateUser(user UpdateUser) *UserResponse

UpdateUser update

type RedirectURI

type RedirectURI struct {
	ID       int64  `json:"id"`
	ClientID int64  `json:"clientId"`
	URI      string `json:"uri"`
}

RedirectURI RedirectURI

type RedirectURIResponse

type RedirectURIResponse struct {
	Success bool  `json:"success"`
	ID      int64 `json:"id"`
	Code    int   `json:"code"`
}

RedirectURIResponse resp

type Role

type Role struct {
	ID   int64  `json:"id"`
	Role string `json:"role"`
}

Role user role

type RoleURI

type RoleURI struct {
	ClientRoleID       int64 `json:"clientRoleId"`
	ClientAllowedURIID int64 `json:"clientAllowedUriId"`
}

RoleURI RoleURI

type RoleURIResponse

type RoleURIResponse struct {
	Success bool `json:"success"`
	Code    int  `json:"code"`
}

RoleURIResponse resp

type Service

type Service interface {
	AddClient(client *Client) *ClientResponse
	UpdateClient(client *Client) *ClientResponse
	GetClient(clientID string) (*Client, int)
	GetClientList() (*[]Client, int)
	SearchClient(client *Client) (*[]Client, int)
	DeleteClient(id string) *ClientResponse

	AddAllowedURI(au *AllowedURI) *AllowedURIResponse
	UpdateAllowedURI(au *AllowedURI) *AllowedURIResponse
	GetAllowedURI(id string) (*AllowedURI, int)
	GetAllowedURIList(clientID string) (*[]AllowedURI, int)
	DeleteAllowedURI(id string) *AllowedURIResponse

	AddClientRole(cr *ClientRole) *ClientRoleResponse
	GetClientRoleList(clientID string) (*[]ClientRole, int)
	DeleteClientRole(id string) *ClientRoleResponse

	AddGrantType(rd *GrantType) *GrantTypeResponse
	GetGrantTypeList(clientID string) (*[]GrantType, int)
	DeleteGrantType(id string) *GrantTypeResponse

	AddRedirectURI(rd *RedirectURI) *RedirectURIResponse
	GetRedirectURIList(clientID string) (*[]RedirectURI, int)
	DeleteRedirectURI(id string) *RedirectURIResponse

	AddRoleURI(ru *RoleURI) *RoleURIResponse
	GetRoleURIList(uID string) (*[]RoleURI, int)
	DeleteRoleURI(ru *RoleURI) *RoleURIResponse

	AddUser(user *User) *UserResponse
	UpdateUser(user UpdateUser) *UserResponse
	GetUser(username string, clientID string) (*User, int)
	GetUserList() (*[]User, int)
	SearchUserList(clientID string) (*[]User, int)
	DeleteUser(username string, clientID string) *UserResponse
	GetRoleList() (*[]Role, int)

	SetToken(token string)
}

Service Service

type UpdateUser

type UpdateUser interface {
	GetType() string
}

UpdateUser interface

type User

type User struct {
	Username     string `json:"username"`
	Password     string `json:"password"`
	Enabled      bool   `json:"enabled"`
	EmailAddress string `json:"emailAddress"`
	FirstName    string `json:"firstName"`
	LastName     string `json:"lastName"`
	RoleID       int64  `json:"roleId"`
	ClientID     int64  `json:"clientId"`
}

User user

type UserDis

type UserDis struct {
	Username string `json:"username"`
	Enabled  bool   `json:"enabled"`
	ClientID int64  `json:"clientId"`
}

UserDis user

func (*UserDis) GetType

func (u *UserDis) GetType() string

GetType type

type UserInfo

type UserInfo struct {
	Username     string `json:"username"`
	EmailAddress string `json:"emailAddress"`
	FirstName    string `json:"firstName"`
	LastName     string `json:"lastName"`
	RoleID       int64  `json:"roleId"`
	ClientID     int64  `json:"clientId"`
}

UserInfo user

func (*UserInfo) GetType

func (u *UserInfo) GetType() string

GetType type

type UserPW

type UserPW struct {
	Username string `json:"username"`
	Password string `json:"password"`
	ClientID int64  `json:"clientId"`
}

UserPW user

func (*UserPW) GetType

func (u *UserPW) GetType() string

GetType type

type UserResponse

type UserResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
	Code    int    `json:"code"`
}

UserResponse resp

Jump to

Keyboard shortcuts

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