guint identity_timeout = gsignond_daemon_get_identity_timeout (self->priv->auth_service);
dbus_identity = gsignond_dbus_identity_adapter_new_with_connection (
- g_object_ref (connection), identity, identity_timeout);
+ g_object_ref (connection), identity, app_context, identity_timeout);
#ifndef USE_P2P
g_bus_watch_name_on_connection (connection, sender, G_BUS_NAME_WATCHER_FLAGS_NONE,
NULL, _on_connnection_lost, dbus_identity, NULL);
identity_timeout = gsignond_daemon_get_identity_timeout (self->priv->auth_service);
dbus_identity = gsignond_dbus_identity_adapter_new_with_connection (
- g_object_ref(connection), identity, identity_timeout);
+ g_object_ref(connection), identity, app_context, identity_timeout);
info = gsignond_identity_get_identity_info (identity);
#ifndef USE_P2P
g_bus_watch_name_on_connection (connection, sender, G_BUS_NAME_WATCHER_FLAGS_NONE,
PROP_0,
PROP_SESSION,
PROP_CONNECTION,
+ PROP_APP_CONTEXT,
N_PROPERTIES
};
{
GDBusConnection *connection;
GSignondDbusAuthSession *dbus_auth_session;
- GSignondSecurityContext ctx;
GSignondAuthSession *session;
+ gchar *app_context;
+ GSignondSecurityContext ctx;
/* signal handlers */
guint state_changed_handler_id;
guint process_result_handler_id;
&priv->ctx, \
fd, \
sender, \
- gsignond_auth_session_get_context (priv->session)); \
+ priv->app_context); \
}
static gboolean _handle_query_available_mechanisms (GSignondDbusAuthSessionAdapter *, GDBusMethodInvocation *, const gchar **, gpointer);
self->priv->connection = G_DBUS_CONNECTION (g_value_get_object (value));
break;
}
+ case PROP_APP_CONTEXT: {
+ if (self->priv->app_context) g_free (self->priv->app_context);
+ self->priv->app_context = g_strdup (g_value_get_string (value));
+ break;
+ }
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
case PROP_CONNECTION:
g_value_set_object (value, self->priv->connection);
break;
+ case PROP_APP_CONTEXT:
+ g_value_set_string (value, self->priv->app_context);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
static void
gsignond_dbus_auth_session_adapter_finalize (GObject *object)
{
+ GSignondDbusAuthSessionAdapter *self = GSIGNOND_DBUS_AUTH_SESSION_ADAPTER (object);
+
+ if (self->priv->app_context) {
+ g_free (self->priv->app_context);
+ self->priv->app_context = NULL;
+ }
G_OBJECT_CLASS (gsignond_dbus_auth_session_adapter_parent_class)->finalize (object);
}
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
+ properties[PROP_APP_CONTEXT] = g_param_spec_string (
+ "app-context",
+ "application security context",
+ "Application security context of the identity object creater",
+ NULL,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, N_PROPERTIES, properties);
}
self->priv->connection = 0;
self->priv->session = 0;
+ self->priv->app_context = 0;
self->priv->state_changed_handler_id = 0;
self->priv->process_result_handler_id = 0;
self->priv->process_erroror_handler_id = 0;
GSignondDbusAuthSessionAdapter *
gsignond_dbus_auth_session_adapter_new_with_connection (GDBusConnection *connection,
GSignondAuthSession *session,
+ const gchar *app_context,
guint timeout)
{
static guint32 object_counter;
adapter = GSIGNOND_DBUS_AUTH_SESSION_ADAPTER (
g_object_new (GSIGNOND_TYPE_DBUS_AUTH_SESSION_ADAPTER,
- "connection", connection, "auth-session", session, NULL));
+ "connection", connection, "auth-session", session, "app-context", app_context, NULL));
if (!adapter) return NULL;
#ifndef USE_P2P
GSignondDbusAuthSessionAdapter *
-gsignond_dbus_auth_session_adapter_new (GSignondAuthSession *session, guint timeout)
+gsignond_dbus_auth_session_adapter_new (GSignondAuthSession *session, const gchar *app_context, guint timeout)
{
GError *error = NULL;
GDBusConnection *connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
return NULL;
}
- return gsignond_dbus_auth_session_adapter_new_with_connection (connection, session, timeout);
+ return gsignond_dbus_auth_session_adapter_new_with_connection (connection, session, app_context, timeout);
}
#endif
GSignondDbusAuthSessionAdapter *
gsignond_dbus_auth_session_adapter_new_with_connection (GDBusConnection *connection,
GSignondAuthSession *session,
+ const gchar *app_context,
guint timeout);
#ifndef USE_P2P
GSignondDbusAuthSessionAdapter *
gsignond_dbus_auth_session_adapter_new (GSignondAuthSession *session,
+ const gchar *app_context,
guint timeout);
#endif
PROP_CONNECTION,
PROP_IDENTITY,
+ PROP_APP_CONTEXT,
N_PROPERTIES
};
GDBusConnection *connection;
GSignondDbusIdentity *dbus_identity;
GSignondIdentity *identity;
+ gchar *app_context;
GSignondSecurityContext sec_context;
GList *sessions;
/* signal handler ids */
&priv->sec_context, \
fd, \
sender, \
- gsignond_identity_get_app_context(priv->identity)); \
+ priv->app_context); \
}
static gboolean _handle_request_credentials_update (GSignondDbusIdentityAdapter *, GDBusMethodInvocation *, const gchar*, gpointer);
}
break;
}
+ case PROP_APP_CONTEXT: {
+ if (self->priv->app_context) g_free (self->priv->app_context);
+ self->priv->app_context = g_strdup (g_value_get_string (value));
+ break;
+ }
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
g_value_set_object (value, self->priv->connection);
break;
}
+ case PROP_APP_CONTEXT:{
+ g_value_set_string (value, self->priv->app_context);
+ break;
+ }
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
self->priv->sessions = NULL;
}
+ if (self->priv->app_context) {
+ g_free (self->priv->app_context);
+ self->priv->app_context = NULL;
+ }
+
G_OBJECT_CLASS (gsignond_dbus_identity_adapter_parent_class)->finalize (object);
}
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
-
+ properties[PROP_APP_CONTEXT] = g_param_spec_string (
+ "app-context",
+ "application security context",
+ "Application security context of the identity object creater",
+ NULL,
+ G_PARAM_READWRITE |G_PARAM_STATIC_STRINGS);
+
g_object_class_install_properties (object_class, N_PROPERTIES, properties);
}
self->priv->connection = 0;
self->priv->identity = 0;
+ self->priv->app_context = 0;
self->priv->dbus_identity = gsignond_dbus_identity_skeleton_new();
g_signal_connect_swapped (self->priv->dbus_identity,
if (session) {
guint timeout =gsignond_identity_get_auth_session_timeout (self->priv->identity);
GSignondDbusAuthSessionAdapter *dbus_session = gsignond_dbus_auth_session_adapter_new_with_connection (
- g_object_ref (self->priv->connection), session, timeout);
+ g_object_ref (self->priv->connection), session, self->priv->app_context, timeout);
self->priv->sessions = g_list_append (self->priv->sessions, dbus_session);
GSignondDbusIdentityAdapter *
gsignond_dbus_identity_adapter_new_with_connection (GDBusConnection *connection,
GSignondIdentity *identity,
+ const gchar *app_context,
guint timeout)
{
static guint32 object_counter;
GError *err = NULL;
GSignondDbusIdentityAdapter *adapter = GSIGNOND_DBUS_IDENTITY_ADAPTER (
g_object_new (GSIGNOND_TYPE_DBUS_IDENTITY_ADAPTER,
- "identity", identity, "connection", connection, NULL));
+ "identity", identity, "connection", connection, "app-context", app_context, NULL));
if (!adapter) return NULL;
* Retrurns: (transfer full) new instance of #GSignondDbusIdentityAdapter
*/
GSignondDbusIdentityAdapter *
-gsignond_dbus_identity_adapter_new (GSignondIdentity *identity, guint timeout)
+gsignond_dbus_identity_adapter_new (GSignondIdentity *identity, const gchar *app_context, guint timeout)
{
GError *error = NULL;
GDBusConnection *connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
return NULL;
}
- return gsignond_dbus_identity_adapter_new_with_connection (connection, identity, timeout);
+ return gsignond_dbus_identity_adapter_new_with_connection (connection, identity, app_context, timeout);
}
#endif
GSignondDbusIdentityAdapter *
gsignond_dbus_identity_adapter_new_with_connection (GDBusConnection *connection,
GSignondIdentity *identity,
+ const gchar *app_context,
guint timeout);
#ifndef USE_P2P
GSignondDbusIdentityAdapter *
gsignond_dbus_identity_adapter_new (GSignondIdentity *identity,
+ const gchar *app_context,
guint timeout);
#endif
{
PROP_0,
PROP_METHOD,
- PROP_APP_CONTEXT,
N_PROPERTIES
};
struct _GSignondAuthSessionPrivate
{
gchar *method;
- gchar *app_context;
GSignondPluginProxy *proxy;
GSequence *available_mechanisms;
GSignondIdentityInfo *identity_info;
case PROP_METHOD:
g_value_set_string (value, self->priv->method);
break;
- case PROP_APP_CONTEXT:
- g_value_set_string (value, self->priv->app_context);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
case PROP_METHOD:
self->priv->method = g_value_dup_string (value);
break;
- case PROP_APP_CONTEXT:
- self->priv->app_context = g_value_dup_string (value);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
"Authentication method used",
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY
- | G_PARAM_STATIC_STRINGS);
-
- properties[PROP_APP_CONTEXT] =
- g_param_spec_string ("app-context",
- "application security context",
- "Application security context",
- NULL,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY
- | G_PARAM_STATIC_STRINGS);
+ | G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, N_PROPERTIES, properties);
return session->priv->method;
}
-const gchar *
-gsignond_auth_session_get_context (GSignondAuthSession *session)
-{
- g_return_val_if_fail (session && GSIGNOND_IS_AUTH_SESSION (session), NULL);
-
- return session->priv->app_context;
-}
-
void
gsignond_auth_session_notify_process_result (GSignondAuthSession *iface,
GSignondSessionData *result)
/**
* gsignond_auth_session_new:
* @info: instance of #GSignondIdentityInfo
- * @app_context: application security
* @method: authentication method
*
* Creates instance of #GSignondAuthSession.
* Returns: (transfer full) newly created object
*/
GSignondAuthSession *
-gsignond_auth_session_new (GSignondIdentityInfo *info, const gchar *app_context, const gchar *method)
+gsignond_auth_session_new (GSignondIdentityInfo *info, const gchar *method)
{
GSignondPluginProxy* proxy = NULL;
GSignondAuthSession *auth_session =
g_object_new (GSIGNOND_TYPE_AUTH_SESSION,
- "method", method,
- "app-context", app_context, NULL);
+ "method", method, NULL);
auth_session->priv->proxy = proxy;
auth_session->priv->identity_info = g_hash_table_ref ((GHashTable *)info);
const gchar *
gsignond_auth_session_get_method (GSignondAuthSession *session);
-const gchar *
-gsignond_auth_session_get_context (GSignondAuthSession *session);
-
GSignondAccessControlManager *
gsignond_auth_session_get_acm (GSignondAuthSession *session);
GSignondAuthSession *
gsignond_auth_session_new (GSignondIdentityInfo *info,
- const gchar *app_context,
const gchar *method);
G_END_DECLS
return NULL;
}
- const gchar *app_context = ctx ? gsignond_security_context_get_application_context (ctx) : "";
GSignondIdentityInfo *info = gsignond_identity_info_new ();
GSignondIdentity *identity = NULL;
GSignondSecurityContext *owner = NULL;
g_list_free (acl);
DBG("register_new_identity: cache size : %d", g_hash_table_size(daemon->priv->identities));
- identity = gsignond_identity_new (daemon, info, app_context);
+ identity = gsignond_identity_new (daemon, info);
if (identity == NULL) {
gsignond_dictionary_unref (info);
ERR("Unable to register new identity");
GSignondIdentity *identity = NULL;
GSignondIdentityInfo *identity_info = NULL;
- const gchar *app_context = ctx ? gsignond_security_context_get_application_context (ctx) : "" ;
#define VALIDATE_IDENTITY_READ_ACCESS(info, ctx, ret) \
{ \
VALIDATE_IDENTITY_READ_ACCESS (identity_info, ctx, NULL);
- identity = gsignond_identity_new (daemon, identity_info, app_context);
+ identity = gsignond_identity_new (daemon, identity_info);
if (!identity) {
gsignond_identity_info_unref (identity_info);
if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_INTERNAL_SERVER, "Internal server error");
{
PROP_0,
PROP_INFO,
- PROP_APP_CONTEXT,
N_PROPERTIES
};
struct _GSignondIdentityPrivate
{
GSignondIdentityInfo *info;
- gchar *app_context;
GSignondDaemon *owner;
GHashTable *auth_sessions; // (auth_method,auth_session) table
};
case PROP_INFO:
g_value_set_boxed (value, self->priv->info);
break;
- case PROP_APP_CONTEXT:
- g_value_set_string (value, self->priv->app_context);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
self->priv->info =
(GSignondIdentityInfo *)g_value_get_boxed (value);
break;
- case PROP_APP_CONTEXT:
- self->priv->app_context = g_value_dup_string (value);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
- properties[PROP_APP_CONTEXT] = g_param_spec_string (
- "app-context",
- "application security context",
- "Application security context of the identity object creater",
- NULL,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_STRINGS);
-
-
g_object_class_install_properties (object_class, N_PROPERTIES, properties);
signals[SIG_SIGNOUT] = g_signal_new ("signout",
return NULL;
}
- session = gsignond_auth_session_new (identity->priv->info,
- identity->priv->app_context,
- method);
+ session = gsignond_auth_session_new (identity->priv->info, method);
if (!session) {
if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error");
return gsignond_daemon_get_access_control_manager (identity->priv->owner);
}
-const gchar *
-gsignond_identity_get_app_context (GSignondIdentity *identity)
-{
- g_return_val_if_fail (identity && GSIGNOND_IS_IDENTITY(identity), NULL);
-
- return identity->priv->app_context;
-}
-
guint
gsignond_identity_get_auth_session_timeout (GSignondIdentity *identity)
{
* gsignond_identity_new:
* @owner: Owner of this object, instance of #GSignondAuthServiceIface
* @info (transfer full): Identity info, instance of #GSignondIdentityInfo
- * @app_context: application security context
*
* Creates new instance of #GSignondIdentity
*
* Returns[transfer full]: new instance of #GSignondIdentity
*/
GSignondIdentity * gsignond_identity_new (GSignondDaemon *owner,
- GSignondIdentityInfo *info,
- const gchar *app_context)
+ GSignondIdentityInfo *info)
{
GSignondIdentity *identity =
GSIGNOND_IDENTITY(g_object_new (GSIGNOND_TYPE_IDENTITY,
"info", info,
- "app-context", app_context,
NULL));
identity->priv->owner = g_object_ref (owner);
GSignondIdentity *
gsignond_identity_new (GSignondDaemon *owner,
- GSignondIdentityInfo *info,
- const gchar *app_context);
+ GSignondIdentityInfo *info);
GVariant *
gsignond_identity_get_info (GSignondIdentity *identity,
GSignondIdentityInfo *
gsignond_identity_get_identity_info (GSignondIdentity *identity);
-const gchar *
-gsignond_identity_get_app_context (GSignondIdentity *identity);
-
G_END_DECLS
#endif /* __GSIGNOND_IDENTITY_H_ */