GUACAMOLE-5: Implement JavaScript service for retrieving sharing credentials from an active connection.
This commit is contained in:
1 parent
c6ce92bd0a
commit
62dcd9e9ec
3 files changed
+205
No files matched your search
@@ -166,6 +166,41 @@ angular.module('rest').factory('activeConnectionService', ['$injector',
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Makes a request to the REST API to generate credentials which have
|
||||
* access strictly to the given active connection, using the restrictions
|
||||
* defined by the given sharing profile, returning a promise that provides
|
||||
* the resulting @link{UserCredentials} object if successful.
|
||||
*
|
||||
* @param {String} id
|
||||
* The identifier of the active connection being shared.
|
||||
*
|
||||
* @param {String} sharingProfile
|
||||
* The identifier of the sharing profile dictating the
|
||||
* semantics/restrictions which apply to the shared session.
|
||||
*
|
||||
* @returns {Promise.<UserCredentials>}
|
||||
* A promise which will resolve with a @link{UserCredentials} object
|
||||
* upon success.
|
||||
*/
|
||||
service.getSharingCredentials = function getSharingCredentials(dataSource, id, sharingProfile) {
|
||||
|
||||
// Build HTTP parameters set
|
||||
var httpParameters = {
|
||||
token : authenticationService.getCurrentToken()
|
||||
};
|
||||
|
||||
// Generate sharing credentials
|
||||
return $http({
|
||||
method : 'GET',
|
||||
url : 'api/session/data/' + encodeURIComponent(dataSource)
|
||||
+ '/activeConnections/' + encodeURIComponent(id)
|
||||
+ '/sharingCredentials/' + encodeURIComponent(sharingProfile),
|
||||
params : httpParameters
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
return service;
|
||||
|
||||
}]);
|
||||
@@ -68,6 +68,43 @@ angular.module('rest').factory('tunnelService', ['$injector',
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Makes a request to the REST API to generate credentials which have
|
||||
* access strictly to the active connection associated with the given
|
||||
* tunnel, using the restrictions defined by the given sharing profile,
|
||||
* returning a promise that provides the resulting @link{UserCredentials}
|
||||
* object if successful.
|
||||
*
|
||||
* @param {String} tunnel
|
||||
* The UUID of the tunnel associated with the Guacamole connection
|
||||
* being shared.
|
||||
*
|
||||
* @param {String} sharingProfile
|
||||
* The identifier of the connection object dictating the
|
||||
* semantics/restrictions which apply to the shared session.
|
||||
*
|
||||
* @returns {Promise.<UserCredentials>}
|
||||
* A promise which will resolve with a @link{UserCredentials} object
|
||||
* upon success.
|
||||
*/
|
||||
service.getSharingCredentials = function getSharingCredentials(tunnel, sharingProfile) {
|
||||
|
||||
// Build HTTP parameters set
|
||||
var httpParameters = {
|
||||
token : authenticationService.getCurrentToken()
|
||||
};
|
||||
|
||||
// Generate sharing credentials
|
||||
return $http({
|
||||
method : 'GET',
|
||||
url : 'api/session/tunnels/' + encodeURIComponent(tunnel)
|
||||
+ '/activeConnection/sharingCredentials/'
|
||||
+ encodeURIComponent(sharingProfile),
|
||||
params : httpParameters
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Makes a request to the REST API to retrieve the contents of a stream
|
||||
* which has been created within the active Guacamole connection associated
|
||||
|
||||
Reference in new issue
Block a user