зеркало из https://github.com/mozilla/doorman.git
Fix test that loads from Github
This commit is contained in:
Родитель
f830787111
Коммит
6506c714e6
|
@ -45,7 +45,7 @@ func TestAllowedVerifiesAuthentication(t *testing.T) {
|
||||||
// Will initialize an authenticator (ie. download public keys)
|
// Will initialize an authenticator (ie. download public keys)
|
||||||
d.LoadPolicies(doorman.ServicesConfig{
|
d.LoadPolicies(doorman.ServicesConfig{
|
||||||
doorman.ServiceConfig{
|
doorman.ServiceConfig{
|
||||||
Service: "https://sample.yaml",
|
Service: "https://sample.yaml",
|
||||||
IdentityProvider: "https://auth.mozilla.auth0.com/",
|
IdentityProvider: "https://auth.mozilla.auth0.com/",
|
||||||
Policies: doorman.Policies{
|
Policies: doorman.Policies{
|
||||||
doorman.Policy{
|
doorman.Policy{
|
||||||
|
|
|
@ -134,7 +134,7 @@ func TestLoadGithub(t *testing.T) {
|
||||||
assert.NotNil(t, err)
|
assert.NotNil(t, err)
|
||||||
|
|
||||||
// Good URL
|
// Good URL
|
||||||
configs, err := Load([]string{"https://github.com/mozilla/doorman/raw/452ef7a/sample.yaml"})
|
configs, err := Load([]string{"https://github.com/mozilla/doorman/raw/f830787/sample.yaml"})
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
require.Equal(t, len(configs), 1)
|
require.Equal(t, len(configs), 1)
|
||||||
assert.Equal(t, len(configs[0].Tags), 1)
|
assert.Equal(t, len(configs[0].Tags), 1)
|
||||||
|
|
|
@ -38,11 +38,11 @@ type Policies []Policy
|
||||||
|
|
||||||
// ServiceConfig represents the policies file content.
|
// ServiceConfig represents the policies file content.
|
||||||
type ServiceConfig struct {
|
type ServiceConfig struct {
|
||||||
Source string
|
Source string
|
||||||
Service string
|
Service string
|
||||||
IdentityProvider string `yaml:"identityProvider"`
|
IdentityProvider string `yaml:"identityProvider"`
|
||||||
Tags Tags
|
Tags Tags
|
||||||
Policies Policies
|
Policies Policies
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetTags returns the tags principals for the ones specified.
|
// GetTags returns the tags principals for the ones specified.
|
||||||
|
|
|
@ -15,7 +15,7 @@ func TestMain(m *testing.M) {
|
||||||
// Load sample policies once
|
// Load sample policies once
|
||||||
sampleConfigs = ServicesConfig{
|
sampleConfigs = ServicesConfig{
|
||||||
ServiceConfig{
|
ServiceConfig{
|
||||||
Service: "https://sample.yaml",
|
Service: "https://sample.yaml",
|
||||||
IdentityProvider: "",
|
IdentityProvider: "",
|
||||||
Tags: Tags{
|
Tags: Tags{
|
||||||
"admins": Principals{"userid:maria"},
|
"admins": Principals{"userid:maria"},
|
||||||
|
|
Загрузка…
Ссылка в новой задаче