Removed unused captions code.
This commit is contained in:
+1
-2
@@ -34,11 +34,10 @@ type Permissions struct {
|
||||
}
|
||||
|
||||
var permissionsMap = map[string][]string{
|
||||
"op": {"op", "present", "message", "caption", "token"},
|
||||
"op": {"op", "present", "message", "token"},
|
||||
"present": {"present", "message"},
|
||||
"message": {"message"},
|
||||
"observe": {},
|
||||
"caption": {"caption"},
|
||||
"admin": {"admin"},
|
||||
}
|
||||
|
||||
|
||||
+6
-14
@@ -396,8 +396,6 @@ var james = "james"
|
||||
var paul = "paul"
|
||||
var peter = "peter"
|
||||
var admin = "admin"
|
||||
var stt = "speech-to-text"
|
||||
|
||||
var badClients = []ClientCredentials{
|
||||
{Username: &jch, Password: "foo"},
|
||||
{Username: &john, Password: "foo"},
|
||||
@@ -418,9 +416,7 @@ var desc2JSON = `
|
||||
"john": {"password": "secret", "permissions": "present"},
|
||||
"james": {"password": "secret2", "permissions": "message"},
|
||||
"peter": {"password": "secret4"},
|
||||
"admin": {"password": "admin", "permissions": "admin"},
|
||||
"speech-to-text": {"password": {"type": "wildcard"},
|
||||
"permissions": "caption"}
|
||||
"admin": {"password": "admin", "permissions": "admin"}
|
||||
},
|
||||
"wildcard-user":
|
||||
{"permissions": "message", "password": {"type":"wildcard"}}
|
||||
@@ -429,7 +425,7 @@ var desc2JSON = `
|
||||
var goodClients = []credPerm{
|
||||
{
|
||||
ClientCredentials{Username: &jch, Password: "topsecret"},
|
||||
[]string{"op", "present", "message", "caption", "token"},
|
||||
[]string{"op", "present", "message", "token"},
|
||||
},
|
||||
{
|
||||
ClientCredentials{Username: &john, Password: "secret"},
|
||||
@@ -451,10 +447,6 @@ var goodClients = []credPerm{
|
||||
ClientCredentials{Username: &admin, Password: "admin"},
|
||||
[]string{"admin"},
|
||||
},
|
||||
{
|
||||
ClientCredentials{Username: &stt},
|
||||
[]string{"caption"},
|
||||
},
|
||||
}
|
||||
|
||||
func TestPermissions(t *testing.T) {
|
||||
@@ -513,7 +505,7 @@ func TestExtraPermissions(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
doit("jch", []string{"op", "token", "present", "message", "caption"})
|
||||
doit("jch", []string{"op", "token", "present", "message"})
|
||||
doit("john", []string{"present", "message"})
|
||||
doit("james", []string{})
|
||||
|
||||
@@ -521,7 +513,7 @@ func TestExtraPermissions(t *testing.T) {
|
||||
d.UnrestrictedTokens = false
|
||||
|
||||
doit("jch", []string{
|
||||
"op", "record", "token", "present", "message", "caption",
|
||||
"op", "record", "token", "present", "message",
|
||||
})
|
||||
doit("john", []string{"present", "message"})
|
||||
doit("james", []string{})
|
||||
@@ -529,7 +521,7 @@ func TestExtraPermissions(t *testing.T) {
|
||||
d.AllowRecording = false
|
||||
d.UnrestrictedTokens = true
|
||||
|
||||
doit("jch", []string{"op", "token", "present", "message", "caption"})
|
||||
doit("jch", []string{"op", "token", "present", "message"})
|
||||
doit("john", []string{"token", "present", "message"})
|
||||
doit("james", []string{})
|
||||
|
||||
@@ -537,7 +529,7 @@ func TestExtraPermissions(t *testing.T) {
|
||||
d.UnrestrictedTokens = true
|
||||
|
||||
doit("jch", []string{
|
||||
"op", "record", "token", "present", "message", "caption",
|
||||
"op", "record", "token", "present", "message",
|
||||
})
|
||||
doit("john", []string{"token", "present", "message"})
|
||||
doit("james", []string{})
|
||||
|
||||
Reference in New Issue
Block a user