π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Remove Ente prefix from custom headers
Anand Baburajan9413f24ed06c
diff --git a/rust/crates/space/src/client/links.rs b/rust/crates/space/src/client/links.rsindex 8adf7f67d3..7bb79b62d2 100644--- a/rust/crates/space/src/client/links.rs+++ b/rust/crates/space/src/client/links.rs@@ -25,7 +25,7 @@ use crate::{const ACCESS_KEY_LENGTH: usize = 12;const ACCESS_KEY_ALPHABET: &[u8] =b"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";-const AUTH_HEADER: &str = "X-Ente-Space-Link-Auth";+const AUTH_HEADER: &str = "X-Space-Link-Auth";const AUTH_CONTEXT: &[u8; 8] = b"spacauth";const WRAP_CONTEXT: &[u8; 8] = b"spacwrap";@@ -576,7 +576,7 @@ mod tests {.await;let profile_request = server.mock("GET", format!("{prefix}/profile").as_str())- .match_header("x-ente-space-link-auth", auth.as_str())+ .match_header("x-space-link-auth", auth.as_str()).with_status(200).with_body(json!({@@ -598,7 +598,7 @@ mod tests {.await;let versions = server.mock("GET", format!("{prefix}/versions").as_str())- .match_header("x-ente-space-link-auth", auth.as_str())+ .match_header("x-space-link-auth", auth.as_str()).with_status(200).with_body(json!([{@@ -635,7 +635,7 @@ mod tests {let link_auth = "link-auth";let subscribe = server.mock("PUT", format!("{prefix}/push/subscription").as_str())- .match_header("x-ente-space-link-auth", link_auth)+ .match_header("x-space-link-auth", link_auth).match_body(Matcher::Json(json!({"endpoint": WEB_PUSH_ENDPOINT,"keys": {@@ -649,7 +649,7 @@ mod tests {.await;let unsubscribe = server.mock("DELETE", format!("{prefix}/push/subscription").as_str())- .match_header("x-ente-space-link-auth", link_auth)+ .match_header("x-space-link-auth", link_auth).match_body(Matcher::Json(json!({"endpoint": WEB_PUSH_ENDPOINT})))diff --git a/server/cmd/museum/main.go b/server/cmd/museum/main.goindex df8902390e..79b56455cc 100644--- a/server/cmd/museum/main.go+++ b/server/cmd/museum/main.go@@ -1416,8 +1416,8 @@ func cors() gin.HandlerFunc {return func(c *gin.Context) {c.Writer.Header().Set("Access-Control-Allow-Origin", c.GetHeader("Origin"))c.Writer.Header().Set("Access-Control-Allow-Credentials", "true")- c.Writer.Header().Set("Access-Control-Allow-Headers", "Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, X-Auth-Token, X-Space-Session-Token, X-Ente-Space-Link-Auth, X-Auth-Access-Token, X-Cast-Access-Token, X-Auth-Access-Token-JWT, X-Auth-Link-Device-Token, X-Client-Package, X-Client-Version, X-Paste-Consume, Authorization, accept, origin, Cache-Control, X-Requested-With, upgrade-insecure-requests, Range")- c.Writer.Header().Set("Access-Control-Expose-Headers", "X-Request-Id, X-Ente-Link-Device-Token")+ c.Writer.Header().Set("Access-Control-Allow-Headers", "Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, X-Auth-Token, X-Space-Session-Token, X-Space-Link-Auth, X-Auth-Access-Token, X-Cast-Access-Token, X-Auth-Access-Token-JWT, X-Auth-Link-Device-Token, X-Client-Package, X-Client-Version, X-Paste-Consume, Authorization, accept, origin, Cache-Control, X-Requested-With, upgrade-insecure-requests, Range")+ c.Writer.Header().Set("Access-Control-Expose-Headers", "X-Request-Id, X-Link-Device-Token")c.Writer.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS, GET, PUT, PATCH, DELETE")c.Writer.Header().Set("Access-Control-Max-Age", "1728000")diff --git a/server/pkg/middleware/recover.go b/server/pkg/middleware/recover.goindex 2f432aab16..fec3205d71 100644--- a/server/pkg/middleware/recover.go+++ b/server/pkg/middleware/recover.go@@ -53,7 +53,7 @@ func PanicRecover() gin.HandlerFunc {requestData := strings.Split(string(httpRequest), "\r\n")for idx, header := range requestData {current := strings.Split(header, ":")- if current[0] == "Authorization" || current[0] == "X-Auth-Token" || current[0] == "X-Space-Session-Token" || current[0] == "X-Ente-Space-Link-Auth" {+ if current[0] == "Authorization" || current[0] == "X-Auth-Token" || current[0] == "X-Space-Session-Token" || current[0] == "X-Space-Link-Auth" {requestData[idx] = current[0] + ": *"}}diff --git a/server/pkg/utils/auth/auth.go b/server/pkg/utils/auth/auth.goindex 4ffa6d650e..aa7d5aa799 100644--- a/server/pkg/utils/auth/auth.go+++ b/server/pkg/utils/auth/auth.go@@ -26,7 +26,7 @@ const (AppContextKey = "auth.app"LinkDeviceTokenHeader = "X-Auth-Link-Device-Token"- LinkDeviceTokenResponseHeader = "X-Ente-Link-Device-Token"+ LinkDeviceTokenResponseHeader = "X-Link-Device-Token"LinkDeviceTokenResponseKey = "linkDeviceToken")diff --git a/server/space/controller/links.go b/server/space/controller/links.goindex 6e02ea4b15..caee57c7c7 100644--- a/server/space/controller/links.go+++ b/server/space/controller/links.go@@ -16,7 +16,7 @@ import ()const (- SpaceLinkAuthHeader = "X-Ente-Space-Link-Auth"+ SpaceLinkAuthHeader = "X-Space-Link-Auth"spaceLinkAuthKeyBytes = 32spaceLinkKDFSaltBytes = 16spaceLinkKDFMemLimit = 67_108_864diff --git a/web/packages/base/http.ts b/web/packages/base/http.tsindex c5368dabd5..b11104691b 100644--- a/web/packages/base/http.ts+++ b/web/packages/base/http.ts@@ -24,7 +24,7 @@ export interface PublicAlbumsCredentials {export const linkDeviceTokenRequestHeader = "X-Auth-Link-Device-Token";-export const linkDeviceTokenResponseHeader = "X-Ente-Link-Device-Token";+export const linkDeviceTokenResponseHeader = "X-Link-Device-Token";export const linkDeviceTokenFromResponse = (res: Response) =>res.headers.get(linkDeviceTokenResponseHeader) ?? undefined;