mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-09 01:13:41 +08:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
9558bb4167 | |||
04567babf8 | |||
543b316942 | |||
e2b6e8ee6e | |||
e7e0518517 | |||
943aa61869 | |||
fcc75dd3be |
@ -63,7 +63,7 @@ func (c *ApiController) GetApplications() {
|
||||
// @Title GetApplication
|
||||
// @Tag Application API
|
||||
// @Description get the detail of an application
|
||||
// @Param id query string true "The id of the application."
|
||||
// @Param id query string true "The id ( owner/name ) of the application."
|
||||
// @Success 200 {object} object.Application The Response object
|
||||
// @router /get-application [get]
|
||||
func (c *ApiController) GetApplication() {
|
||||
@ -78,7 +78,7 @@ func (c *ApiController) GetApplication() {
|
||||
// @Title GetUserApplication
|
||||
// @Tag Application API
|
||||
// @Description get the detail of the user's application
|
||||
// @Param id query string true "The id of the user"
|
||||
// @Param id query string true "The id ( owner/name ) of the user"
|
||||
// @Success 200 {object} object.Application The Response object
|
||||
// @router /get-user-application [get]
|
||||
func (c *ApiController) GetUserApplication() {
|
||||
@ -134,7 +134,7 @@ func (c *ApiController) GetOrganizationApplications() {
|
||||
// @Title UpdateApplication
|
||||
// @Tag Application API
|
||||
// @Description update an application
|
||||
// @Param id query string true "The id of the application"
|
||||
// @Param id query string true "The id ( owner/name ) of the application"
|
||||
// @Param body body object.Application true "The details of the application"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /update-application [post]
|
||||
|
@ -52,7 +52,7 @@ func (c *ApiController) GetCerts() {
|
||||
// @Title GetCert
|
||||
// @Tag Cert API
|
||||
// @Description get cert
|
||||
// @Param id query string true "The id of the cert"
|
||||
// @Param id query string true "The id ( owner/name ) of the cert"
|
||||
// @Success 200 {object} object.Cert The Response object
|
||||
// @router /get-cert [get]
|
||||
func (c *ApiController) GetCert() {
|
||||
@ -66,7 +66,7 @@ func (c *ApiController) GetCert() {
|
||||
// @Title UpdateCert
|
||||
// @Tag Cert API
|
||||
// @Description update cert
|
||||
// @Param id query string true "The id of the cert"
|
||||
// @Param id query string true "The id ( owner/name ) of the cert"
|
||||
// @Param body body object.Cert true "The details of the cert"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /update-cert [post]
|
||||
|
@ -52,7 +52,7 @@ func (c *ApiController) GetModels() {
|
||||
// @Title GetModel
|
||||
// @Tag Model API
|
||||
// @Description get model
|
||||
// @Param id query string true "The id of the model"
|
||||
// @Param id query string true "The id ( owner/name ) of the model"
|
||||
// @Success 200 {object} object.Model The Response object
|
||||
// @router /get-model [get]
|
||||
func (c *ApiController) GetModel() {
|
||||
@ -66,7 +66,7 @@ func (c *ApiController) GetModel() {
|
||||
// @Title UpdateModel
|
||||
// @Tag Model API
|
||||
// @Description update model
|
||||
// @Param id query string true "The id of the model"
|
||||
// @Param id query string true "The id ( owner/name ) of the model"
|
||||
// @Param body body object.Model true "The details of the model"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /update-model [post]
|
||||
|
@ -66,7 +66,7 @@ func (c *ApiController) GetOrganization() {
|
||||
// @Title UpdateOrganization
|
||||
// @Tag Organization API
|
||||
// @Description update organization
|
||||
// @Param id query string true "The id of the organization"
|
||||
// @Param id query string true "The id ( owner/name ) of the organization"
|
||||
// @Param body body object.Organization true "The details of the organization"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /update-organization [post]
|
||||
|
@ -71,7 +71,7 @@ func (c *ApiController) GetUserPayments() {
|
||||
// @Title GetPayment
|
||||
// @Tag Payment API
|
||||
// @Description get payment
|
||||
// @Param id query string true "The id of the payment"
|
||||
// @Param id query string true "The id ( owner/name ) of the payment"
|
||||
// @Success 200 {object} object.Payment The Response object
|
||||
// @router /get-payment [get]
|
||||
func (c *ApiController) GetPayment() {
|
||||
@ -85,7 +85,7 @@ func (c *ApiController) GetPayment() {
|
||||
// @Title UpdatePayment
|
||||
// @Tag Payment API
|
||||
// @Description update payment
|
||||
// @Param id query string true "The id of the payment"
|
||||
// @Param id query string true "The id ( owner/name ) of the payment"
|
||||
// @Param body body object.Payment true "The details of the payment"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /update-payment [post]
|
||||
@ -172,7 +172,7 @@ func (c *ApiController) NotifyPayment() {
|
||||
// @Title InvoicePayment
|
||||
// @Tag Payment API
|
||||
// @Description invoice payment
|
||||
// @Param id query string true "The id of the payment"
|
||||
// @Param id query string true "The id ( owner/name ) of the payment"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /invoice-payment [post]
|
||||
func (c *ApiController) InvoicePayment() {
|
||||
|
@ -69,7 +69,7 @@ func (c *ApiController) GetPermissionsBySubmitter() {
|
||||
// @Title GetPermissionsByRole
|
||||
// @Tag Permission API
|
||||
// @Description get permissions by role
|
||||
// @Param id query string true "The id of the role"
|
||||
// @Param id query string true "The id ( owner/name ) of the role"
|
||||
// @Success 200 {array} object.Permission The Response object
|
||||
// @router /get-permissions-by-role [get]
|
||||
func (c *ApiController) GetPermissionsByRole() {
|
||||
@ -83,7 +83,7 @@ func (c *ApiController) GetPermissionsByRole() {
|
||||
// @Title GetPermission
|
||||
// @Tag Permission API
|
||||
// @Description get permission
|
||||
// @Param id query string true "The id of the permission"
|
||||
// @Param id query string true "The id ( owner/name ) of the permission"
|
||||
// @Success 200 {object} object.Permission The Response object
|
||||
// @router /get-permission [get]
|
||||
func (c *ApiController) GetPermission() {
|
||||
@ -97,7 +97,7 @@ func (c *ApiController) GetPermission() {
|
||||
// @Title UpdatePermission
|
||||
// @Tag Permission API
|
||||
// @Description update permission
|
||||
// @Param id query string true "The id of the permission"
|
||||
// @Param id query string true "The id ( owner/name ) of the permission"
|
||||
// @Param body body object.Permission true "The details of the permission"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /update-permission [post]
|
||||
|
@ -53,7 +53,7 @@ func (c *ApiController) GetProducts() {
|
||||
// @Title GetProduct
|
||||
// @Tag Product API
|
||||
// @Description get product
|
||||
// @Param id query string true "The id of the product"
|
||||
// @Param id query string true "The id ( owner/name ) of the product"
|
||||
// @Success 200 {object} object.Product The Response object
|
||||
// @router /get-product [get]
|
||||
func (c *ApiController) GetProduct() {
|
||||
@ -70,7 +70,7 @@ func (c *ApiController) GetProduct() {
|
||||
// @Title UpdateProduct
|
||||
// @Tag Product API
|
||||
// @Description update product
|
||||
// @Param id query string true "The id of the product"
|
||||
// @Param id query string true "The id ( owner/name ) of the product"
|
||||
// @Param body body object.Product true "The details of the product"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /update-product [post]
|
||||
@ -130,7 +130,7 @@ func (c *ApiController) DeleteProduct() {
|
||||
// @Title BuyProduct
|
||||
// @Tag Product API
|
||||
// @Description buy product
|
||||
// @Param id query string true "The id of the product"
|
||||
// @Param id query string true "The id ( owner/name ) of the product"
|
||||
// @Param providerName query string true "The name of the provider"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /buy-product [post]
|
||||
|
@ -76,7 +76,7 @@ func (c *ApiController) GetGlobalProviders() {
|
||||
// @Title GetProvider
|
||||
// @Tag Provider API
|
||||
// @Description get provider
|
||||
// @Param id query string true "The id of the provider"
|
||||
// @Param id query string true "The id ( owner/name ) of the provider"
|
||||
// @Success 200 {object} object.Provider The Response object
|
||||
// @router /get-provider [get]
|
||||
func (c *ApiController) GetProvider() {
|
||||
@ -89,7 +89,7 @@ func (c *ApiController) GetProvider() {
|
||||
// @Title UpdateProvider
|
||||
// @Tag Provider API
|
||||
// @Description update provider
|
||||
// @Param id query string true "The id of the provider"
|
||||
// @Param id query string true "The id ( owner/name ) of the provider"
|
||||
// @Param body body object.Provider true "The details of the provider"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /update-provider [post]
|
||||
|
@ -180,6 +180,7 @@ func (c *ApiController) UploadResource() {
|
||||
fileType, _ = util.GetOwnerAndNameFromId(mimeType)
|
||||
}
|
||||
|
||||
fullFilePath = object.GetTruncatedPath(provider, fullFilePath, 175)
|
||||
if tag != "avatar" && tag != "termsOfUse" {
|
||||
ext := filepath.Ext(filepath.Base(fullFilePath))
|
||||
index := len(fullFilePath) - len(ext)
|
||||
|
@ -52,7 +52,7 @@ func (c *ApiController) GetRoles() {
|
||||
// @Title GetRole
|
||||
// @Tag Role API
|
||||
// @Description get role
|
||||
// @Param id query string true "The id of the role"
|
||||
// @Param id query string true "The id ( owner/name ) of the role"
|
||||
// @Success 200 {object} object.Role The Response object
|
||||
// @router /get-role [get]
|
||||
func (c *ApiController) GetRole() {
|
||||
@ -66,7 +66,7 @@ func (c *ApiController) GetRole() {
|
||||
// @Title UpdateRole
|
||||
// @Tag Role API
|
||||
// @Description update role
|
||||
// @Param id query string true "The id of the role"
|
||||
// @Param id query string true "The id ( owner/name ) of the role"
|
||||
// @Param body body object.Role true "The details of the role"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /update-role [post]
|
||||
|
@ -26,7 +26,7 @@ import (
|
||||
// @Title DeleteSession
|
||||
// @Tag Session API
|
||||
// @Description Delete session by userId
|
||||
// @Param ID query string true "The ID(owner/name) of user."
|
||||
// @Param id query string true "The id ( owner/name )(owner/name) of user."
|
||||
// @Success 200 {array} string The Response object
|
||||
// @router /delete-session [post]
|
||||
func (c *ApiController) DeleteSession() {
|
||||
|
@ -52,7 +52,7 @@ func (c *ApiController) GetSyncers() {
|
||||
// @Title GetSyncer
|
||||
// @Tag Syncer API
|
||||
// @Description get syncer
|
||||
// @Param id query string true "The id of the syncer"
|
||||
// @Param id query string true "The id ( owner/name ) of the syncer"
|
||||
// @Success 200 {object} object.Syncer The Response object
|
||||
// @router /get-syncer [get]
|
||||
func (c *ApiController) GetSyncer() {
|
||||
@ -66,7 +66,7 @@ func (c *ApiController) GetSyncer() {
|
||||
// @Title UpdateSyncer
|
||||
// @Tag Syncer API
|
||||
// @Description update syncer
|
||||
// @Param id query string true "The id of the syncer"
|
||||
// @Param id query string true "The id ( owner/name ) of the syncer"
|
||||
// @Param body body object.Syncer true "The details of the syncer"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /update-syncer [post]
|
||||
|
@ -29,7 +29,7 @@ type SystemInfo struct {
|
||||
// @Title GetSystemInfo
|
||||
// @Tag System API
|
||||
// @Description get user's system info
|
||||
// @Param id query string true "The id of the user"
|
||||
// @Param id query string true "The id ( owner/name ) of the user"
|
||||
// @Success 200 {object} object.SystemInfo The Response object
|
||||
// @router /get-system-info [get]
|
||||
func (c *ApiController) GetSystemInfo() {
|
||||
|
@ -54,7 +54,7 @@ func (c *ApiController) GetTokens() {
|
||||
// @Title GetToken
|
||||
// @Tag Token API
|
||||
// @Description get token
|
||||
// @Param id query string true "The id of token"
|
||||
// @Param id query string true "The id ( owner/name ) of token"
|
||||
// @Success 200 {object} object.Token The Response object
|
||||
// @router /get-token [get]
|
||||
func (c *ApiController) GetToken() {
|
||||
@ -68,7 +68,7 @@ func (c *ApiController) GetToken() {
|
||||
// @Title UpdateToken
|
||||
// @Tag Token API
|
||||
// @Description update token
|
||||
// @Param id query string true "The id of token"
|
||||
// @Param id query string true "The id ( owner/name ) of token"
|
||||
// @Param body body object.Token true "Details of the token"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /update-token [post]
|
||||
@ -128,7 +128,7 @@ func (c *ApiController) DeleteToken() {
|
||||
// @Title GetOAuthCode
|
||||
// @Tag Token API
|
||||
// @Description get OAuth code
|
||||
// @Param user_id query string true "The id of user"
|
||||
// @Param id query string true "The id ( owner/name ) of user"
|
||||
// @Param client_id query string true "OAuth client id"
|
||||
// @Param response_type query string true "OAuth response type"
|
||||
// @Param redirect_uri query string true "OAuth redirect URI"
|
||||
|
@ -80,7 +80,7 @@ func (c *ApiController) GetUsers() {
|
||||
// @Title GetUser
|
||||
// @Tag User API
|
||||
// @Description get user
|
||||
// @Param id query string true "The id of the user"
|
||||
// @Param id query string true "The id ( owner/name ) of the user"
|
||||
// @Param owner query string false "The owner of the user"
|
||||
// @Param email query string false "The email of the user"
|
||||
// @Param phone query string false "The phone of the user"
|
||||
@ -129,7 +129,7 @@ func (c *ApiController) GetUser() {
|
||||
// @Title UpdateUser
|
||||
// @Tag User API
|
||||
// @Description update user
|
||||
// @Param id query string true "The id of the user"
|
||||
// @Param id query string true "The id ( owner/name ) of the user"
|
||||
// @Param body body object.User true "The details of the user"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /update-user [post]
|
||||
|
@ -52,7 +52,7 @@ func (c *ApiController) GetWebhooks() {
|
||||
// @Title GetWebhook
|
||||
// @Tag Webhook API
|
||||
// @Description get webhook
|
||||
// @Param id query string true "The id of the webhook"
|
||||
// @Param id query string true "The id ( owner/name ) of the webhook"
|
||||
// @Success 200 {object} object.Webhook The Response object
|
||||
// @router /get-webhook [get]
|
||||
func (c *ApiController) GetWebhook() {
|
||||
@ -66,7 +66,7 @@ func (c *ApiController) GetWebhook() {
|
||||
// @Title UpdateWebhook
|
||||
// @Tag Webhook API
|
||||
// @Description update webhook
|
||||
// @Param id query string true "The id of the webhook"
|
||||
// @Param id query string true "The id ( owner/name ) of the webhook"
|
||||
// @Param body body object.Webhook true "The details of the webhook"
|
||||
// @Success 200 {object} controllers.Response The Response object
|
||||
// @router /update-webhook [post]
|
||||
|
@ -28,7 +28,6 @@ import (
|
||||
_ "modernc.org/sqlite" // db = sqlite
|
||||
"xorm.io/core"
|
||||
"xorm.io/xorm"
|
||||
"xorm.io/xorm/migrate"
|
||||
)
|
||||
|
||||
var adapter *Adapter
|
||||
@ -42,7 +41,7 @@ func InitConfig() {
|
||||
beego.BConfig.WebConfig.Session.SessionOn = true
|
||||
|
||||
InitAdapter(true)
|
||||
initMigrations()
|
||||
MigrateDatabase()
|
||||
}
|
||||
|
||||
func InitAdapter(createDatabase bool) {
|
||||
@ -252,22 +251,3 @@ func GetSession(owner string, offset, limit int, field, value, sortField, sortOr
|
||||
}
|
||||
return session
|
||||
}
|
||||
|
||||
func initMigrations() {
|
||||
migrations := []*migrate.Migration{
|
||||
{
|
||||
ID: "20221015CasbinRule--fill ptype field with p",
|
||||
Migrate: func(tx *xorm.Engine) error {
|
||||
_, err := tx.Cols("ptype").Update(&xormadapter.CasbinRule{
|
||||
Ptype: "p",
|
||||
})
|
||||
return err
|
||||
},
|
||||
Rollback: func(tx *xorm.Engine) error {
|
||||
return tx.DropTables(&xormadapter.CasbinRule{})
|
||||
},
|
||||
},
|
||||
}
|
||||
m := migrate.New(adapter.Engine, migrate.DefaultOptions, migrations)
|
||||
m.Migrate()
|
||||
}
|
||||
|
@ -25,8 +25,6 @@ import (
|
||||
)
|
||||
|
||||
func InitDb() {
|
||||
MigratePermissionRule()
|
||||
|
||||
existed := initBuiltInOrganization()
|
||||
if !existed {
|
||||
initBuiltInModel()
|
||||
@ -36,6 +34,8 @@ func InitDb() {
|
||||
initBuiltInApplication()
|
||||
initBuiltInCert()
|
||||
initBuiltInLdap()
|
||||
} else {
|
||||
MigrateDatabase()
|
||||
}
|
||||
|
||||
initWebAuthn()
|
||||
|
85
object/migrate.go
Normal file
85
object/migrate.go
Normal file
@ -0,0 +1,85 @@
|
||||
// Copyright 2023 The Casdoor Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.package object
|
||||
|
||||
package object
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
xormadapter "github.com/casbin/xorm-adapter/v3"
|
||||
"xorm.io/xorm"
|
||||
"xorm.io/xorm/migrate"
|
||||
)
|
||||
|
||||
func MigrateDatabase() {
|
||||
migrations := []*migrate.Migration{
|
||||
MigrateCasbinRule(),
|
||||
MigratePermissionRule(),
|
||||
}
|
||||
|
||||
m := migrate.New(adapter.Engine, migrate.DefaultOptions, migrations)
|
||||
m.Migrate()
|
||||
}
|
||||
|
||||
func MigrateCasbinRule() *migrate.Migration {
|
||||
migration := migrate.Migration{
|
||||
ID: "20221015CasbinRule--fill ptype field with p",
|
||||
Migrate: func(engine *xorm.Engine) error {
|
||||
_, err := engine.Cols("ptype").Update(&xormadapter.CasbinRule{
|
||||
Ptype: "p",
|
||||
})
|
||||
return err
|
||||
},
|
||||
Rollback: func(engine *xorm.Engine) error {
|
||||
return engine.DropTables(&xormadapter.CasbinRule{})
|
||||
},
|
||||
}
|
||||
|
||||
return &migration
|
||||
}
|
||||
|
||||
func MigratePermissionRule() *migrate.Migration {
|
||||
migration := migrate.Migration{
|
||||
ID: "20230209MigratePermissionRule--Use V5 instead of V1 to store permissionID",
|
||||
Migrate: func(engine *xorm.Engine) error {
|
||||
models := []*Model{}
|
||||
err := engine.Find(&models, &Model{})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
isHit := false
|
||||
for _, model := range models {
|
||||
if strings.Contains(model.ModelText, "permission") {
|
||||
// update model table
|
||||
model.ModelText = strings.Replace(model.ModelText, "permission,", "", -1)
|
||||
UpdateModel(model.GetId(), model)
|
||||
isHit = true
|
||||
}
|
||||
}
|
||||
|
||||
if isHit {
|
||||
// update permission_rule table
|
||||
sql := "UPDATE `permission_rule`SET V0 = V1, V1 = V2, V2 = V3, V3 = V4, V4 = V5 WHERE V0 IN (SELECT CONCAT(owner, '/', name) AS permission_id FROM `permission`)"
|
||||
_, err = engine.Exec(sql)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return err
|
||||
},
|
||||
}
|
||||
|
||||
return &migration
|
||||
}
|
@ -16,7 +16,6 @@ package object
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/casdoor/casdoor/util"
|
||||
"xorm.io/core"
|
||||
@ -269,33 +268,6 @@ func GetPermissionsBySubmitter(owner string, submitter string) []*Permission {
|
||||
return permissions
|
||||
}
|
||||
|
||||
func MigratePermissionRule() {
|
||||
models := []*Model{}
|
||||
err := adapter.Engine.Find(&models, &Model{})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
isHit := false
|
||||
for _, model := range models {
|
||||
if strings.Contains(model.ModelText, "permission") {
|
||||
// update model table
|
||||
model.ModelText = strings.Replace(model.ModelText, "permission,", "", -1)
|
||||
UpdateModel(model.GetId(), model)
|
||||
isHit = true
|
||||
}
|
||||
}
|
||||
|
||||
if isHit {
|
||||
// update permission_rule table
|
||||
sql := "UPDATE `permission_rule`SET V0 = V1, V1 = V2, V2 = V3, V3 = V4, V4 = V5 WHERE V0 IN (SELECT CONCAT(owner, '/', name) AS permission_id FROM `permission`)"
|
||||
_, err = adapter.Engine.Exec(sql)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func ContainsAsterisk(userId string, users []string) bool {
|
||||
containsAsterisk := false
|
||||
group, _ := util.GetOwnerAndNameFromId(userId)
|
||||
|
@ -23,7 +23,7 @@ import (
|
||||
|
||||
type Resource struct {
|
||||
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
|
||||
Name string `xorm:"varchar(100) notnull pk" json:"name"`
|
||||
Name string `xorm:"varchar(180) notnull pk" json:"name"`
|
||||
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
|
||||
|
||||
User string `xorm:"varchar(100)" json:"user"`
|
||||
|
@ -18,6 +18,7 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/casdoor/casdoor/conf"
|
||||
@ -54,6 +55,25 @@ func escapePath(path string) string {
|
||||
return res
|
||||
}
|
||||
|
||||
func GetTruncatedPath(provider *Provider, fullFilePath string, limit int) string {
|
||||
pathPrefix := util.UrlJoin(util.GetUrlPath(provider.Domain), provider.PathPrefix)
|
||||
|
||||
dir, file := filepath.Split(fullFilePath)
|
||||
ext := filepath.Ext(file)
|
||||
fileName := strings.TrimSuffix(file, ext)
|
||||
for {
|
||||
escapedString := escapePath(escapePath(fullFilePath))
|
||||
if len(escapedString) < limit-len(pathPrefix) {
|
||||
break
|
||||
}
|
||||
rs := []rune(fileName)
|
||||
fileName = string(rs[0 : len(rs)-1])
|
||||
fullFilePath = dir + fileName + ext
|
||||
}
|
||||
|
||||
return fullFilePath
|
||||
}
|
||||
|
||||
func GetUploadFileUrl(provider *Provider, fullFilePath string, hasTimestamp bool) (string, string) {
|
||||
escapedPath := util.UrlJoin(provider.PathPrefix, escapePath(fullFilePath))
|
||||
objectKey := util.UrlJoin(util.GetUrlPath(provider.Domain), escapedPath)
|
||||
@ -74,10 +94,15 @@ func GetUploadFileUrl(provider *Provider, fullFilePath string, hasTimestamp bool
|
||||
}
|
||||
|
||||
fileUrl := util.UrlJoin(host, escapePath(objectKey))
|
||||
|
||||
if hasTimestamp {
|
||||
fileUrl = fmt.Sprintf("%s?t=%s", fileUrl, util.GetCurrentUnixTime())
|
||||
}
|
||||
|
||||
if provider.Type == "Tencent Cloud COS" {
|
||||
objectKey = escapePath(objectKey)
|
||||
}
|
||||
|
||||
return fileUrl, objectKey
|
||||
}
|
||||
|
||||
|
@ -578,7 +578,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the product",
|
||||
"description": "The id ( owner/name ) of the product",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
@ -894,8 +894,8 @@
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "ID",
|
||||
"description": "The ID(owner/name) of user.",
|
||||
"name": "id",
|
||||
"description": "The id ( owner/name )(owner/name) of user.",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
@ -1107,7 +1107,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the application.",
|
||||
"description": "The id ( owner/name ) of the application.",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
@ -1162,7 +1162,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the cert",
|
||||
"description": "The id ( owner/name ) of the cert",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
@ -1340,7 +1340,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the model",
|
||||
"description": "The id ( owner/name ) of the model",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
@ -1479,7 +1479,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the payment",
|
||||
"description": "The id ( owner/name ) of the payment",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
@ -1534,7 +1534,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the permission",
|
||||
"description": "The id ( owner/name ) of the permission",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
@ -1589,7 +1589,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the role",
|
||||
"description": "The id ( owner/name ) of the role",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
@ -1638,7 +1638,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the product",
|
||||
"description": "The id ( owner/name ) of the product",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
@ -1693,7 +1693,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the provider",
|
||||
"description": "The id ( owner/name ) of the provider",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
@ -1840,7 +1840,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the role",
|
||||
"description": "The id ( owner/name ) of the role",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
@ -1966,7 +1966,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the syncer",
|
||||
"description": "The id ( owner/name ) of the syncer",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
@ -2021,7 +2021,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the user",
|
||||
"description": "The id ( owner/name ) of the user",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
@ -2047,7 +2047,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of token",
|
||||
"description": "The id ( owner/name ) of token",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
@ -2116,7 +2116,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the user",
|
||||
"description": "The id ( owner/name ) of the user",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
@ -2160,7 +2160,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the user",
|
||||
"description": "The id ( owner/name ) of the user",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
@ -2286,7 +2286,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the webhook",
|
||||
"description": "The id ( owner/name ) of the webhook",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
@ -2341,7 +2341,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the payment",
|
||||
"description": "The id ( owner/name ) of the payment",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
@ -2504,8 +2504,8 @@
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "user_id",
|
||||
"description": "The id of user",
|
||||
"name": "id",
|
||||
"description": "The id ( owner/name ) of user",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
@ -2904,7 +2904,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the application",
|
||||
"description": "The id ( owner/name ) of the application",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
@ -2939,7 +2939,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the cert",
|
||||
"description": "The id ( owner/name ) of the cert",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
@ -2982,7 +2982,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the model",
|
||||
"description": "The id ( owner/name ) of the model",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
@ -3017,7 +3017,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the organization",
|
||||
"description": "The id ( owner/name ) of the organization",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
@ -3052,7 +3052,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the payment",
|
||||
"description": "The id ( owner/name ) of the payment",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
@ -3087,7 +3087,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the permission",
|
||||
"description": "The id ( owner/name ) of the permission",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
@ -3122,7 +3122,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the product",
|
||||
"description": "The id ( owner/name ) of the product",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
@ -3157,7 +3157,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the provider",
|
||||
"description": "The id ( owner/name ) of the provider",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
@ -3200,7 +3200,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the role",
|
||||
"description": "The id ( owner/name ) of the role",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
@ -3235,7 +3235,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the syncer",
|
||||
"description": "The id ( owner/name ) of the syncer",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
@ -3270,7 +3270,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of token",
|
||||
"description": "The id ( owner/name ) of token",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
@ -3305,7 +3305,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the user",
|
||||
"description": "The id ( owner/name ) of the user",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
@ -3340,7 +3340,7 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "id",
|
||||
"description": "The id of the webhook",
|
||||
"description": "The id ( owner/name ) of the webhook",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
@ -3505,11 +3505,11 @@
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"2268.0xc0000f9650.false": {
|
||||
"2346.0xc0001ce990.false": {
|
||||
"title": "false",
|
||||
"type": "object"
|
||||
},
|
||||
"2302.0xc0000f9680.false": {
|
||||
"2381.0xc0001ce9c0.false": {
|
||||
"title": "false",
|
||||
"type": "object"
|
||||
},
|
||||
@ -3636,10 +3636,10 @@
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"$ref": "#/definitions/2268.0xc0000f9650.false"
|
||||
"$ref": "#/definitions/2346.0xc0001ce990.false"
|
||||
},
|
||||
"data2": {
|
||||
"$ref": "#/definitions/2302.0xc0000f9680.false"
|
||||
"$ref": "#/definitions/2381.0xc0001ce9c0.false"
|
||||
},
|
||||
"msg": {
|
||||
"type": "string"
|
||||
@ -3846,6 +3846,9 @@
|
||||
"termsOfUse": {
|
||||
"type": "string"
|
||||
},
|
||||
"themeData": {
|
||||
"$ref": "#/definitions/object.ThemeData"
|
||||
},
|
||||
"tokenFormat": {
|
||||
"type": "string"
|
||||
}
|
||||
@ -4143,6 +4146,9 @@
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"themeData": {
|
||||
"$ref": "#/definitions/object.ThemeData"
|
||||
},
|
||||
"websiteUrl": {
|
||||
"type": "string"
|
||||
}
|
||||
@ -4727,6 +4733,28 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"object.ThemeData": {
|
||||
"title": "ThemeData",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"borderRadius": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"colorPrimary": {
|
||||
"type": "string"
|
||||
},
|
||||
"isCompact": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"isEnabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"themeType": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"object.Token": {
|
||||
"title": "Token",
|
||||
"type": "object",
|
||||
@ -4836,9 +4864,15 @@
|
||||
"alipay": {
|
||||
"type": "string"
|
||||
},
|
||||
"amazon": {
|
||||
"type": "string"
|
||||
},
|
||||
"apple": {
|
||||
"type": "string"
|
||||
},
|
||||
"auth0": {
|
||||
"type": "string"
|
||||
},
|
||||
"avatar": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -4848,6 +4882,9 @@
|
||||
"baidu": {
|
||||
"type": "string"
|
||||
},
|
||||
"battlenet": {
|
||||
"type": "string"
|
||||
},
|
||||
"bilibili": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -4857,9 +4894,18 @@
|
||||
"birthday": {
|
||||
"type": "string"
|
||||
},
|
||||
"bitbucket": {
|
||||
"type": "string"
|
||||
},
|
||||
"box": {
|
||||
"type": "string"
|
||||
},
|
||||
"casdoor": {
|
||||
"type": "string"
|
||||
},
|
||||
"cloudfoundry": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdIp": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -4869,15 +4915,30 @@
|
||||
"custom": {
|
||||
"type": "string"
|
||||
},
|
||||
"dailymotion": {
|
||||
"type": "string"
|
||||
},
|
||||
"deezer": {
|
||||
"type": "string"
|
||||
},
|
||||
"digitalocean": {
|
||||
"type": "string"
|
||||
},
|
||||
"dingtalk": {
|
||||
"type": "string"
|
||||
},
|
||||
"discord": {
|
||||
"type": "string"
|
||||
},
|
||||
"displayName": {
|
||||
"type": "string"
|
||||
},
|
||||
"douyin": {
|
||||
"type": "string"
|
||||
},
|
||||
"dropbox": {
|
||||
"type": "string"
|
||||
},
|
||||
"education": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -4887,15 +4948,24 @@
|
||||
"emailVerified": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"eveonline": {
|
||||
"type": "string"
|
||||
},
|
||||
"facebook": {
|
||||
"type": "string"
|
||||
},
|
||||
"firstName": {
|
||||
"type": "string"
|
||||
},
|
||||
"fitbit": {
|
||||
"type": "string"
|
||||
},
|
||||
"gender": {
|
||||
"type": "string"
|
||||
},
|
||||
"gitea": {
|
||||
"type": "string"
|
||||
},
|
||||
"gitee": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -4911,6 +4981,9 @@
|
||||
"hash": {
|
||||
"type": "string"
|
||||
},
|
||||
"heroku": {
|
||||
"type": "string"
|
||||
},
|
||||
"homepage": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -4923,9 +4996,18 @@
|
||||
"idCardType": {
|
||||
"type": "string"
|
||||
},
|
||||
"influxcloud": {
|
||||
"type": "string"
|
||||
},
|
||||
"infoflow": {
|
||||
"type": "string"
|
||||
},
|
||||
"instagram": {
|
||||
"type": "string"
|
||||
},
|
||||
"intercom": {
|
||||
"type": "string"
|
||||
},
|
||||
"isAdmin": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@ -4944,6 +5026,9 @@
|
||||
"isOnline": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"kakao": {
|
||||
"type": "string"
|
||||
},
|
||||
"karma": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
@ -4966,6 +5051,9 @@
|
||||
"lastSigninWrongTime": {
|
||||
"type": "string"
|
||||
},
|
||||
"lastfm": {
|
||||
"type": "string"
|
||||
},
|
||||
"ldap": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -4978,18 +5066,39 @@
|
||||
"location": {
|
||||
"type": "string"
|
||||
},
|
||||
"mailru": {
|
||||
"type": "string"
|
||||
},
|
||||
"managedAccounts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/object.ManagedAccount"
|
||||
}
|
||||
},
|
||||
"meetup": {
|
||||
"type": "string"
|
||||
},
|
||||
"microsoftonline": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"naver": {
|
||||
"type": "string"
|
||||
},
|
||||
"nextcloud": {
|
||||
"type": "string"
|
||||
},
|
||||
"okta": {
|
||||
"type": "string"
|
||||
},
|
||||
"onedrive": {
|
||||
"type": "string"
|
||||
},
|
||||
"oura": {
|
||||
"type": "string"
|
||||
},
|
||||
"owner": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -4999,6 +5108,12 @@
|
||||
"passwordSalt": {
|
||||
"type": "string"
|
||||
},
|
||||
"patreon": {
|
||||
"type": "string"
|
||||
},
|
||||
"paypal": {
|
||||
"type": "string"
|
||||
},
|
||||
"permanentAvatar": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -5035,10 +5150,16 @@
|
||||
"$ref": "#/definitions/object.Role"
|
||||
}
|
||||
},
|
||||
"salesforce": {
|
||||
"type": "string"
|
||||
},
|
||||
"score": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"shopify": {
|
||||
"type": "string"
|
||||
},
|
||||
"signinWrongTimes": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
@ -5049,21 +5170,54 @@
|
||||
"slack": {
|
||||
"type": "string"
|
||||
},
|
||||
"soundcloud": {
|
||||
"type": "string"
|
||||
},
|
||||
"spotify": {
|
||||
"type": "string"
|
||||
},
|
||||
"steam": {
|
||||
"type": "string"
|
||||
},
|
||||
"strava": {
|
||||
"type": "string"
|
||||
},
|
||||
"stripe": {
|
||||
"type": "string"
|
||||
},
|
||||
"tag": {
|
||||
"type": "string"
|
||||
},
|
||||
"tiktok": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"tumblr": {
|
||||
"type": "string"
|
||||
},
|
||||
"twitch": {
|
||||
"type": "string"
|
||||
},
|
||||
"twitter": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
},
|
||||
"typetalk": {
|
||||
"type": "string"
|
||||
},
|
||||
"uber": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedTime": {
|
||||
"type": "string"
|
||||
},
|
||||
"vk": {
|
||||
"type": "string"
|
||||
},
|
||||
"webauthnCredentials": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
@ -5078,6 +5232,24 @@
|
||||
},
|
||||
"weibo": {
|
||||
"type": "string"
|
||||
},
|
||||
"wepay": {
|
||||
"type": "string"
|
||||
},
|
||||
"xero": {
|
||||
"type": "string"
|
||||
},
|
||||
"yahoo": {
|
||||
"type": "string"
|
||||
},
|
||||
"yammer": {
|
||||
"type": "string"
|
||||
},
|
||||
"yandex": {
|
||||
"type": "string"
|
||||
},
|
||||
"zoom": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -375,7 +375,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the product
|
||||
description: The id ( owner/name ) of the product
|
||||
required: true
|
||||
type: string
|
||||
- in: query
|
||||
@ -578,8 +578,8 @@ paths:
|
||||
operationId: ApiController.DeleteSession
|
||||
parameters:
|
||||
- in: query
|
||||
name: ID
|
||||
description: The ID(owner/name) of user.
|
||||
name: id
|
||||
description: The id ( owner/name )(owner/name) of user.
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
@ -718,7 +718,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the application.
|
||||
description: The id ( owner/name ) of the application.
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
@ -754,7 +754,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the cert
|
||||
description: The id ( owner/name ) of the cert
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
@ -870,7 +870,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the model
|
||||
description: The id ( owner/name ) of the model
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
@ -961,7 +961,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the payment
|
||||
description: The id ( owner/name ) of the payment
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
@ -997,7 +997,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the permission
|
||||
description: The id ( owner/name ) of the permission
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
@ -1033,7 +1033,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the role
|
||||
description: The id ( owner/name ) of the role
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
@ -1065,7 +1065,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the product
|
||||
description: The id ( owner/name ) of the product
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
@ -1101,7 +1101,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the provider
|
||||
description: The id ( owner/name ) of the provider
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
@ -1197,7 +1197,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the role
|
||||
description: The id ( owner/name ) of the role
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
@ -1280,7 +1280,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the syncer
|
||||
description: The id ( owner/name ) of the syncer
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
@ -1316,7 +1316,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the user
|
||||
description: The id ( owner/name ) of the user
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
@ -1333,7 +1333,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of token
|
||||
description: The id ( owner/name ) of token
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
@ -1379,7 +1379,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the user
|
||||
description: The id ( owner/name ) of the user
|
||||
required: true
|
||||
type: string
|
||||
- in: query
|
||||
@ -1408,7 +1408,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the user
|
||||
description: The id ( owner/name ) of the user
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
@ -1491,7 +1491,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the webhook
|
||||
description: The id ( owner/name ) of the webhook
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
@ -1527,7 +1527,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the payment
|
||||
description: The id ( owner/name ) of the payment
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
@ -1636,8 +1636,8 @@ paths:
|
||||
operationId: ApiController.GetOAuthCode
|
||||
parameters:
|
||||
- in: query
|
||||
name: user_id
|
||||
description: The id of user
|
||||
name: id
|
||||
description: The id ( owner/name ) of user
|
||||
required: true
|
||||
type: string
|
||||
- in: query
|
||||
@ -1902,7 +1902,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the application
|
||||
description: The id ( owner/name ) of the application
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
@ -1925,7 +1925,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the cert
|
||||
description: The id ( owner/name ) of the cert
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
@ -1953,7 +1953,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the model
|
||||
description: The id ( owner/name ) of the model
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
@ -1976,7 +1976,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the organization
|
||||
description: The id ( owner/name ) of the organization
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
@ -1999,7 +1999,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the payment
|
||||
description: The id ( owner/name ) of the payment
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
@ -2022,7 +2022,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the permission
|
||||
description: The id ( owner/name ) of the permission
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
@ -2045,7 +2045,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the product
|
||||
description: The id ( owner/name ) of the product
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
@ -2068,7 +2068,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the provider
|
||||
description: The id ( owner/name ) of the provider
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
@ -2096,7 +2096,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the role
|
||||
description: The id ( owner/name ) of the role
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
@ -2119,7 +2119,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the syncer
|
||||
description: The id ( owner/name ) of the syncer
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
@ -2142,7 +2142,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of token
|
||||
description: The id ( owner/name ) of token
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
@ -2165,7 +2165,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the user
|
||||
description: The id ( owner/name ) of the user
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
@ -2188,7 +2188,7 @@ paths:
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id of the webhook
|
||||
description: The id ( owner/name ) of the webhook
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
@ -2293,10 +2293,10 @@ paths:
|
||||
schema:
|
||||
$ref: '#/definitions/Response'
|
||||
definitions:
|
||||
2268.0xc0000f9650.false:
|
||||
2346.0xc0001ce990.false:
|
||||
title: "false"
|
||||
type: object
|
||||
2302.0xc0000f9680.false:
|
||||
2381.0xc0001ce9c0.false:
|
||||
title: "false"
|
||||
type: object
|
||||
Response:
|
||||
@ -2383,9 +2383,9 @@ definitions:
|
||||
type: object
|
||||
properties:
|
||||
data:
|
||||
$ref: '#/definitions/2268.0xc0000f9650.false'
|
||||
$ref: '#/definitions/2346.0xc0001ce990.false'
|
||||
data2:
|
||||
$ref: '#/definitions/2302.0xc0000f9680.false'
|
||||
$ref: '#/definitions/2381.0xc0001ce9c0.false'
|
||||
msg:
|
||||
type: string
|
||||
name:
|
||||
@ -2524,6 +2524,8 @@ definitions:
|
||||
type: string
|
||||
termsOfUse:
|
||||
type: string
|
||||
themeData:
|
||||
$ref: '#/definitions/object.ThemeData'
|
||||
tokenFormat:
|
||||
type: string
|
||||
object.Cert:
|
||||
@ -2724,6 +2726,8 @@ definitions:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
themeData:
|
||||
$ref: '#/definitions/object.ThemeData'
|
||||
websiteUrl:
|
||||
type: string
|
||||
object.Payment:
|
||||
@ -3115,6 +3119,21 @@ definitions:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
object.ThemeData:
|
||||
title: ThemeData
|
||||
type: object
|
||||
properties:
|
||||
borderRadius:
|
||||
type: integer
|
||||
format: int64
|
||||
colorPrimary:
|
||||
type: string
|
||||
isCompact:
|
||||
type: boolean
|
||||
isEnabled:
|
||||
type: boolean
|
||||
themeType:
|
||||
type: string
|
||||
object.Token:
|
||||
title: Token
|
||||
type: object
|
||||
@ -3190,46 +3209,74 @@ definitions:
|
||||
type: string
|
||||
alipay:
|
||||
type: string
|
||||
amazon:
|
||||
type: string
|
||||
apple:
|
||||
type: string
|
||||
auth0:
|
||||
type: string
|
||||
avatar:
|
||||
type: string
|
||||
azuread:
|
||||
type: string
|
||||
baidu:
|
||||
type: string
|
||||
battlenet:
|
||||
type: string
|
||||
bilibili:
|
||||
type: string
|
||||
bio:
|
||||
type: string
|
||||
birthday:
|
||||
type: string
|
||||
bitbucket:
|
||||
type: string
|
||||
box:
|
||||
type: string
|
||||
casdoor:
|
||||
type: string
|
||||
cloudfoundry:
|
||||
type: string
|
||||
createdIp:
|
||||
type: string
|
||||
createdTime:
|
||||
type: string
|
||||
custom:
|
||||
type: string
|
||||
dailymotion:
|
||||
type: string
|
||||
deezer:
|
||||
type: string
|
||||
digitalocean:
|
||||
type: string
|
||||
dingtalk:
|
||||
type: string
|
||||
discord:
|
||||
type: string
|
||||
displayName:
|
||||
type: string
|
||||
douyin:
|
||||
type: string
|
||||
dropbox:
|
||||
type: string
|
||||
education:
|
||||
type: string
|
||||
email:
|
||||
type: string
|
||||
emailVerified:
|
||||
type: boolean
|
||||
eveonline:
|
||||
type: string
|
||||
facebook:
|
||||
type: string
|
||||
firstName:
|
||||
type: string
|
||||
fitbit:
|
||||
type: string
|
||||
gender:
|
||||
type: string
|
||||
gitea:
|
||||
type: string
|
||||
gitee:
|
||||
type: string
|
||||
github:
|
||||
@ -3240,6 +3287,8 @@ definitions:
|
||||
type: string
|
||||
hash:
|
||||
type: string
|
||||
heroku:
|
||||
type: string
|
||||
homepage:
|
||||
type: string
|
||||
id:
|
||||
@ -3248,8 +3297,14 @@ definitions:
|
||||
type: string
|
||||
idCardType:
|
||||
type: string
|
||||
influxcloud:
|
||||
type: string
|
||||
infoflow:
|
||||
type: string
|
||||
instagram:
|
||||
type: string
|
||||
intercom:
|
||||
type: string
|
||||
isAdmin:
|
||||
type: boolean
|
||||
isDefaultAvatar:
|
||||
@ -3262,6 +3317,8 @@ definitions:
|
||||
type: boolean
|
||||
isOnline:
|
||||
type: boolean
|
||||
kakao:
|
||||
type: string
|
||||
karma:
|
||||
type: integer
|
||||
format: int64
|
||||
@ -3277,6 +3334,8 @@ definitions:
|
||||
type: string
|
||||
lastSigninWrongTime:
|
||||
type: string
|
||||
lastfm:
|
||||
type: string
|
||||
ldap:
|
||||
type: string
|
||||
line:
|
||||
@ -3285,20 +3344,38 @@ definitions:
|
||||
type: string
|
||||
location:
|
||||
type: string
|
||||
mailru:
|
||||
type: string
|
||||
managedAccounts:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.ManagedAccount'
|
||||
meetup:
|
||||
type: string
|
||||
microsoftonline:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
naver:
|
||||
type: string
|
||||
nextcloud:
|
||||
type: string
|
||||
okta:
|
||||
type: string
|
||||
onedrive:
|
||||
type: string
|
||||
oura:
|
||||
type: string
|
||||
owner:
|
||||
type: string
|
||||
password:
|
||||
type: string
|
||||
passwordSalt:
|
||||
type: string
|
||||
patreon:
|
||||
type: string
|
||||
paypal:
|
||||
type: string
|
||||
permanentAvatar:
|
||||
type: string
|
||||
permissions:
|
||||
@ -3323,9 +3400,13 @@ definitions:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.Role'
|
||||
salesforce:
|
||||
type: string
|
||||
score:
|
||||
type: integer
|
||||
format: int64
|
||||
shopify:
|
||||
type: string
|
||||
signinWrongTimes:
|
||||
type: integer
|
||||
format: int64
|
||||
@ -3333,16 +3414,38 @@ definitions:
|
||||
type: string
|
||||
slack:
|
||||
type: string
|
||||
soundcloud:
|
||||
type: string
|
||||
spotify:
|
||||
type: string
|
||||
steam:
|
||||
type: string
|
||||
strava:
|
||||
type: string
|
||||
stripe:
|
||||
type: string
|
||||
tag:
|
||||
type: string
|
||||
tiktok:
|
||||
type: string
|
||||
title:
|
||||
type: string
|
||||
tumblr:
|
||||
type: string
|
||||
twitch:
|
||||
type: string
|
||||
twitter:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
typetalk:
|
||||
type: string
|
||||
uber:
|
||||
type: string
|
||||
updatedTime:
|
||||
type: string
|
||||
vk:
|
||||
type: string
|
||||
webauthnCredentials:
|
||||
type: array
|
||||
items:
|
||||
@ -3353,6 +3456,18 @@ definitions:
|
||||
type: string
|
||||
weibo:
|
||||
type: string
|
||||
wepay:
|
||||
type: string
|
||||
xero:
|
||||
type: string
|
||||
yahoo:
|
||||
type: string
|
||||
yammer:
|
||||
type: string
|
||||
yandex:
|
||||
type: string
|
||||
zoom:
|
||||
type: string
|
||||
object.Userinfo:
|
||||
title: Userinfo
|
||||
type: object
|
||||
|
@ -554,6 +554,13 @@ class App extends Component {
|
||||
};
|
||||
|
||||
renderContent() {
|
||||
const onClick = ({key}) => {
|
||||
if (key === "/swagger") {
|
||||
window.open(Setting.isLocalhost() ? `${Setting.ServerUrl}/swagger` : "/swagger", "_blank");
|
||||
} else {
|
||||
this.props.history.push(key);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<Layout id="parent-area">
|
||||
{/* https://github.com/ant-design/ant-design/issues/40394 ant design bug. If it will be fixed, we can delete the code for control the color of Header*/}
|
||||
@ -580,6 +587,7 @@ class App extends Component {
|
||||
</Button>
|
||||
</React.Fragment> :
|
||||
<Menu
|
||||
onClick={onClick}
|
||||
items={this.getMenuItems()}
|
||||
mode={"horizontal"}
|
||||
selectedKeys={[this.state.selectedMenuKey]}
|
||||
|
@ -141,6 +141,8 @@ class ProviderListPage extends BaseListPage {
|
||||
{text: "SMS", value: "SMS"},
|
||||
{text: "Storage", value: "Storage"},
|
||||
{text: "SAML", value: "SAML"},
|
||||
{text: "Captcha", value: "Captcha"},
|
||||
{text: "Payment", value: "Payment"},
|
||||
],
|
||||
width: "110px",
|
||||
sorter: true,
|
||||
@ -159,6 +161,7 @@ class ProviderListPage extends BaseListPage {
|
||||
{text: "Storage", value: "Storage", children: Setting.getProviderTypeOptions("Storage").map((o) => {return {text: o.id, value: o.name};})},
|
||||
{text: "SAML", value: "SAML", children: Setting.getProviderTypeOptions("SAML").map((o) => {return {text: o.id, value: o.name};})},
|
||||
{text: "Captcha", value: "Captcha", children: Setting.getProviderTypeOptions("Captcha").map((o) => {return {text: o.id, value: o.name};})},
|
||||
{text: "Payment", value: "Payment", children: Setting.getProviderTypeOptions("Payment").map((o) => {return {text: o.id, value: o.name};})},
|
||||
],
|
||||
sorter: true,
|
||||
render: (text, record, index) => {
|
||||
|
@ -114,7 +114,11 @@ export const OtherProviderInfo = {
|
||||
},
|
||||
Email: {
|
||||
"Default": {
|
||||
logo: `${StaticBaseUrl}/img/social_default.png`,
|
||||
logo: `${StaticBaseUrl}/img/email_default.png`,
|
||||
url: "",
|
||||
},
|
||||
"SUBMAIL": {
|
||||
logo: `${StaticBaseUrl}/img/social_submail.png`,
|
||||
url: "",
|
||||
},
|
||||
},
|
||||
@ -174,7 +178,7 @@ export const OtherProviderInfo = {
|
||||
},
|
||||
Captcha: {
|
||||
"Default": {
|
||||
logo: `${StaticBaseUrl}/img/social_default.png`,
|
||||
logo: `${StaticBaseUrl}/img/captcha_default.png`,
|
||||
url: "https://pkg.go.dev/github.com/dchest/captcha",
|
||||
},
|
||||
"reCAPTCHA": {
|
||||
|
Reference in New Issue
Block a user