()
| 5597 | |
| 5598 | #[tokio::test] |
| 5599 | async fn gateway() { |
| 5600 | let _guard = test::prepare().await; |
| 5601 | |
| 5602 | let user_active = user::User { |
| 5603 | email: "user@user".into(), |
| 5604 | is_active: true, |
| 5605 | ..Default::default() |
| 5606 | }; |
| 5607 | let user_admin = user::User { |
| 5608 | email: "admin@user".into(), |
| 5609 | is_active: true, |
| 5610 | is_admin: true, |
| 5611 | ..Default::default() |
| 5612 | }; |
| 5613 | let tenant_admin = user::User { |
| 5614 | email: "tenant-admin@user".into(), |
| 5615 | is_active: true, |
| 5616 | ..Default::default() |
| 5617 | }; |
| 5618 | let tenant_gateway_admin = user::User { |
| 5619 | email: "tenant-gateway-admin@user".into(), |
| 5620 | is_active: true, |
| 5621 | ..Default::default() |
| 5622 | }; |
| 5623 | let tenant_user = user::User { |
| 5624 | email: "tenant-user@user".into(), |
| 5625 | is_active: true, |
| 5626 | ..Default::default() |
| 5627 | }; |
| 5628 | |
| 5629 | for u in [ |
| 5630 | &user_active, |
| 5631 | &user_admin, |
| 5632 | &tenant_admin, |
| 5633 | &tenant_gateway_admin, |
| 5634 | &tenant_user, |
| 5635 | ] { |
| 5636 | user::create(u.clone()).await.unwrap(); |
| 5637 | } |
| 5638 | |
| 5639 | let tenant_a = tenant::test::create_tenant().await; |
| 5640 | |
| 5641 | let api_key_admin = api_key::test::create_api_key(true, false).await; |
| 5642 | let api_key_admin_ro = api_key::create(api_key::ApiKey { |
| 5643 | name: api_key_admin.name.clone(), |
| 5644 | is_admin: api_key_admin.is_admin, |
| 5645 | tenant_id: api_key_admin.tenant_id, |
| 5646 | is_read_only: true, |
| 5647 | ..Default::default() |
| 5648 | }) |
| 5649 | .await |
| 5650 | .unwrap(); |
| 5651 | let api_key_tenant = api_key::test::create_api_key(false, true).await; |
| 5652 | let api_key_tenant_ro = api_key::create(api_key::ApiKey { |
| 5653 | name: api_key_tenant.name.clone(), |
| 5654 | is_admin: api_key_tenant.is_admin, |
| 5655 | tenant_id: api_key_tenant.tenant_id, |
| 5656 | is_read_only: true, |
nothing calls this directly
no test coverage detected