diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2013-07-08 16:29:01 +0200 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2013-07-08 16:29:01 +0200 |
commit | a63f4a2a4c428be58e32e3f08d1fcbb99f5ac29b (patch) | |
tree | f48710d62b8d4210582f6163fef230cca3b7bb0d /examples | |
parent | fb7c9b812271c1d7d857c093fcb99ace38c6b0f4 (diff) |
auth: add auth checks
Add an enum with auth checks and implement the checks in the auth object.
Perform the checks from the client.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/test-auth.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/examples/test-auth.c b/examples/test-auth.c index 15843d1..75455de 100644 --- a/examples/test-auth.c +++ b/examples/test-auth.c @@ -65,6 +65,8 @@ main (int argc, char *argv[]) GstRTSPToken *token; gchar *basic; GstStructure *s; + gchar *role_user[] = { "user", NULL }; + gchar *role_admin[] = { "admin", NULL }; gst_init (&argc, &argv); @@ -109,7 +111,8 @@ main (int argc, char *argv[]) /* make user token */ token = gst_rtsp_token_new (); s = gst_rtsp_token_writable_structure (token); - gst_structure_set (s, "manager.cgroup", G_TYPE_STRING, "user", NULL); + gst_structure_set (s, "manager.role", G_TYPE_STRING, "user", NULL); + gst_structure_set (s, "factory.media.roles", G_TYPE_STRV, role_user, NULL); basic = gst_rtsp_auth_make_basic ("user", "password"); gst_rtsp_auth_add_basic (auth, basic, token); g_free (basic); @@ -118,7 +121,8 @@ main (int argc, char *argv[]) /* make admin token */ token = gst_rtsp_token_new (); s = gst_rtsp_token_writable_structure (token); - gst_structure_set (s, "manager.cgroup", G_TYPE_STRING, "admin", NULL); + gst_structure_set (s, "manager.role", G_TYPE_STRING, "admin", NULL); + gst_structure_set (s, "factory.media.roles", G_TYPE_STRV, role_admin, NULL); basic = gst_rtsp_auth_make_basic ("admin", "power"); gst_rtsp_auth_add_basic (auth, basic, token); g_free (basic); @@ -127,7 +131,8 @@ main (int argc, char *argv[]) /* make admin2 token */ token = gst_rtsp_token_new (); s = gst_rtsp_token_writable_structure (token); - gst_structure_set (s, "manager.cgroup", G_TYPE_STRING, "admin", NULL); + gst_structure_set (s, "manager.role", G_TYPE_STRING, "admin", NULL); + gst_structure_set (s, "factory.media.roles", G_TYPE_STRV, role_admin, NULL); basic = gst_rtsp_auth_make_basic ("admin2", "power2"); gst_rtsp_auth_add_basic (auth, basic, token); g_free (basic); |