diff options
author | Jan Schmidt <jan@centricular.com> | 2015-11-17 01:12:28 +1100 |
---|---|---|
committer | Jan Schmidt <jan@centricular.com> | 2015-11-17 01:12:28 +1100 |
commit | a062b9c562edd7d3456b1be1f00be50b0b27085e (patch) | |
tree | 7410d242a117f3a7c8c5278eda8e2ea8ffeda416 /examples | |
parent | 75c3a3c095ffa5a2cdf437fb1989f58a42e9c39f (diff) |
test-auth: Use an 'anonymous' user for unauthenticated default
There's a comment on one of the resources that 'user' and 'admin'
shouldn't even be able to see it, but they can if the default
token is 'admin2', since that gives them access anyway.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/test-auth.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/test-auth.c b/examples/test-auth.c index eff3c74..0087d8a 100644 --- a/examples/test-auth.c +++ b/examples/test-auth.c @@ -102,6 +102,10 @@ main (int argc, char *argv[]) gst_rtsp_media_factory_add_role (factory, "admin2", GST_RTSP_PERM_MEDIA_FACTORY_ACCESS, G_TYPE_BOOLEAN, TRUE, GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT, G_TYPE_BOOLEAN, FALSE, NULL); + /* Anonymous user can do the same things as admin2 on this resource */ + gst_rtsp_media_factory_add_role (factory, "anonymous", + GST_RTSP_PERM_MEDIA_FACTORY_ACCESS, G_TYPE_BOOLEAN, TRUE, + GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT, G_TYPE_BOOLEAN, FALSE, NULL); /* make another factory */ factory = gst_rtsp_media_factory_new (); @@ -124,10 +128,10 @@ main (int argc, char *argv[]) /* make a new authentication manager */ auth = gst_rtsp_auth_new (); - /* make default token, it has the same permissions as admin2 */ + /* make default token, it has no permissions */ token = gst_rtsp_token_new (GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE, G_TYPE_STRING, - "admin2", NULL); + "anonymous", NULL); gst_rtsp_auth_set_default_token (auth, token); gst_rtsp_token_unref (token); |