pub struct VoaLocation {
load_path: LoadPath,
os: Os,
purpose: Purpose,
context: Context,
technology: Technology,
}
Expand description
A VoaLocation
combines a load path and a full set of identifier parameters.
It represents a logical (not canonicalized) location in a VOA filesystem hierarchy.
A VoaLocation
points to a “leaf directory” in the VOA structure.
Signature verifier files are situated in a VoaLocation
.
Fields§
§load_path: LoadPath
§os: Os
§purpose: Purpose
§context: Context
§technology: Technology
Implementations§
Source§impl VoaLocation
impl VoaLocation
Sourcepub(crate) fn new(
load_path: LoadPath,
os: Os,
purpose: Purpose,
context: Context,
technology: Technology,
) -> Self
pub(crate) fn new( load_path: LoadPath, os: Os, purpose: Purpose, context: Context, technology: Technology, ) -> Self
Creates a new VoaLocation
.
Sourcepub fn load_path(&self) -> &LoadPath
pub fn load_path(&self) -> &LoadPath
The load path of the VoaLocation
.
Sourcepub fn os(&self) -> &Os
pub fn os(&self) -> &Os
The Os
of the VoaLocation
.
Sourcepub fn purpose(&self) -> &Purpose
pub fn purpose(&self) -> &Purpose
The Purpose
of the VoaLocation
.
Sourcepub fn context(&self) -> &Context
pub fn context(&self) -> &Context
The Context
of the VoaLocation
.
Sourcepub fn technology(&self) -> &Technology
pub fn technology(&self) -> &Technology
The Technology
of the VoaLocation
.
Sourcepub(crate) fn check_and_canonicalize(
&self,
legal_symlink_paths: &[&LoadPath],
) -> Result<PathBuf, Error>
pub(crate) fn check_and_canonicalize( &self, legal_symlink_paths: &[&LoadPath], ) -> Result<PathBuf, Error>
Canonicalize a VoaLocation
and check that its identifiers conform to VOA
restrictions.
Ensures that the provided VoaLocation
points to a legal path in the local
filesystem, and that any involved symlinks conform to the VOA symlink restrictions.
Checks the legality of symlinks (if any) in the VOA path structure, and returns the canonicalized path to the target directory.
§Errors
Returns an error if
- the load path of this
VoaLocation
can’t be canonicalized, - any intermediate symlink doesn’t conform to VOA symlinking rules,
e.g. by escaping from
legal_symlink_paths
. (also see https://uapi-group.org/specifications/specs/file_hierarchy_for_the_verification_of_os_artifacts/#symlinking), - if there are cycles in any symlink chain,
- if the target (or any intermediate) path is not a directory.
Sourcefn append(
current_path: &Path,
segment: &Path,
legal_symlink_paths: &[&LoadPath],
) -> Result<PathBuf, Error>
fn append( current_path: &Path, segment: &Path, legal_symlink_paths: &[&LoadPath], ) -> Result<PathBuf, Error>
Append a segment to a path and ensure that the resulting path conforms to the VOA symlink constraints.
§Errors
Returns an error if
- any intermediate symlink doesn’t conform to VOA symlinking rules,
e.g. by escaping from
legal_symlink_paths
. (also see https://uapi-group.org/specifications/specs/file_hierarchy_for_the_verification_of_os_artifacts/#symlinking), - if there are cycles in any symlink chain,
- if the target path is not a directory.
Trait Implementations§
Source§impl Clone for VoaLocation
impl Clone for VoaLocation
Source§fn clone(&self) -> VoaLocation
fn clone(&self) -> VoaLocation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more