func (f *FileTokenStore) Put(tok *usso.SSOData) error {
	data, err := json.Marshal(tok)
	if err != nil {
		return errgo.Notef(err, "cannot marshal token")
	}
	dir := filepath.Dir(f.path)
	if err := os.MkdirAll(dir, 0700); err != nil {
		return errgo.Notef(err, "cannot create directory %q", dir)
	}
	if err := ioutil.WriteFile(f.path, data, 0600); err != nil {
		return errgo.Notef(err, "cannot write file")
	}
	return nil
}
// Put implements TokenStore.Put by writing the token to the
// FileTokenStore's file. If the file doesn't exist it will be created,
// including any required directories.
Put implements TokenStore.Put by writing the token to the
FileTokenStore's file. If the file doesn't exist it will be created,
including any required directories.
// Put implements TokenStore . Put by writing the token to the // FileTokenStore ' s file . If the file doesn ' t exist it will be created // including any required directories .
func (f *FileTokenStore) Put(tok *usso.SSOData) error {
	data, err := json.Marshal(tok)
	if err != nil {
		return errgo.Notef(err, "cannot marshal token")
	}
	dir := filepath.Dir(f.path)
	if err := os.MkdirAll(dir, 0700); err != nil {
		return errgo.Notef(err, "cannot create directory %q", dir)
	}
	if err := ioutil.WriteFile(f.path, data, 0600); err != nil {
		return errgo.Notef(err, "cannot write file")
	}
	return nil
}
func ( f * FileTokenStore ) Put ( tok * usso . SSOData ) error { data , err := json . Marshal ( tok ) if err != nil { return errgo . Notef ( err , " " ) } dir := filepath . Dir ( f . path ) if err := os . MkdirAll ( dir , 0700 ) ; err != nil { return errgo . Notef ( err , " " , dir ) } if err := ioutil . WriteFile ( f . path , data , 0600 ) ; err != nil { return errgo . Notef ( err , " " ) } return nil }
Put implements TokenStore.Put by writing the token to the
FileTokenStore's file.
Put implements TokenStore . Put by writing the token to the FileTokenStore ' s file .