// DeleteWebSession deletes web session from the storage
170382
func (s *IdentityService) DeleteWebSession(user, sid string) error {
	if user == "" {
		return trace.BadParameter("missing username")
	}
	if sid == "" {
		return trace.BadParameter("missing session id")
	}
	err := s.Delete(context.TODO(), backend.Key(webPrefix, usersPrefix, user, sessionsPrefix, sid))
	return trace.Wrap(err)
}
297241
func (u *UserV2) WebSessionInfo(allowedLogins []string) interface{} {
	out := u.V1()
	out.AllowedLogins = allowedLogins
	return *out
}
375471
func (s *AuthServer) CreateWebSession(user string) (services.WebSession, error) {
	sess, err := s.NewWebSession(user)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	if err := s.UpsertWebSession(user, sess); err != nil {
		return nil, trace.Wrap(err)
	}
	sess, err = services.GetWebSessionMarshaler().GenerateWebSession(sess)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	return sess, nil
}
1023082
func (c *Manager) DeleteLibraryItemUpdateSession(ctx context.Context, id string) error {
	url := internal.URL(c, internal.LibraryItemUpdateSession).WithID(id)
	return c.Do(ctx, url.Request(http.MethodDelete), nil)
}
824392
func (pder *MemProvider) SessionDestroy(sid string) error {
	pder.lock.Lock()
	defer pder.lock.Unlock()
	if element, ok := pder.sessions[sid]; ok {
		delete(pder.sessions, sid)
		pder.list.Remove(element)
		return nil
	}
	return nil
}
407927
func MakeDeleteSessionsByOwnerTokenEndpoint(s Service) endpoint.Endpoint {
	return func(ctx context.Context, request interface{}) (interface{}, error) {
		req := request.(deleteSessionsByOwnerTokenRequest)
		sessions, err := s.DeleteSessionsByOwnerToken(ctx, req.OwnerToken)
		return deleteSessionsByOwnerTokenResponse{
			Sessions: sessions,
			Err:      err,
		}, nil
	}
}
74299
func (c *SessionContext) ExtendWebSession() (services.WebSession, error) {
	sess, err := c.clt.ExtendWebSession(c.user, c.sess.GetName())
	if err != nil {
		return nil, trace.Wrap(err)
	}
	return sess, nil
}
324792
func (s *PoolService) DeleteStoragePool(p *DeleteStoragePoolParams) (*DeleteStoragePoolResponse, error) {
	resp, err := s.cs.newRequest("deleteStoragePool", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r DeleteStoragePoolResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
728283
func (o *OAuthSession) Delete(d Deleter) error {
	// Build form for POST request.
	v := url.Values{}
	v.Add("id", d.deleteID())

	return o.postBody("https://oauth.reddit.com/api/del", v, nil)
}
429209
func (service *GCSService) DeleteObject(ctx context.Context, params GCSObjectParams) error {
	return service.Client.Bucket(params.Bucket).Object(params.ID).Delete(ctx)
}
1089788
func (c *Client) GetWebSessionInfo(user string, sid string) (services.WebSession, error) {
	out, err := c.Get(
		c.Endpoint("users", user, "web", "sessions", sid), url.Values{})
	if err != nil {
		return nil, trace.Wrap(err)
	}
	return services.GetWebSessionMarshaler().UnmarshalWebSession(out.Bytes())
}
782095
func (m *Module) DestroySession(rw http.ResponseWriter, req *http.Request) {
	session, err := m.getSessionFromRequest(req)
	if session == nil {
		return
	} else if err != nil {
		// TODO: log error
		return
	}

	m.RevocationStore.Revoke(session.SessionID, m.revocationTrackDuration)
	http.SetCookie(rw, &http.Cookie{
		Name:     m.CookieName,
		MaxAge:   -1,
		HttpOnly: true,
		Expires:  time.Now().Add(-time.Hour),
		Value:    "deleted",
		Path:     "/",
		Domain:   m.CookieDomain,
		Secure:   m.SecureCookie,
	})
}
1070641
func (s *service) DeleteSessionsByOwnerToken(ctx context.Context, ownerToken string) ([]sessions.Session, error) {
	return s.sessionRepo.DeleteByOwnerToken(ctx, ownerToken)
}
1310997
func DeleteWebhook(c *messagebird.Client, id string) error {
	return request(c, nil, http.MethodDelete, webhooksPath+"/"+id, nil)
}
1358556
func (fp *FileProvider) SessionDestroy(sid string) error {
	filepder.lock.Lock()
	defer filepder.lock.Unlock()
	os.Remove(path.Join(fp.savePath, string(sid[0]), string(sid[1]), sid))
	return nil
}
349107
func (s *Service) AddOnWebhookDelete(ctx context.Context, addOnIdentity string, appWebhookIdentity string) (*AddOnWebhookDeleteResult, error) {
	var addOnWebhook AddOnWebhookDeleteResult
	return &addOnWebhook, s.Delete(ctx, &addOnWebhook, fmt.Sprintf("/addons/%v/webhooks/%v", addOnIdentity, appWebhookIdentity))
}
271997
func httpDeleteBgp(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error) {
	log.Debugf("Received httpDeleteBgp: %+v", vars)

	key := vars["key"]

	// Delete the object
	err := DeleteBgp(key)
	if err != nil {
		log.Errorf("DeleteBgp error for: %s. Err: %v", key, err)
		return nil, err
	}

	// Return the obj
	return key, nil
}