certificates/authority/mgmt/admin.go

24 lines
532 B
Go
Raw Normal View History

2021-05-06 06:02:42 +00:00
package mgmt
2021-05-18 04:07:25 +00:00
import (
"github.com/smallstep/certificates/authority/admin"
)
// AdminType specifies the type of the admin. e.g. SUPER_ADMIN, REGULAR
2021-05-18 23:50:54 +00:00
type AdminType admin.Type
2021-05-18 04:07:25 +00:00
var (
// AdminTypeSuper superadmin
2021-05-18 23:50:54 +00:00
AdminTypeSuper = admin.TypeSuper
2021-05-18 04:07:25 +00:00
// AdminTypeRegular regular
2021-05-18 23:50:54 +00:00
AdminTypeRegular = admin.TypeRegular
2021-05-18 04:07:25 +00:00
)
2021-05-06 06:02:42 +00:00
// Admin type.
2021-05-18 23:50:54 +00:00
type Admin admin.Admin
2021-05-18 04:07:25 +00:00
// ToCertificates converts an Admin to the Admin type expected by the authority.
func (adm *Admin) ToCertificates() (*admin.Admin, error) {
2021-05-18 23:50:54 +00:00
return (*admin.Admin)(adm), nil
2021-05-18 04:07:25 +00:00
}