fix: allow the new auth commands in the tauri acl
This commit is contained in:
1 parent
65d04fb282
commit
4c2cdbc4f0
4 files changed
+53
-3
No files matched your search
@@ -42,11 +42,12 @@ which offered Microsoft and nothing else:
|
|||||||
.../src/components/ui/OfflineAccountModal.vue | 136 ++++++++++++++++++
|
.../src/components/ui/OfflineAccountModal.vue | 136 ++++++++++++++++++
|
||||||
.../MinecraftRequiredModal.vue | 30 +++-
|
.../MinecraftRequiredModal.vue | 30 +++-
|
||||||
apps/app-frontend/src/helpers/auth.js | 13 ++
|
apps/app-frontend/src/helpers/auth.js | 13 ++
|
||||||
|
apps/app/build.rs | 1 +
|
||||||
apps/app/src/api/auth.rs | 7 +
|
apps/app/src/api/auth.rs | 7 +
|
||||||
packages/app-lib/Cargo.toml | 1 +
|
packages/app-lib/Cargo.toml | 1 +
|
||||||
packages/app-lib/src/api/minecraft_auth.rs | 39 +++++
|
packages/app-lib/src/api/minecraft_auth.rs | 39 +++++
|
||||||
packages/app-lib/src/state/minecraft_auth.rs | 68 +++++++++
|
packages/app-lib/src/state/minecraft_auth.rs | 68 +++++++++
|
||||||
11 files changed, 330 insertions(+), 8 deletions(-)
|
12 files changed, 331 insertions(+), 8 deletions(-)
|
||||||
create mode 100644 apps/app-frontend/src/components/ui/OfflineAccountModal.vue
|
create mode 100644 apps/app-frontend/src/components/ui/OfflineAccountModal.vue
|
||||||
|
|
||||||
diff --git a/Cargo.lock b/Cargo.lock
|
diff --git a/Cargo.lock b/Cargo.lock
|
||||||
@@ -437,6 +438,18 @@ index 94bd13e..cb7319a 100644
|
|||||||
/**
|
/**
|
||||||
* Retrieves the default user
|
* Retrieves the default user
|
||||||
* @return {Promise<UUID | undefined>}
|
* @return {Promise<UUID | undefined>}
|
||||||
|
diff --git a/apps/app/build.rs b/apps/app/build.rs
|
||||||
|
index c4becf9..f8de273 100644
|
||||||
|
--- a/apps/app/build.rs
|
||||||
|
+++ b/apps/app/build.rs
|
||||||
|
@@ -14,6 +14,7 @@ fn main() {
|
||||||
|
.commands(&[
|
||||||
|
"check_reachable",
|
||||||
|
"login",
|
||||||
|
+ "login_offline",
|
||||||
|
"remove_user",
|
||||||
|
"get_default_user",
|
||||||
|
"set_default_user",
|
||||||
diff --git a/apps/app/src/api/auth.rs b/apps/app/src/api/auth.rs
|
diff --git a/apps/app/src/api/auth.rs b/apps/app/src/api/auth.rs
|
||||||
index 8227d94..f4eded6 100644
|
index 8227d94..f4eded6 100644
|
||||||
--- a/apps/app/src/api/auth.rs
|
--- a/apps/app/src/api/auth.rs
|
||||||
|
|||||||
@@ -31,13 +31,14 @@ Modrinth Enhanced yet.
|
|||||||
.../src/components/ui/ElyAccountModal.vue | 166 ++++++++++++++
|
.../src/components/ui/ElyAccountModal.vue | 166 ++++++++++++++
|
||||||
.../MinecraftRequiredModal.vue | 29 ++-
|
.../MinecraftRequiredModal.vue | 29 ++-
|
||||||
apps/app-frontend/src/helpers/auth.js | 15 ++
|
apps/app-frontend/src/helpers/auth.js | 15 ++
|
||||||
|
apps/app/build.rs | 1 +
|
||||||
apps/app/src/api/auth.rs | 10 +
|
apps/app/src/api/auth.rs | 10 +
|
||||||
packages/app-lib/src/api/minecraft_auth.rs | 34 +++
|
packages/app-lib/src/api/minecraft_auth.rs | 34 +++
|
||||||
packages/app-lib/src/launcher/mod.rs | 16 ++
|
packages/app-lib/src/launcher/mod.rs | 16 ++
|
||||||
packages/app-lib/src/state/minecraft_auth.rs | 213 +++++++++++++++++-
|
packages/app-lib/src/state/minecraft_auth.rs | 213 +++++++++++++++++-
|
||||||
packages/app-lib/src/util/authlib_injector.rs | 77 +++++++
|
packages/app-lib/src/util/authlib_injector.rs | 77 +++++++
|
||||||
packages/app-lib/src/util/mod.rs | 1 +
|
packages/app-lib/src/util/mod.rs | 1 +
|
||||||
10 files changed, 578 insertions(+), 13 deletions(-)
|
11 files changed, 579 insertions(+), 13 deletions(-)
|
||||||
create mode 100644 apps/app-frontend/src/components/ui/ElyAccountModal.vue
|
create mode 100644 apps/app-frontend/src/components/ui/ElyAccountModal.vue
|
||||||
create mode 100644 packages/app-lib/src/util/authlib_injector.rs
|
create mode 100644 packages/app-lib/src/util/authlib_injector.rs
|
||||||
|
|
||||||
@@ -400,6 +401,18 @@ index cb7319a..57580ff 100644
|
|||||||
/**
|
/**
|
||||||
* Retrieves the default user
|
* Retrieves the default user
|
||||||
* @return {Promise<UUID | undefined>}
|
* @return {Promise<UUID | undefined>}
|
||||||
|
diff --git a/apps/app/build.rs b/apps/app/build.rs
|
||||||
|
index f8de273..1fdb8e1 100644
|
||||||
|
--- a/apps/app/build.rs
|
||||||
|
+++ b/apps/app/build.rs
|
||||||
|
@@ -15,6 +15,7 @@ fn main() {
|
||||||
|
"check_reachable",
|
||||||
|
"login",
|
||||||
|
"login_offline",
|
||||||
|
+ "login_ely",
|
||||||
|
"remove_user",
|
||||||
|
"get_default_user",
|
||||||
|
"set_default_user",
|
||||||
diff --git a/apps/app/src/api/auth.rs b/apps/app/src/api/auth.rs
|
diff --git a/apps/app/src/api/auth.rs b/apps/app/src/api/auth.rs
|
||||||
index f4eded6..dea07b2 100644
|
index f4eded6..dea07b2 100644
|
||||||
--- a/apps/app/src/api/auth.rs
|
--- a/apps/app/src/api/auth.rs
|
||||||
|
|||||||
@@ -24,9 +24,10 @@ modal for anyone the browser does not work out for.
|
|||||||
.../src/components/ui/MicrosoftLoginModal.vue | 213 ++++++++++++++++++
|
.../src/components/ui/MicrosoftLoginModal.vue | 213 ++++++++++++++++++
|
||||||
.../MinecraftRequiredModal.vue | 29 +--
|
.../MinecraftRequiredModal.vue | 29 +--
|
||||||
apps/app-frontend/src/helpers/auth.js | 25 ++
|
apps/app-frontend/src/helpers/auth.js | 25 ++
|
||||||
|
apps/app/build.rs | 2 +
|
||||||
apps/app/src/api/auth.rs | 77 +++++++
|
apps/app/src/api/auth.rs | 77 +++++++
|
||||||
packages/app-lib/src/api/mod.rs | 12 +-
|
packages/app-lib/src/api/mod.rs | 12 +-
|
||||||
6 files changed, 331 insertions(+), 42 deletions(-)
|
7 files changed, 333 insertions(+), 42 deletions(-)
|
||||||
create mode 100644 apps/app-frontend/src/components/ui/MicrosoftLoginModal.vue
|
create mode 100644 apps/app-frontend/src/components/ui/MicrosoftLoginModal.vue
|
||||||
|
|
||||||
diff --git a/apps/app-frontend/src/components/ui/AccountsCard.vue b/apps/app-frontend/src/components/ui/AccountsCard.vue
|
diff --git a/apps/app-frontend/src/components/ui/AccountsCard.vue b/apps/app-frontend/src/components/ui/AccountsCard.vue
|
||||||
@@ -403,6 +404,19 @@ index 57580ff..c25af95 100644
|
|||||||
/**
|
/**
|
||||||
* Adds an offline account with the given username and makes it the active one.
|
* Adds an offline account with the given username and makes it the active one.
|
||||||
*
|
*
|
||||||
|
diff --git a/apps/app/build.rs b/apps/app/build.rs
|
||||||
|
index 1fdb8e1..5c797ab 100644
|
||||||
|
--- a/apps/app/build.rs
|
||||||
|
+++ b/apps/app/build.rs
|
||||||
|
@@ -14,6 +14,8 @@ fn main() {
|
||||||
|
.commands(&[
|
||||||
|
"check_reachable",
|
||||||
|
"login",
|
||||||
|
+ "login_browser_begin",
|
||||||
|
+ "login_browser_finish",
|
||||||
|
"login_offline",
|
||||||
|
"login_ely",
|
||||||
|
"remove_user",
|
||||||
diff --git a/apps/app/src/api/auth.rs b/apps/app/src/api/auth.rs
|
diff --git a/apps/app/src/api/auth.rs b/apps/app/src/api/auth.rs
|
||||||
index dea07b2..5c3648c 100644
|
index dea07b2..5c3648c 100644
|
||||||
--- a/apps/app/src/api/auth.rs
|
--- a/apps/app/src/api/auth.rs
|
||||||
|
|||||||
@@ -52,6 +52,16 @@ check "it is reachable with no account yet" \
|
|||||||
check "the checklist offers the same choice" \
|
check "the checklist offers the same choice" \
|
||||||
contains "$WORKTREE/apps/app-frontend/src/App.vue" '@login-minecraft="minecraftRequiredModal?.show()"'
|
contains "$WORKTREE/apps/app-frontend/src/App.vue" '@login-minecraft="minecraftRequiredModal?.show()"'
|
||||||
|
|
||||||
|
# A Tauri command that is not listed in build.rs compiles, ships, and then
|
||||||
|
# fails at runtime with "not allowed by ACL". Nothing else here would catch it.
|
||||||
|
log "Tauri command permissions"
|
||||||
|
while read -r command; do
|
||||||
|
[ -n "$command" ] || continue
|
||||||
|
check "$command is allowed by the ACL" \
|
||||||
|
contains "$WORKTREE/apps/app/build.rs" "\"$command\","
|
||||||
|
done < <(grep -A2 '#\[tauri::command\]' "$WORKTREE/apps/app/src/api/auth.rs" |
|
||||||
|
grep -oE 'pub async fn [a-z_]+' | awk '{print $4}' | sort -u)
|
||||||
|
|
||||||
log "Microsoft sign-in"
|
log "Microsoft sign-in"
|
||||||
check "the browser flow is registered" \
|
check "the browser flow is registered" \
|
||||||
contains "$WORKTREE/apps/app/src/api/auth.rs" 'login_browser_begin,'
|
contains "$WORKTREE/apps/app/src/api/auth.rs" 'login_browser_begin,'
|
||||||
|
|||||||
Reference in new issue
Block a user