From d1a78075aeab3f74087a920251be4e512c325591 Mon Sep 17 00:00:00 2001 From: Jian Zhu <36154065+zhujian7@users.noreply.github.com> Date: Wed, 27 Feb 2019 15:51:34 +0800 Subject: [PATCH] chore: add authType field in SCMSource (#800) --- pkg/server/apis/v1alpha1/types.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/server/apis/v1alpha1/types.go b/pkg/server/apis/v1alpha1/types.go index ba6952dde..4de49c2f0 100644 --- a/pkg/server/apis/v1alpha1/types.go +++ b/pkg/server/apis/v1alpha1/types.go @@ -141,8 +141,20 @@ type SCMSource struct { Password string `json:"password"` // Token is the credential to access SCM. Token string `json:"token"` + // AuthType is the type of auth way, can be Token or Password + AuthType SCMAuthType `json:"authType"` } +// SCMAuthType represents the type of SCM auth, support password and token. +type SCMAuthType string + +const ( + // AuthTypePassword represents using password to auth + AuthTypePassword SCMAuthType = "Password" + // AuthTypeToken represents using token to auth + AuthTypeToken = "Token" +) + // ClusterSource contains info about clusters. type ClusterSource struct { // Credential is the credential info of the cluster