pub struct AccessControl {
pub upload_policy: UploadPolicy,
/* private fields */
}Expand description
Controls which uploaders are permitted to push packages to a repository.
Fields§
§upload_policy: UploadPolicyCurrent upload policy.
Implementations§
Source§impl AccessControl
impl AccessControl
Sourcepub fn new(policy: UploadPolicy) -> Self
pub fn new(policy: UploadPolicy) -> Self
Create a new access control with the given policy.
Sourcepub fn add_uploader(&mut self, key_fingerprint: [u8; 32])
pub fn add_uploader(&mut self, key_fingerprint: [u8; 32])
Register an uploader by their Ed25519 public key fingerprint.
Sourcepub fn remove_uploader(&mut self, key_fingerprint: &[u8; 32]) -> bool
pub fn remove_uploader(&mut self, key_fingerprint: &[u8; 32]) -> bool
Remove an uploader. Returns true if the fingerprint was present.
Sourcepub fn verify_upload(
&self,
package_data: &[u8],
signature: &[u8],
uploader_key: &[u8],
) -> Result<(), KernelError>
pub fn verify_upload( &self, package_data: &[u8], signature: &[u8], uploader_key: &[u8], ) -> Result<(), KernelError>
Verify that an upload is authorized and properly signed.
Checks the upload policy, uploader identity (for Restricted), and
Ed25519 signature over the package data.
Trait Implementations§
Source§impl Clone for AccessControl
impl Clone for AccessControl
Source§fn clone(&self) -> AccessControl
fn clone(&self) -> AccessControl
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AccessControl
impl Debug for AccessControl
Auto Trait Implementations§
impl Freeze for AccessControl
impl RefUnwindSafe for AccessControl
impl Send for AccessControl
impl Sync for AccessControl
impl Unpin for AccessControl
impl UnwindSafe for AccessControl
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)