-
Notifications
You must be signed in to change notification settings - Fork 124
mobile: support attested labels on the Android node #381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
cde94c8
mobile: support attested labels on the Android node
kaisoz 343f2f7
mobile: run FFI isolates from top-level functions
kaisoz 1c24a8a
docs: mobile-ffi targets do not copy into jniLibs; fix x86_64 paths
kaisoz 1a76c7e
kind: let the Android app enroll through Dex
kaisoz fb73dcb
kind: show the mesh URLs in the tmux log window header
kaisoz b988db0
mobile: use hints instead of prefilled external MCP values
kaisoz a09200c
kind: let dev nodes attest any label
kaisoz d4b4857
mobile: stop a second Start tap from killing the embedded MCP server
kaisoz 4045d99
mobile: remember the labels the node enrolled with
kaisoz b79af33
sam-node: call api.ParseLabels directly
kaisoz cfe967f
kind: look the header addresses up without polling
kaisoz 0a0f73b
docs: describe how the app carries labels across starts
kaisoz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -107,3 +107,22 @@ func TestValidateLabels_AllKeysValidStaysSorted(t *testing.T) { | |||||||||||||||||||
| t.Errorf("ValidateLabels(sorted happy path): unexpected error: %v", err) | ||||||||||||||||||||
| } | ||||||||||||||||||||
| } | ||||||||||||||||||||
|
|
||||||||||||||||||||
| func TestParseLabels(t *testing.T) { | ||||||||||||||||||||
| labels, err := ParseLabels("region=eu-west-1, team = platform") | ||||||||||||||||||||
| if err != nil { | ||||||||||||||||||||
| t.Fatalf("ParseLabels failed: %v", err) | ||||||||||||||||||||
| } | ||||||||||||||||||||
| if labels["region"] != "eu-west-1" || labels["team"] != "platform" { | ||||||||||||||||||||
| t.Fatalf("unexpected labels: %v", labels) | ||||||||||||||||||||
| } | ||||||||||||||||||||
| if labels, err := ParseLabels(""); err != nil || labels != nil { | ||||||||||||||||||||
| t.Fatalf("empty string should yield no labels, got %v, %v", labels, err) | ||||||||||||||||||||
| } | ||||||||||||||||||||
|
Comment on lines
+119
to
+121
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a test case to verify that whitespace-only strings are correctly parsed as empty/nil labels, matching the updated
Suggested change
|
||||||||||||||||||||
| if _, err := ParseLabels("no-equals"); err == nil { | ||||||||||||||||||||
| t.Fatal("expected error for label without =") | ||||||||||||||||||||
| } | ||||||||||||||||||||
| if _, err := ParseLabels("k=a,k=b"); err == nil { | ||||||||||||||||||||
| t.Fatal("expected error for duplicate key") | ||||||||||||||||||||
| } | ||||||||||||||||||||
| } | ||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
mobile/sam-node-app/android/app/src/debug/res/xml/network_security_config.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <network-security-config> | ||
| <base-config cleartextTrafficPermitted="true" /> | ||
| </network-security-config> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trimming leading and trailing whitespace from the input string
sat the beginning ofParseLabelsensures that whitespace-only strings (e.g.," ") are consistently treated as empty and returnnil, nil, rather than returning an empty map.