pub struct AuthService { /* private fields */ }Expand description
企业认证服务
提供飞书开放平台的企业级认证功能,支持:
- 企业自建应用认证
- 应用商店应用认证
- 访问令牌获取和管理
- 应用票据处理
§示例
use openlark_auth::AuthService;
use openlark_core::config::Config;
let config = Config::builder()
.app_id("your_app_id")
.app_secret("your_app_secret")
.base_url("https://open.feishu.cn")
.build();
let auth_service = AuthService::new(config);
// 构建「自建应用获取 app_access_token」请求(这里只演示构建,不发送网络请求)
let _builder = auth_service
.v3()
.app_access_token_internal()
.app_id("your_app_id")
.app_secret("your_app_secret");
// 真正发送请求需要配合 `openlark_core::http::Transport` 进行请求执行。Implementations§
Source§impl AuthService
impl AuthService
Sourcepub fn v3(&self) -> AuthServiceV3
pub fn v3(&self) -> AuthServiceV3
获取v3版本的认证服务
v3版本包含以下API:
app_access_token: 商店应用获取app_access_tokenapp_access_token_internal: 自建应用获取app_access_tokentenant_access_token: 商店应用获取tenant_access_tokentenant_access_token_internal: 自建应用获取tenant_access_tokenapp_ticket_resend: 重新获取app_ticket
§示例
use openlark_auth::AuthService;
use openlark_core::config::Config;
let config = Config::default();
let auth_service = AuthService::new(config);
let v3_service = auth_service.v3();Trait Implementations§
Source§impl Clone for AuthService
impl Clone for AuthService
Source§fn clone(&self) -> AuthService
fn clone(&self) -> AuthService
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AuthService
impl Debug for AuthService
Auto Trait Implementations§
impl Freeze for AuthService
impl !RefUnwindSafe for AuthService
impl Send for AuthService
impl Sync for AuthService
impl Unpin for AuthService
impl UnsafeUnpin for AuthService
impl !UnwindSafe for AuthService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more