-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Digital Asset Links in web app and CLI.
- Loading branch information
Showing
14 changed files
with
456 additions
and
48 deletions.
There are no files selected for viewing
This file contains 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 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,16 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var ( | ||
assetlinkCmd = &cobra.Command{ | ||
Use: "assetlink", | ||
Short: "Command for Android Asset Link utils.", | ||
} | ||
) | ||
|
||
func init() { | ||
rootCmd.AddCommand(assetlinkCmd) | ||
} |
This file contains 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,27 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/chayev/yurl/yurllib" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
// validateAssetLinkCmd represents the validate command for ASset Links | ||
var validateAssetLinkCmd = &cobra.Command{ | ||
Use: "validate <URL>", | ||
Short: "Validate your link against Android's requirements", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
output := yurllib.CheckAssetLinkDomain(args[0], "", "") | ||
|
||
for _, item := range output { | ||
fmt.Print(item) | ||
} | ||
|
||
}, | ||
} | ||
|
||
func init() { | ||
assetlinkCmd.AddCommand(validateAssetLinkCmd) | ||
} |
This file contains 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 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 |
---|---|---|
|
@@ -167,4 +167,4 @@ footer a { | |
padding-left: 15px; | ||
padding-right: 15px; | ||
} | ||
} | ||
} |
This file contains 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,27 @@ | ||
{{ template "header" }} | ||
<body id="results"> | ||
<header class="padding"> | ||
<h1><a href="/android" aria-label="Go to Homepage" tabindex="-1">yURL</a><span id="description">: Asset Links File Validator</span></h1> | ||
<a href="https://www.github.com/chayev/yurl" target="_blank" rel="noopener" title="Go to the GitHub project" aria-label="Go to the GitHub project" tabindex="-1"><i class="fab fa-github"></i></a> | ||
</header> | ||
{{ template "navToiOS" }} | ||
<main class="padding"> | ||
<form method="GET" action="/android-results" id="assetlink"> | ||
<label class="wide" for="url">URL</label> | ||
<label class="wide" for="prefix">Package Name</label> | ||
<label class="wide" for="bundle">Package Fingerprint</label> | ||
<label class="mini" for="url">URL</label> | ||
<input type="text" name="url" placeholder="Required" value="{{ .URL }}" tabindex="1"/> | ||
<label class="mini" for="prefix">Package</label> | ||
<input type="text" name="prefix" placeholder="Optional" value="{{ .Prefix }}" tabindex="2" /> | ||
<label class="mini" for="bundle">Fingerprint</label> | ||
<input type="text" name="bundle" placeholder="Optional" value="{{ .Bundle }}" tabindex="3" /> | ||
<a class="wide" href="#" onclick="document.getElementById('assetlink').submit()" tabindex="4"><i class="fas fa-redo-alt"></i></a> | ||
<input class="mini" type="submit" value="Validate" tabindex="-1" /> | ||
</form> | ||
<h2>Results:</h2> | ||
<pre>{{ .Content }}</pre> | ||
</main> | ||
{{ template "footer" . }} | ||
</body> | ||
</html> |
This file contains 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,17 @@ | ||
{{ template "header" }} | ||
<body> | ||
{{ template "navToiOS" }} | ||
<header><a href="https://www.github.com/chayev/yurl" id="github-home" target="_blank" rel="noopener" title="Go to the GitHub project" aria-label="Go to the GitHub project"><i class="fab fa-github"></i></a></header> | ||
<main> | ||
<h1><span id="name">yURL</span>: Asset Links File Validator</h1> | ||
<p>yURL allows you to validate whether a URL is properly configured for Android Asset Links. This allows you to check if the assetlinks.json file exists and is in the proper format as <a href="https://developers.google.com/digital-asset-links/v1/getting-started" target="_blank" rel="noopener" aria-label="Google Digital Asset Links Requirements">defined by Google</a>.</p> | ||
<form method="GET" action="/android-results"> | ||
<input type="text" name="url" placeholder="Enter a URL test (e.g. https://app.chayev.com/xyx)" tabindex="1" /> | ||
<input type="text" name="prefix" placeholder="Package Name (Optional)" tabindex="2" /> | ||
<input type="text" name="bundle" placeholder="Package Fingerprint (Optional)" tabindex="3" /> | ||
<input type="submit" value="Validate" tabindex="4" /> | ||
</form> | ||
</main> | ||
{{ template "footer" . }} | ||
</body> | ||
</html> |
This file contains 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 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,5 @@ | ||
{{ define "navToAndroid" }} | ||
<div style="background-color: #333333; padding: 5px;"> | ||
<a href="/android" style="text-decoration: none; color: #ffffff">Click here to validate Android Deep Linking instead</a> | ||
</div> | ||
{{end}} |
This file contains 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,5 @@ | ||
{{ define "navToiOS" }} | ||
<div style="background-color: #333333; padding: 5px;"> | ||
<a href="/"style="text-decoration: none; color: #ffffff">Click here to validate iOS Deep Linking instead</a> | ||
</div> | ||
{{end}} |
This file contains 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 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.