oauth2

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OAuth2AuthURL  = "https://login.uber.com/oauth/v2/authorize"
	OAuth2TokenURL = "https://login.uber.com/oauth/v2/token"
)
View Source
const (
	// Access the user's basic profile information
	// on a user's Uber account including their
	// firstname, email address and profile picture.
	ScopeProfile = "profile"

	// Pull trip data including times, product
	// type andd city information of a user's
	// historical pickups and drop-offs.
	ScopeHistory = "history"

	// ScopeHistoryLite is the same as
	// ScopeHistory but without city information.
	ScopeHistoryLite = "history_lite"

	// Access to get and update your saved places.
	// This includes your home and work addresses if
	// you have saved them with Uber.
	ScopePlaces = "places"

	// Allows developers to provide a complete
	// Uber ride experience inside their app
	// using the widget. Enables users to access
	// trip information for rides requested through
	// the app and the current ride, available promos,
	// and payment methods (last two digits only)
	// using the widget. Uber's charges, terms
	// and policies will apply.
	ScopeRideWidgets = "ride_widgets"

	// ScopeRequest is a privileged scope that
	// allows your application to make requests
	// for Uber products on behalf of users.
	ScopeRequest = "request"

	// ScopeRequestReceipt is a privileged scope that
	// allows your application to get receipt details
	// for requests made by the application.
	// Restrictions: This scope is only granted to apps
	//  that request Uber rides directly and receipts
	//  as part of the trip lifecycle. We do not allow
	// apps to aggregate receipt information. The receipt
	// endpoint will only provide receipts for ride requests
	// origination from your application. It is not
	// currently possible to receive receipt
	// data for all trips, as of: (Fri 12 May 2017 18:18:42 MDT).
	ScopeRequestReceipt = "request_receipt"

	// ScopeAllTrips is a privileged scope that allows
	// access to trip details about all future Uber trips,
	// including pickup, destination and real-time
	// location for all of your future rides.
	ScopeAllTrips = "all_trips"

	// ScopeDelivery is a privileged scope that gives
	// access to the authenticated user's deliveries.
	ScopeDelivery = "delivery"

	// ScopePartnerAccounts is a privileged scope that
	// means that you've authorized Uber to share your
	// account information with this partner.
	ScopePartnerAccounts = "partner.accounts"

	// ScopePartnerPayments is a privileged scope that
	// authorizes Uber to share your payments information
	// with this partner.
	ScopePartnerPayments = "partner.payments"

	// ScopePartnerTrips is a privileged scope that
	// authorizes Uber to share your trip times, fares,
	// distances and cities with this partner.
	ScopePartnerTrips = "partner.trips"
)

Variables

This section is empty.

Functions

func Authorize

func Authorize(oconfig *OAuth2AppConfig, scopes ...string) (*oauth2.Token, error)

func AuthorizeByEnvApp

func AuthorizeByEnvApp(scopes ...string) (*oauth2.Token, error)

func AuthorizeWithClientCredential added in v0.1.9

func AuthorizeWithClientCredential(clientID, clientSecret string, scopes ...string) (*oauth2.Token, error)

func Transport

func Transport(token *oauth2.Token) *oauth2.Transport

func TransportFromFile

func TransportFromFile(path string) (*oauth2.Transport, error)

func TransportWithBase

func TransportWithBase(token *oauth2.Token, base http.RoundTripper) *oauth2.Transport

Types

type OAuth2AppConfig

type OAuth2AppConfig struct {
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	RedirectURL  string `json:"redirect_url"`
}

func OAuth2ConfigFromEnv

func OAuth2ConfigFromEnv() (*OAuth2AppConfig, error)

OAuth2ConfigFromEnv retrieves your app's client id and client secret from your environment, with the purpose of later being able to perform application functions on behalf of users.

Jump to

Keyboard shortcuts

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