Skip to content

Commit

Permalink
Merge pull request #15 from cryptlex/add-error-code
Browse files Browse the repository at this point in the history
chore: add LA_E_OS_USER error code
  • Loading branch information
ahmad-kemsan authored Apr 8, 2024
2 parents 66d6ac8 + fefcf55 commit 643ac5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ In your Cargo.toml:

```toml
[dependencies]
lexactivator = { version = "3.22.1"}
lexactivator = { version = "3.22.2"}
```

Simple example usage:
Expand Down
4 changes: 4 additions & 0 deletions src/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ pub enum LexActivatorError {
LA_E_OIDC_SSO_NOT_ENABLED = 102,
/// The allowed users for this account has reached its limit.
LA_E_USERS_LIMIT_REACHED = 103,
/// OS user has changed since activation and the license is user-locked.
LA_E_OS_USER = 104,
}

impl From<i32> for LexActivatorStatus {
Expand Down Expand Up @@ -230,6 +232,7 @@ impl From<i32> for LexActivatorError {
101 => LexActivatorError::LA_E_AUTHENTICATION_ID_TOKEN_INVALID,
102 => LexActivatorError::LA_E_OIDC_SSO_NOT_ENABLED,
103 => LexActivatorError::LA_E_USERS_LIMIT_REACHED,
104 => LexActivatorError::LA_E_OS_USER,
_ => todo!(),
// Add more mappings as needed
}
Expand Down Expand Up @@ -314,6 +317,7 @@ impl fmt::Display for LexActivatorError {
LexActivatorError::LA_E_AUTHENTICATION_ID_TOKEN_INVALID => write!(f, "{} Invalid authentication ID token.", LexActivatorError::LA_E_AUTHENTICATION_ID_TOKEN_INVALID as i32),
LexActivatorError::LA_E_OIDC_SSO_NOT_ENABLED => write!(f, "{} OIDC SSO is not enabled.", LexActivatorError::LA_E_OIDC_SSO_NOT_ENABLED as i32),
LexActivatorError::LA_E_USERS_LIMIT_REACHED => write!(f, "{} The allowed users for this account has reached its limit.", LexActivatorError::LA_E_USERS_LIMIT_REACHED as i32),
LexActivatorError::LA_E_OS_USER => write!(f, "{} OS user has changed since activation and the license is user-locked.", LexActivatorError::LA_E_OS_USER as i32),
}
}
}
Expand Down

0 comments on commit 643ac5d

Please sign in to comment.