-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
alb rule changes + cognito support (#20)
- Loading branch information
1 parent
c1fd661
commit 888be43
Showing
14 changed files
with
764 additions
and
113 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ ecs-deploy-linux-amd64 | |
webapp/node_modules/ | ||
webapp/dist/ | ||
vendor/ | ||
bin/ | ||
.vscode/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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 @@ | ||
package api | ||
|
||
import ( | ||
"github.com/in4it/ecs-deploy/service" | ||
) | ||
|
||
type ruleConditionSort []*service.DeployRuleConditions | ||
|
||
func (s ruleConditionSort) Len() int { | ||
return len(s) | ||
} | ||
func (s ruleConditionSort) Swap(i, j int) { | ||
s[i], s[j] = s[j], s[i] | ||
} | ||
func (s ruleConditionSort) Less(i, j int) bool { | ||
return len(s[i].PathPattern) > len(s[j].PathPattern) | ||
} |
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,43 @@ | ||
package api | ||
|
||
import ( | ||
"sort" | ||
"testing" | ||
|
||
"github.com/google/go-cmp/cmp" | ||
"github.com/in4it/ecs-deploy/service" | ||
) | ||
|
||
func TestRuleConditionSort(t *testing.T) { | ||
conditions := []*service.DeployRuleConditions{ | ||
{ | ||
Hostname: "test", | ||
}, | ||
{ | ||
Hostname: "test", | ||
PathPattern: "/api", | ||
}, | ||
{ | ||
Hostname: "test", | ||
PathPattern: "/api/v1", | ||
}, | ||
} | ||
conditionsSorted := []*service.DeployRuleConditions{ | ||
{ | ||
Hostname: "test", | ||
PathPattern: "/api/v1", | ||
}, | ||
{ | ||
Hostname: "test", | ||
PathPattern: "/api", | ||
}, | ||
{ | ||
Hostname: "test", | ||
}, | ||
} | ||
sort.Sort(ruleConditionSort(conditions)) | ||
|
||
if !cmp.Equal(conditions, conditionsSorted) { | ||
t.Errorf("Conditions is not correctly sorted") | ||
} | ||
} |
Oops, something went wrong.