// AppIDLogin - app-id auth backend
550171
func (v *Vault) AppIDLogin() (string, error) {
	appID := env.Getenv("VAULT_APP_ID")
	userID := env.Getenv("VAULT_USER_ID")

	if appID == "" || userID == "" {
		return "", nil
	}

	mount := env.Getenv("VAULT_AUTH_APP_ID_MOUNT", "app-id")

	vars := map[string]interface{}{
		"user_id": userID,
	}

	path := fmt.Sprintf("auth/%s/login/%s", mount, appID)
	secret, err := v.client.Logical().Write(path, vars)
	if err != nil {
		return "", errors.Wrapf(err, "AppID logon failed")
	}
	if secret == nil {
		return "", errors.New("Empty response from AppID logon")
	}

	return secret.Auth.ClientToken, nil
}
1091914
func (s *Service) AppInfo(ctx context.Context, appIdentity string) (*App, error) {
	var app App
	return &app, s.Get(ctx, &app, fmt.Sprintf("/apps/%v", appIdentity), nil, nil)
}
212040
func AppInfo(appID string) error {
	c, appID, err := load(appID)

	if err != nil {
		return err
	}

	app, err := apps.Get(c, appID)

	if err != nil {
		return err
	}

	fmt.Printf("=== %s Application\n", app.ID)
	fmt.Println("updated: ", app.Updated)
	fmt.Println("uuid:    ", app.UUID)
	fmt.Println("created: ", app.Created)
	fmt.Println("url:     ", app.URL)
	fmt.Println("owner:   ", app.Owner)
	fmt.Println("id:      ", app.ID)

	fmt.Println()
	// print the app processes
	if err = PsList(app.ID, defaultLimit); err != nil {
		return err
	}

	fmt.Println()
	// print the app domains
	if err = DomainsList(app.ID, defaultLimit); err != nil {
		return err
	}

	fmt.Println()

	return nil
}
1171758
func (c *AppversionListCall) AppId(appId string) *AppversionListCall {
	c.urlParams_.Set("appId", appId)
	return c
}
37768
func (s *CreateDeploymentInput) SetAppId(v string) *CreateDeploymentInput {
	s.AppId = &v
	return s
}
171910
func (c *Client) AppVolumeList(appID string) ([]*ct.Volume, error) {
	if appID == "" {
		return nil, errors.New("controller: missing app ID")
	}
	var volumes []*ct.Volume
	return volumes, c.Get(fmt.Sprintf("/apps/%s/volumes", appID), &volumes)
}
926194
func (c *Client) AppInfo(appIdentity string) (*App, error) {
	var app App
	return &app, c.Get(&app, "/apps/"+appIdentity)
}
228866
func (c *Client) LogDrainDelete(appIdentity string, logDrainIdentity string) error {
	return c.Delete("/apps/" + appIdentity + "/log-drains/" + logDrainIdentity)
}
490794
func (s *DeleteAppInput) SetAppId(v string) *DeleteAppInput {
	s.AppId = &v
	return s
}
550129
func (s *GetAppReplicationConfigurationInput) SetAppId(v string) *GetAppReplicationConfigurationInput {
	s.AppId = &v
	return s
}
1126547
func (s *GetAppLaunchConfigurationOutput) SetAppId(v string) *GetAppLaunchConfigurationOutput {
	s.AppId = &v
	return s
}
1285563
func (s *ListJobsInput) SetAppId(v string) *ListJobsInput {
	s.AppId = &v
	return s
}
954317
func (s *GetBranchInput) SetAppId(v string) *GetBranchInput {
	s.AppId = &v
	return s
}
126391
func (s *LaunchAppInput) SetAppId(v string) *LaunchAppInput {
	s.AppId = &v
	return s
}
930673
func AppDidEnterBackground() bool {
	if !isInited() {
		return false
	}
	defer kbCtx.Trace("AppDidEnterBackground", func() error { return nil })()
	ctx := context.Background()
	convs, err := kbChatCtx.MessageDeliverer.ActiveDeliveries(ctx)
	if err != nil {
		kbCtx.Log.Debug("AppDidEnterBackground: failed to get active deliveries: %s", err)
		convs = nil
	}
	stayRunning := false
	switch {
	case len(convs) > 0:
		kbCtx.Log.Debug("AppDidEnterBackground: active deliveries in progress")
		stayRunning = true
	case kbChatCtx.CoinFlipManager.HasActiveGames(ctx):
		kbCtx.Log.Debug("AppDidEnterBackground: active coin flip games in progress")
		stayRunning = true
	}
	if stayRunning {
		kbCtx.Log.Debug("AppDidEnterBackground: setting background active")
		kbCtx.MobileAppState.Update(keybase1.MobileAppState_BACKGROUNDACTIVE)
		return true
	}
	SetAppStateBackground()
	return false
}
1143020
func (m Middleware) RequestIDLogger(next http.Handler) http.Handler {
	fn := func(w http.ResponseWriter, r *http.Request) {
		requestID := chimiddleware.GetReqID(r.Context())
		derivedLogger := m.Log.With(zap.String("request_id", requestID))
		r = r.WithContext(context.WithValue(r.Context(), CtxLoggerKey, derivedLogger))
		next.ServeHTTP(w, r)
	}

	return http.HandlerFunc(fn)
}
1223129
func (c *Client) GetApp(appID string) (*ct.App, error) {
	app := &ct.App{}
	return app, c.Get(fmt.Sprintf("/apps/%s", appID), app)
}