controllers

package
v0.0.0-...-4431d41 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2014 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Database Map
	Dbm *gorp.DbMap
)

Functions

func Init

func Init()

Initialize database and tables

func ParseCertificationRequest

func ParseCertificationRequest(asn1Data []byte) (certificationRequest, error)

Parse a certification request out of ASN.1 format

Types

type Admin

type Admin struct {
	App
}

Controller for admin sections of the project

func (Admin) CreateTemplate

func (c Admin) CreateTemplate(id int, template models.CertificateTemplate) revel.Result

Create a certificate template based on the passsed in form, and save it in the database

func (Admin) EditCertificate

func (c Admin) EditCertificate(projectId, certId int) revel.Result

Edit a certificate ownership list

func (Admin) EditProject

func (c Admin) EditProject(id int) revel.Result

Edit a project

func (Admin) EditProjectMembership

func (c Admin) EditProjectMembership(projectId int) revel.Result

Edit a projects membership list

func (Admin) EditTemplate

func (c Admin) EditTemplate(id, templateId int) revel.Result

Edit a template

func (Admin) EditUser

func (c Admin) EditUser(userId int) revel.Result

Edit a user and their accesses

func (Admin) Index

func (c Admin) Index() revel.Result

Base index page for Admin Controller - List Admin options

func (Admin) ManageProject

func (c Admin) ManageProject(id int) revel.Result

Manage a project

func (Admin) NewTemplate

func (c Admin) NewTemplate(id int) revel.Result

Present View to make new certificate template

func (Admin) Project

func (c Admin) Project() revel.Result

Create a new project through admin portal

func (Admin) Projects

func (c Admin) Projects() revel.Result

Manage projects

func (Admin) RevokeCertificate

func (c Admin) RevokeCertificate(projectId, certId int) revel.Result

Revoke a certificate and store it in the database

func (Admin) SaveProject

func (c Admin) SaveProject(project models.Project) revel.Result

Create and save a project and store it in database

func (Admin) SaveProjectMembership

func (c Admin) SaveProjectMembership(projectId int) revel.Result

Save the project membership changes

func (Admin) SaveSignCSR

func (c Admin) SaveSignCSR(projectId, csrId int, certificate models.FullCertificate) revel.Result

Create and sign a certificate from CSR and save in the database

func (Admin) SaveUser

func (c Admin) SaveUser(userId int, user models.User) revel.Result

Save the user

func (Admin) SignCSR

func (c Admin) SignCSR(projectId, csrId int) revel.Result

Sign a CSR in the database

func (Admin) UpdateCertificate

func (c Admin) UpdateCertificate(projectId, certId int) revel.Result

Save the project membership changes

func (Admin) UpdateProject

func (c Admin) UpdateProject(id int, project models.Project) revel.Result

Update and save a project and store it in database

func (Admin) UpdateTemplate

func (c Admin) UpdateTemplate(id int, template models.CertificateTemplate) revel.Result

Update a certificate template based on the passsed in form, and save it in the database

func (Admin) Users

func (c Admin) Users() revel.Result

Admin controller - List users and access, create users

type App

type App struct {
	GorpController
}

Default controller struct for CA Go

func (App) AddUser

func (c App) AddUser() revel.Result

Add a user to the session

func (App) DownloadCRL

func (c App) DownloadCRL(crlId int) revel.Result

Download a certificate revocation list

func (c App) DownloadOneTimeLink(hash string) revel.Result

Use One Time Link to download the private key

func (App) Index

func (c App) Index() revel.Result

Main page of the site

Starts Tour if first time used, or Lists all of the available projects

func (App) Register

func (c App) Register() revel.Result

Display a page to register a new user

type BreadCrumb struct {
	Name, Url string
	Active    bool
}

Struct to keep track of place within the site, for breadcrumb UI

type Download

type Download string

Custom string type to wrap my own functions around

func (Download) Apply

func (r Download) Apply(req *revel.Request, resp *revel.Response)

This will get called for Cert/Key downloads to manage HTTP Headers

type GorpController

type GorpController struct {
	*r.Controller
	Txn *gorp.Transaction
}

Controller wrapping around database operations - Foundation for app controller

func (*GorpController) AddCertTable

func (c *GorpController) AddCertTable(tableName string)

Add table for Certificates

func (*GorpController) Begin

func (c *GorpController) Begin() r.Result

Begin database transaction

func (*GorpController) Commit

func (c *GorpController) Commit() r.Result

Commit database transaction

func (*GorpController) Rollback

func (c *GorpController) Rollback() r.Result

Rollback a database transaction

type Project

type Project struct {
	App
}

Project controller

func (Project) CreateCert

func (c Project) CreateCert(id int) revel.Result

Present the page/form to create a certificate

func (Project) CreateCertFromTemplate

func (c Project) CreateCertFromTemplate(projectId, templateId int) revel.Result

Present the page/form to create a certificate based on a template

func (Project) CreateCertificate

func (c Project) CreateCertificate(id int, certificate models.FullCertificate) revel.Result

Create a certificate based on the passsed in form, and save it in the database

func (Project) Download

func (c Project) Download(id, certId int) revel.Result

Download a certificate in PEM format

func (Project) DownloadChain

func (c Project) DownloadChain(id, certId int) revel.Result

Download a certificate chain in PEM format

func (Project) DownloadEncryptedKey

func (c Project) DownloadEncryptedKey(id, certId int, newKey, existingKey string) revel.Result

Download an encrypted key in PEM format

func (Project) DownloadKey

func (c Project) DownloadKey(id, certId int) revel.Result

Download a key in PEM format

func (c Project) GenerateOneTimeLink(id, certId int) revel.Result

Generate a One Time Link to allow download of a key

func (Project) Index

func (c Project) Index(id int) revel.Result

Get the base Project page

func (Project) LoadCSR

func (c Project) LoadCSR(id int) revel.Result

Load/Import a Certificate Signing Request

func (Project) SaveCSR

func (c Project) SaveCSR(id int, csr *models.CertificateRequest) revel.Result

Store a passed CSR to be signed

func (Project) ViewCert

func (c Project) ViewCert(projectId, certId int) revel.Result

Display page for viewing certificate information

type Tour

type Tour struct {
	App
}

Tour section for first time the App is run

func (Tour) Index

func (c Tour) Index() revel.Result

Start page of tour - setup server

func (Tour) Project

func (c Tour) Project() revel.Result

Form to create first project

func (Tour) SaveProject

func (c Tour) SaveProject(project models.Project) revel.Result

Create and Save first project

func (Tour) SaveServerInfo

func (c Tour) SaveServerInfo(serverURL string) revel.Result

Create and Save first project

func (Tour) SaveUser

func (c Tour) SaveUser(user models.User, verifyPassword string) revel.Result

Save the first user

func (Tour) User

func (c Tour) User() revel.Result

Form to create first user

type User

type User struct {
	App
}

Controller for user related actions

func (User) Create

func (c User) Create() revel.Result

Show page to create a new user

func (User) Index

func (c User) Index() revel.Result

Show defualt User page

func (User) Login

func (c User) Login(username, password string) revel.Result

Log a user in based on provided username and password

func (User) Logout

func (c User) Logout() revel.Result

Log the current user out and close their session

func (User) Password

func (c User) Password() revel.Result

Display page for the user to change their password

func (User) Register

func (c User) Register() revel.Result

Show page for a new user to register

func (User) SaveUser

func (c User) SaveUser(user models.User, verifyPassword string) revel.Result

Create and save the new user

func (User) UpdatePassword

func (c User) UpdatePassword() revel.Result

Update the user password and update hash in database

Jump to

Keyboard shortcuts

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