neptune-auth 0.1.0

Crate for implementing message authorization for cosmwasm smart contracts.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use cosmwasm_std::Addr;
use thiserror::Error;

pub type NeptAuthResult<T> = core::result::Result<T, NeptAuthError>;

const AUTH_ERR: &str = "Neptune Auth Error -";

#[derive(Error, Debug, PartialEq)]
pub enum NeptAuthError {
    #[error("{} Unauthorized: {sender} is not {permission_group}", AUTH_ERR)]
    Unauthorized { sender: Addr, permission_group: String },

    #[error("{} Public must be only entry in permission group list", AUTH_ERR)]
    InvalidPublic,

    #[error("{} Empty permission group list", AUTH_ERR)]
    EmptyPermissionGroupList,
}