// Retrieve fetches the stored external provider token.
355342
func (c *TokenController) Retrieve(ctx *app.RetrieveTokenContext) error {
	appToken, errorResponse, err := c.app.TokenService().RetrieveExternalToken(ctx, ctx.For, ctx.RequestData, ctx.ForcePull)
	if errorResponse != nil {
		ctx.ResponseData.Header().Add("Access-Control-Expose-Headers", "WWW-Authenticate")
		ctx.ResponseData.Header().Set("WWW-Authenticate", *errorResponse)
	}
	if err != nil {
		log.Error(ctx, map[string]interface{}{
			"err": err,
		}, "failed to retrieve token")
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	return ctx.OK(appToken)
}
651944
func (m *CouchDBBackend) Get(ctx context.Context, key string) (*physical.Entry, error) {
	m.permitPool.Acquire()
	defer m.permitPool.Release()

	return m.GetInternal(ctx, key)
}
744069
func (c Client) Get(id string, params *stripe.TokenParams) (*stripe.Token, error) {
	path := stripe.FormatURLPath("/v1/tokens/%s", id)
	token := &stripe.Token{}
	err := c.B.Call(http.MethodGet, path, c.Key, params, token)

	return token, err
}
661044
func (self *CouponClient) Retrieve(id string) (*Coupon, error) {
	coupon := Coupon{}
	path := "/v1/coupons/" + url.QueryEscape(id)
	err := query("GET", path, nil, &coupon)
	return &coupon, err
}
543786
func (c *ChainProvider) Retrieve() (Value, error) {
	var errs errorList
	for _, p := range c.Providers {
		value, err := p.Retrieve()
		if err == nil {
			c.active = p
			return value, nil
		}
		errs = append(errs, err)
	}
	c.active = nil

	err := ErrNoValidProvidersFoundInChain
	if len(errs) > 0 {
		err = errs
	}

	return Value{}, err
}
988485
func (self *PlanClient) Retrieve(id string) (*Plan, error) {
	plan := Plan{}
	path := "/v1/plans/" + url.QueryEscape(id)
	err := query("GET", path, nil, &plan)
	return &plan, err
}
221355
func (a *Authorization) GetToken() string {
	if a == nil || a.Token == nil {
		return ""
	}
	return *a.Token
}
1088431
func (self *ChargeClient) Retrieve(id string) (*Charge, error) {
	charge := Charge{}
	path := "/v1/charges/" + url.QueryEscape(id)
	err := query("GET", path, nil, &charge)
	return &charge, err
}
144908
func (c Claims) Get(key string) interface{} {
	return jwt.Claims(c).Get(key)
}
1232941
func (p Provider) Retrieve() (credentials.Value, error) {
	creds := credentials.Value{
		ProviderName: ProviderName,
	}

	k, s, t, err := p.RetrieveFn()
	if err != nil {
		return creds, awserr.New(ErrCodePluginProviderRetrieve,
			"failed to retrieve credentials with plugin provider", err)
	}

	creds.AccessKeyID = k
	creds.SecretAccessKey = s
	creds.SessionToken = t

	return creds, nil
}
458249
func (odr *LesOdr) Retrieve(ctx context.Context, req light.OdrRequest) (err error) {
	lreq := LesRequest(req)

	reqID := genReqID()
	rq := &distReq{
		getCost: func(dp distPeer) uint64 {
			return lreq.GetCost(dp.(*peer))
		},
		canSend: func(dp distPeer) bool {
			p := dp.(*peer)
			if !p.isOnlyAnnounce {
				return lreq.CanSend(p)
			}
			return false
		},
		request: func(dp distPeer) func() {
			p := dp.(*peer)
			cost := lreq.GetCost(p)
			p.fcServer.QueuedRequest(reqID, cost)
			return func() { lreq.Request(reqID, p) }
		},
	}

	if err = odr.retriever.retrieve(ctx, reqID, rq, func(p distPeer, msg *Msg) error { return lreq.Validate(odr.db, msg) }, odr.stop); err == nil {
		// retrieved from network, store in db
		req.StoreResult(odr.db)
	} else {
		log.Debug("Failed to retrieve data from network", "err", err)
	}
	return
}
62656
func GetToken(c *gin.Context) string {
	token, exists := c.Get("JWT_TOKEN")
	if !exists {
		return ""
	}

	return token.(string)
}
830738
func (a *API) Get(url string, params Params, dst interface{}) error {
	resp, err := try(a.client.Get(url, params, a.token))
	if err != nil {
		return err
	}

	defer resp.Body.Close()

	// no destination, so caller was only interested in the
	// side effects.
	if dst == nil {
		return nil
	}

	decoder := json.NewDecoder(resp.Body)
	err = decoder.Decode(&dst)
	if err != nil {
		return err
	}

	return nil
}
139074
func (m *EC2RoleProvider) Retrieve() (credentials.Value, error) {
	credsList, err := requestCredList(m.Client)
	if err != nil {
		return credentials.Value{ProviderName: ProviderName}, err
	}

	if len(credsList) == 0 {
		return credentials.Value{ProviderName: ProviderName}, awserr.New("EmptyEC2RoleList", "empty EC2 Role list", nil)
	}
	credsName := credsList[0]

	roleCreds, err := requestCred(m.Client, credsName)
	if err != nil {
		return credentials.Value{ProviderName: ProviderName}, err
	}

	m.SetExpiration(roleCreds.Expiration, m.ExpiryWindow)

	return credentials.Value{
		AccessKeyID:     roleCreds.AccessKeyID,
		SecretAccessKey: roleCreds.SecretAccessKey,
		SessionToken:    roleCreds.Token,
		ProviderName:    ProviderName,
	}, nil
}
1340118
func (s *StaticProvider) Retrieve() (Value, error) {
	if s.IsValid() {
		return s.Value, nil
	}
	return Value{}, fmt.Errorf("static credentials are empty")
}
402719
func (s *SelfClient) Get(ctx context.Context, token string) (*apitypes.Self, error) {
	raw := &rawSelf{}
	err := tokenRoundTrip(ctx, s.client, token, "GET", "/self", nil, nil, raw)
	if err != nil {
		return nil, err
	}

	self := raw.Self
	switch raw.Type {
	case apitypes.UserSession:
		user, err := envelope.ConvertUser(raw.Identity)
		if err != nil {
			return nil, err
		}

		self.Identity = user
		self.Auth = user
	case apitypes.MachineSession:
		self.Identity = &envelope.Machine{
			ID:      raw.Identity.ID,
			Version: raw.Identity.Version,
			Body:    raw.Identity.Body.(*primitive.Machine),
		}
		self.Auth = &envelope.MachineToken{
			ID:      raw.Auth.ID,
			Version: raw.Auth.Version,
			Body:    raw.Auth.Body.(*primitive.MachineToken),
		}
	default:
		return nil, errUnknownSessionType
	}

	return self, nil
}
813972
func (p *FileMinioClient) Retrieve() (Value, error) {
	if p.filename == "" {
		if value, ok := os.LookupEnv("MINIO_SHARED_CREDENTIALS_FILE"); ok {
			p.filename = value
		} else {
			homeDir, err := homedir.Dir()
			if err != nil {
				return Value{}, err
			}
			p.filename = filepath.Join(homeDir, ".mc", "config.json")
			if runtime.GOOS == "windows" {
				p.filename = filepath.Join(homeDir, "mc", "config.json")
			}
		}
	}

	if p.alias == "" {
		p.alias = os.Getenv("MINIO_ALIAS")
		if p.alias == "" {
			p.alias = "s3"
		}
	}

	p.retrieved = false

	hostCfg, err := loadAlias(p.filename, p.alias)
	if err != nil {
		return Value{}, err
	}

	p.retrieved = true
	return Value{
		AccessKeyID:     hostCfg.AccessKey,
		SecretAccessKey: hostCfg.SecretKey,
		SignerType:      parseSignatureType(hostCfg.API),
	}, nil
}