gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

application.go (2626B)


      1 // GoToSocial
      2 // Copyright (C) GoToSocial Authors admin@gotosocial.org
      3 // SPDX-License-Identifier: AGPL-3.0-or-later
      4 //
      5 // This program is free software: you can redistribute it and/or modify
      6 // it under the terms of the GNU Affero General Public License as published by
      7 // the Free Software Foundation, either version 3 of the License, or
      8 // (at your option) any later version.
      9 //
     10 // This program is distributed in the hope that it will be useful,
     11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13 // GNU Affero General Public License for more details.
     14 //
     15 // You should have received a copy of the GNU Affero General Public License
     16 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
     17 
     18 package model
     19 
     20 // Application models an api application.
     21 //
     22 // swagger:model application
     23 type Application struct {
     24 	// The ID of the application.
     25 	// example: 01FBVD42CQ3ZEEVMW180SBX03B
     26 	ID string `json:"id,omitempty"`
     27 	// The name of the application.
     28 	// example: Tusky
     29 	Name string `json:"name"`
     30 	// The website associated with the application (url)
     31 	// example: https://tusky.app
     32 	Website string `json:"website,omitempty"`
     33 	// Post-authorization redirect URI for the application (OAuth2).
     34 	// example: https://example.org/callback?some=query
     35 	RedirectURI string `json:"redirect_uri,omitempty"`
     36 	// Client ID associated with this application.
     37 	ClientID string `json:"client_id,omitempty"`
     38 	// Client secret associated with this application.
     39 	ClientSecret string `json:"client_secret,omitempty"`
     40 	// Push API key for this application.
     41 	VapidKey string `json:"vapid_key,omitempty"`
     42 }
     43 
     44 // ApplicationCreateRequest models app create parameters.
     45 //
     46 // swagger:parameters appCreate
     47 type ApplicationCreateRequest struct {
     48 	// The name of the application.
     49 	//
     50 	// in: formData
     51 	// required: true
     52 	ClientName string `form:"client_name" json:"client_name" xml:"client_name" binding:"required"`
     53 	// Where the user should be redirected after authorization.
     54 	//
     55 	// To display the authorization code to the user instead of redirecting to a web page, use `urn:ietf:wg:oauth:2.0:oob` in this parameter.
     56 	//
     57 	// in: formData
     58 	// required: true
     59 	RedirectURIs string `form:"redirect_uris" json:"redirect_uris" xml:"redirect_uris" binding:"required"`
     60 	// Space separated list of scopes.
     61 	//
     62 	// If no scopes are provided, defaults to `read`.
     63 	//
     64 	// in: formData
     65 	Scopes string `form:"scopes" json:"scopes" xml:"scopes"`
     66 	// A URL to the web page of the app (optional).
     67 	//
     68 	// in: formData
     69 	Website string `form:"website" json:"website" xml:"website"`
     70 }