Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
all: refactor, fixed tests, incorporated feedback
- Loading branch information
Aeneas Rekkas
committed
Jan 2, 2016
1 parent
480af91
commit 9e59df2
Showing
12 changed files
with
120 additions
and
131 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
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 |
---|---|---|
@@ -1,27 +1,26 @@ | ||
package auth | ||
package fosite | ||
|
||
import ( | ||
"net/url" | ||
"testing" | ||
"github.com/stretchr/testify/assert" | ||
. "github.com/ory-am/fosite" | ||
"net/url" | ||
"testing" | ||
) | ||
|
||
func TestGetRedirectURIAgainstRFC6749Section3(t *testing.T) { | ||
cf := &Config{} | ||
for _ , c := range []struct{ | ||
for _, c := range []struct { | ||
in string | ||
isError bool | ||
expected string | ||
} { | ||
}{ | ||
{in: "", isError: true}, | ||
} { | ||
values := url.Values{} | ||
values.Set("redirect_uri", c) | ||
values.Set("redirect_uri", c.in) | ||
res, err := cf.GetRedirectURI(values) | ||
assert.Equal(t, c.isError, err != nil) | ||
if err == nil { | ||
assert.Equal(t, c.expected, res) | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,21 +1,22 @@ | ||
package fosite | ||
|
||
import "github.com/ory-am/fosite/generator" | ||
|
||
type Config struct { | ||
AllowedAuthorizeResponseTypes []string | ||
AllowedTokenResponseTypes []string | ||
Lifetime int32 | ||
Store Storage | ||
Entropy int32 | ||
AuthorizeCodeGenerator generator.Generator | ||
AllowedTokenResponseTypes []string | ||
Lifetime int32 | ||
Store Storage | ||
Entropy int32 | ||
AuthorizeCodeGenerator generator.Generator | ||
} | ||
|
||
func NewDefaultConfig() *Config { | ||
return &Config{ | ||
AllowedAuthorizeResponseTypes: []string{"code", "token", "id_token"}, | ||
AllowedTokenResponseTypes: []string{}, | ||
Lifetime: 3600, | ||
Entropy: 128, | ||
AuthorizeCodeGenerator: generator.CryptoGenerator{}, | ||
AllowedTokenResponseTypes: []string{}, | ||
Lifetime: 3600, | ||
Entropy: 128, | ||
AuthorizeCodeGenerator: &generator.CryptoGenerator{}, | ||
} | ||
} | ||
} |
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.