aboutsummaryrefslogtreecommitdiffstats
path: root/services/forms
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2021-08-21 04:16:45 +0200
committerGitHub <noreply@github.com>2021-08-20 22:16:45 -0400
commit0bd58d61e547f482dd3c38a30fccb4c58caf2a67 (patch)
treefbc87f7c8d550db4d54fe930f98d92db0e4b901d /services/forms
parente9747de95242807a6319e146216575676de66f47 (diff)
downloadgitea-0bd58d61e547f482dd3c38a30fccb4c58caf2a67.tar.gz
gitea-0bd58d61e547f482dd3c38a30fccb4c58caf2a67.zip
Added introspection endpoint. (#16752)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'services/forms')
-rw-r--r--services/forms/user_form.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/services/forms/user_form.go b/services/forms/user_form.go
index 1e12795c70..7d6b976936 100644
--- a/services/forms/user_form.go
+++ b/services/forms/user_form.go
@@ -215,6 +215,17 @@ func (f *AccessTokenForm) Validate(req *http.Request, errs binding.Errors) bindi
return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
}
+// IntrospectTokenForm for introspecting tokens
+type IntrospectTokenForm struct {
+ Token string `json:"token"`
+}
+
+// Validate validates the fields
+func (f *IntrospectTokenForm) Validate(req *http.Request, errs binding.Errors) binding.Errors {
+ ctx := context.GetContext(req)
+ return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
+}
+
// __________________________________________.___ _______ ________ _________
// / _____/\_ _____/\__ ___/\__ ___/| |\ \ / _____/ / _____/
// \_____ \ | __)_ | | | | | |/ | \/ \ ___ \_____ \