Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add LA_E_OS_USER error code #15

Merged
merged 2 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading