Documentation ¶
Overview ¶
Package apps package to manage extensions of the oauth protocol
Package apps package to manage extensions of the oauth protocol ¶
Package apps package to manage extensions of the oauth protocol ¶
Package apps package to manage extensions of the oauth protocol ¶
Package apps package to manage extensions of the oauth protocol ¶
Package apps package to manage extensions of the oauth protocol
Index ¶
- Constants
- func AccessCodePayload(ctx context.Context, owner, serviceName, responseType, scopes string, ...) (map[string]interface{}, error)
- func GetAppPayload(ctx context.Context, serviceID string, database *mongo.Database) (map[string]interface{}, error)
- func SearchExposedScopes(ctx context.Context, database *mongo.Database) ([]utils.Scope, error)
- type App
- type CreateAppPayload
- type TPApp
- func CreateOrUpdateApp(ctx context.Context, tpApp *TPApp, database *mongo.Database) (*TPApp, error)
- func LoginAsApp(serviceID, secret string, database *mongo.Database) (*TPApp, error)
- func SearchApp(ctx context.Context, owner string, id string, database *mongo.Database) (*TPApp, int, error)
- func SearchApps(ctx context.Context, owner string, id string, database *mongo.Database) ([]TPApp, error)
Constants ¶
View Source
const ( // AppTypeConfidential define a confidential client for oauth AppTypeConfidential = "confidential" // AppTypePublic define a public client for oauth AppTypePublic = "public" // DBCollection db collection name for thirdparty apps DBCollection = "pantahub_apps" // Prn name convection for the prn Prn = "prn:::apps:/" )
Variables ¶
This section is empty.
Functions ¶
func AccessCodePayload ¶
func AccessCodePayload(ctx context.Context, owner, serviceName, responseType, scopes string, accountPayload map[string]interface{}, database *mongo.Database) (map[string]interface{}, error)
AccessCodePayload get accesscode payload for application
Types ¶
type CreateAppPayload ¶
type CreateAppPayload struct { Type string `json:"type"` Nick string `json:"nick"` Name string `json:"name"` Logo string `json:"logo"` RedirectURIs []string `json:"redirect_uris,omitempty"` Scopes []utils.Scope `json:"scopes,omitempty"` ExposedScopes []utils.Scope `json:"exposed_scopes,omitempty" bson:"exposed_scopes,omitempty"` }
CreateAppPayload create app json payload
type TPApp ¶
type TPApp struct { ID primitive.ObjectID `json:"id" bson:"_id"` Name string `json:"name" bson:"name"` Logo string `json:"logo" bson:"logo"` Type string `json:"type" bson:"type"` Nick string `json:"nick" bson:"nick"` Prn string `json:"prn" bson:"prn"` Owner string `json:"owner"` OwnerNick string `json:"owner-nick,omitempty" bson:"owner-nick,omitempty"` Secret string `json:"secret,omitempty" bson:"secret"` RedirectURIs []string `json:"redirect_uris,omitempty" bson:"redirect_uris,omitempty"` Scopes []utils.Scope `json:"scopes,omitempty" bson:"scopes,omitempty"` ExposedScopes []utils.Scope `json:"exposed_scopes,omitempty" bson:"exposed_scopes,omitempty"` ExposedScopesLength int `bson:"exposed_scopes_length,omit"` TimeCreated time.Time `json:"time-created" bson:"time-created"` TimeModified time.Time `json:"time-modified" bson:"time-modified"` DeletedAt *time.Time `json:"deleted-at,omitempty" bson:"deleted-at,omitempty"` }
TPApp OAuth App Type
func CreateOrUpdateApp ¶
CreateOrUpdateApp a new third party app
func LoginAsApp ¶
LoginAsApp using and application id and secret
Click to show internal directories.
Click to hide internal directories.