Beispiel #1
0
/*
	Verifies that the token passed in is a valid token for the default user (a.k.a. the tegu admin) given in the
	config file.
	Returns "ok" (err is nil) if it is good, and an error otherwise.
*/
func validate_admin_token(admin *ostack.Ostack, token *string, user *string) error {

	osif_sheep.Baa(2, "validating admin token")
	exp, err := admin.Token_validation(token, user) // ensure token is good and was issued for user
	if err == nil {
		osif_sheep.Baa(2, "admin token validated successfully: %s expires: ", *token, exp)
	} else {
		osif_sheep.Baa(1, "admin token invalid: %s", err)
	}

	return err
}