reduce to 1 object per asset
This commit is contained in:
@@ -115,17 +115,13 @@ impl JwtService {
|
||||
pub fn generate_asset_download_token(
|
||||
&self,
|
||||
asset_id: Uuid,
|
||||
object_id: Uuid,
|
||||
user_id: Uuid,
|
||||
tenant_id: Uuid,
|
||||
) -> Result<String> {
|
||||
let now = Utc::now();
|
||||
let exp = now + self.download_expiry;
|
||||
let claims = DownloadClaims {
|
||||
subject: DownloadSubject::AssetObject {
|
||||
asset_id,
|
||||
object_id,
|
||||
},
|
||||
subject: DownloadSubject::Asset { asset_id },
|
||||
user_id,
|
||||
tenant_id,
|
||||
iss: self.issuer.clone(),
|
||||
@@ -216,7 +212,7 @@ pub struct Claims {
|
||||
#[serde(tag = "scope", rename_all = "snake_case")]
|
||||
pub enum DownloadSubject {
|
||||
Document { doc_id: Uuid, version_id: Uuid },
|
||||
AssetObject { asset_id: Uuid, object_id: Uuid },
|
||||
Asset { asset_id: Uuid },
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
||||
Reference in New Issue
Block a user