auth

package
v0.6.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2015 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignForm

func AssignForm(form interface{}, data map[string]interface{})

AssignForm assign form values back to the template data.

func GetMaxSize added in v0.5.0

func GetMaxSize(field reflect.StructField) string

func GetMinSize added in v0.5.0

func GetMinSize(field reflect.StructField) string

func GetSize added in v0.6.3

func GetSize(field reflect.StructField) string

func IsAPIPath added in v0.6.3

func IsAPIPath(url string) bool

func SignedInID added in v0.6.9

func SignedInID(ctx *macaron.Context, sess session.Store) int64

SignedInID returns the id of signed in user.

func SignedInUser

func SignedInUser(ctx *macaron.Context, sess session.Store) (*models.User, bool)

SignedInUser returns the user object of signed user. It returns a bool value to indicate whether user uses basic auth or not.

Types

type AddEmailForm added in v0.5.11

type AddEmailForm struct {
	Email string `binding:"Required;Email;MaxSize(254)"`
}

func (*AddEmailForm) Validate added in v0.5.11

func (f *AddEmailForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type AddSSHKeyForm

type AddSSHKeyForm struct {
	Title   string `binding:"Required;MaxSize(50)"`
	Content string `binding:"Required"`
}

func (*AddSSHKeyForm) Validate

func (f *AddSSHKeyForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type AdminCrateUserForm added in v0.6.15

type AdminCrateUserForm struct {
	LoginType  string `binding:"Required"`
	LoginName  string
	UserName   string `binding:"Required;AlphaDashDot;MaxSize(35)"`
	Email      string `binding:"Required;Email;MaxSize(254)"`
	Password   string `binding:"MaxSize(255)"`
	SendNotify bool
}

func (*AdminCrateUserForm) Validate added in v0.6.15

func (f *AdminCrateUserForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type AdminEditUserForm

type AdminEditUserForm struct {
	LoginType    string `binding:"Required"`
	LoginName    string
	FullName     string `binding:"MaxSize(100)"`
	Email        string `binding:"Required;Email;MaxSize(254)"`
	Password     string `binding:"MaxSize(255)"`
	Website      string `binding:"MaxSize(50)"`
	Location     string `binding:"MaxSize(50)"`
	Active       bool
	Admin        bool
	AllowGitHook bool
}

func (*AdminEditUserForm) Validate

func (f *AdminEditUserForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type AuthenticationForm added in v0.4.0

type AuthenticationForm struct {
	ID               int64
	Type             int    `binding:"Range(2,5)"`
	Name             string `binding:"Required;MaxSize(30)"`
	Host             string
	Port             int
	BindDN           string
	BindPassword     string
	UserBase         string
	UserDN           string `form:"user_dn"`
	AttributeName    string
	AttributeSurname string
	AttributeMail    string
	Filter           string
	AdminFilter      string
	IsActive         bool
	SMTPAuth         string
	SMTPHost         string
	SMTPPort         int
	AllowedDomains   string
	TLS              bool
	SkipVerify       bool
	PAMServiceName   string `form:"pam_service_name"`
}

func (*AuthenticationForm) Validate added in v0.4.0

func (f *AuthenticationForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type ChangePasswordForm added in v0.5.0

type ChangePasswordForm struct {
	OldPassword string `form:"old_password" binding:"Required;MinSize(1);MaxSize(255)"`
	Password    string `form:"password" binding:"Required;MaxSize(255)"`
	Retype      string `form:"retype"`
}

func (*ChangePasswordForm) Validate added in v0.5.0

func (f *ChangePasswordForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type CreateCommentForm added in v0.6.5

type CreateCommentForm struct {
	Content     string
	Status      string `binding:"OmitEmpty;In(reopen,close)"`
	Attachments []string
}

func (*CreateCommentForm) Validate added in v0.6.5

func (f *CreateCommentForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type CreateIssueForm

type CreateIssueForm struct {
	Title       string `binding:"Required;MaxSize(255)"`
	LabelIDs    string `form:"label_ids"`
	MilestoneID int64
	AssigneeID  int64
	Content     string
	Attachments []string
}

func (*CreateIssueForm) Validate

func (f *CreateIssueForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type CreateLabelForm added in v0.4.0

type CreateLabelForm struct {
	ID    int64
	Title string `binding:"Required;MaxSize(50)" locale:"repo.issues.label_name"`
	Color string `binding:"Required;Size(7)" locale:"repo.issues.label_color"`
}

func (*CreateLabelForm) Validate added in v0.4.0

func (f *CreateLabelForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type CreateMilestoneForm added in v0.4.0

type CreateMilestoneForm struct {
	Title    string `binding:"Required;MaxSize(50)"`
	Content  string
	Deadline string
}

func (*CreateMilestoneForm) Validate added in v0.4.0

type CreateOrgForm added in v0.5.0

type CreateOrgForm struct {
	OrgName string `binding:"Required;AlphaDashDot;MaxSize(30)" locale:"org.org_name_holder"`
}

func (*CreateOrgForm) Validate added in v0.5.0

func (f *CreateOrgForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type CreateRepoForm

type CreateRepoForm struct {
	Uid         int64  `binding:"Required"`
	RepoName    string `binding:"Required;AlphaDashDot;MaxSize(100)"`
	Private     bool
	Description string `binding:"MaxSize(255)"`
	AutoInit    bool
	Gitignores  string
	License     string
	Readme      string
}

func (*CreateRepoForm) Validate

func (f *CreateRepoForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type CreateTeamForm added in v0.5.0

type CreateTeamForm struct {
	TeamName    string `form:"team_name" binding:"Required;AlphaDashDot;MaxSize(30)"`
	Description string `form:"desc" binding:"MaxSize(255)"`
	Permission  string `form:"permission"`
}

func (*CreateTeamForm) Validate added in v0.5.0

func (f *CreateTeamForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type EditReleaseForm added in v0.5.0

type EditReleaseForm struct {
	Title      string `form:"title" binding:"Required"`
	Content    string `form:"content" binding:"Required"`
	Draft      string `form:"draft"`
	Prerelease bool   `form:"prerelease"`
}

func (*EditReleaseForm) Validate added in v0.5.0

func (f *EditReleaseForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type Form

type Form interface {
	binding.Validator
}

type InstallForm

type InstallForm struct {
	DbType   string `binding:"Required"`
	DbHost   string
	DbUser   string
	DbPasswd string
	DbName   string
	SSLMode  string
	DbPath   string

	AppName      string `binding:"Required" locale:"install.app_name"`
	RepoRootPath string `binding:"Required"`
	RunUser      string `binding:"Required"`
	Domain       string `binding:"Required"`
	SSHPort      int
	HTTPPort     string `binding:"Required"`
	AppUrl       string `binding:"Required"`

	SMTPHost        string
	SMTPFrom        string
	SMTPEmail       string `binding:"OmitEmpty;Email;MaxSize(50)" locale:"install.mailer_user"`
	SMTPPasswd      string
	RegisterConfirm bool
	MailNotify      bool

	OfflineMode         bool
	DisableGravatar     bool
	DisableRegistration bool
	EnableCaptcha       bool
	RequireSignInView   bool

	AdminName          string `binding:"OmitEmpty;AlphaDashDot;MaxSize(30)" locale:"install.admin_name"`
	AdminPasswd        string `binding:"OmitEmpty;MaxSize(255)" locale:"install.admin_password"`
	AdminConfirmPasswd string
	AdminEmail         string `binding:"OmitEmpty;Email;MaxSize(50)" locale:"install.admin_email"`
}

func (*InstallForm) Validate

func (f *InstallForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type MigrateRepoForm added in v0.3.0

type MigrateRepoForm struct {
	CloneAddr    string `json:"clone_addr" binding:"Required"`
	AuthUsername string `json:"auth_username"`
	AuthPassword string `json:"auth_password"`
	Uid          int64  `json:"uid" binding:"Required"`
	RepoName     string `json:"repo_name" binding:"Required;AlphaDashDot;MaxSize(100)"`
	Private      bool   `json:"mirror"`
	Mirror       bool   `json:"private"`
	Description  string `json:"description" binding:"MaxSize(255)"`
}

func (*MigrateRepoForm) Validate added in v0.3.0

func (f *MigrateRepoForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type NewAccessTokenForm added in v0.5.8

type NewAccessTokenForm struct {
	Name string `binding:"Required"`
}

func (*NewAccessTokenForm) Validate added in v0.5.8

func (f *NewAccessTokenForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type NewReleaseForm added in v0.3.0

type NewReleaseForm struct {
	TagName    string `form:"tag_name" binding:"Required"`
	Target     string `form:"tag_target" binding:"Required"`
	Title      string `form:"title" binding:"Required"`
	Content    string `form:"content" binding:"Required"`
	Draft      string `form:"draft"`
	Prerelease bool   `form:"prerelease"`
}

func (*NewReleaseForm) Validate added in v0.3.0

func (f *NewReleaseForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type NewSlackHookForm added in v0.5.0

type NewSlackHookForm struct {
	PayloadURL string `binding:"Required;Url`
	Channel    string `binding:"Required"`
	Username   string
	IconURL    string
	Color      string
	WebhookForm
}

func (*NewSlackHookForm) Validate added in v0.5.0

func (f *NewSlackHookForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type NewWebhookForm added in v0.4.0

type NewWebhookForm struct {
	PayloadURL  string `binding:"Required;Url"`
	ContentType int    `binding:"Required"`
	Secret      string
	WebhookForm
}

func (*NewWebhookForm) Validate added in v0.4.0

func (f *NewWebhookForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type RegisterForm

type RegisterForm struct {
	UserName string `binding:"Required;AlphaDashDot;MaxSize(35)"`
	Email    string `binding:"Required;Email;MaxSize(254)"`
	Password string `binding:"Required;MaxSize(255)"`
	Retype   string
}

func (*RegisterForm) Validate

func (f *RegisterForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type RepoSettingForm added in v0.4.0

type RepoSettingForm struct {
	RepoName    string `binding:"Required;AlphaDashDot;MaxSize(100)"`
	Description string `binding:"MaxSize(255)"`
	Website     string `binding:"Url;MaxSize(100)"`
	Branch      string
	Interval    int
	Private     bool
}

func (*RepoSettingForm) Validate added in v0.4.0

func (f *RepoSettingForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type SignInForm added in v0.5.0

type SignInForm struct {
	UserName string `binding:"Required;MaxSize(254)"`
	Password string `binding:"Required;MaxSize(255)"`
	Remember bool
}

func (*SignInForm) Validate added in v0.5.0

func (f *SignInForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type UpdateOrgSettingForm added in v0.5.0

type UpdateOrgSettingForm struct {
	Name        string `binding:"Required;AlphaDashDot;MaxSize(30)" locale:"org.org_name_holder"`
	FullName    string `binding:"MaxSize(100)"`
	Description string `binding:"MaxSize(255)"`
	Website     string `binding:"Url;MaxSize(100)"`
	Location    string `binding:"MaxSize(50)"`
}

func (*UpdateOrgSettingForm) Validate added in v0.5.0

type UpdateProfileForm

type UpdateProfileForm struct {
	Name     string `binding:"Required;MaxSize(35)"`
	FullName string `binding:"MaxSize(100)"`
	Email    string `binding:"Required;Email;MaxSize(254)"`
	Website  string `binding:"Url;MaxSize(100)"`
	Location string `binding:"MaxSize(50)"`
	Gravatar string `binding:"Required;Email;MaxSize(254)"`
}

func (*UpdateProfileForm) Validate

func (f *UpdateProfileForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type UploadAvatarForm added in v0.5.9

type UploadAvatarForm struct {
	Enable bool
	Avatar *multipart.FileHeader
}

func (*UploadAvatarForm) Validate added in v0.5.9

func (f *UploadAvatarForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

type WebhookForm added in v0.6.9

type WebhookForm struct {
	Events string
	Create bool
	Push   bool
	Active bool
}

func (WebhookForm) ChooseEvents added in v0.6.9

func (f WebhookForm) ChooseEvents() bool

func (WebhookForm) PushOnly added in v0.6.9

func (f WebhookForm) PushOnly() bool

func (WebhookForm) SendEverything added in v0.6.9

func (f WebhookForm) SendEverything() bool

Directories

Path Synopsis
Package ldap provide functions & structure to query a LDAP ldap directory For now, it's mainly tested again an MS Active Directory service, see README.md for more information
Package ldap provide functions & structure to query a LDAP ldap directory For now, it's mainly tested again an MS Active Directory service, see README.md for more information

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL