Continue development of Authentication Token Validation Service and
the use of it by AuthTokenValidate.
This commit is contained in:
parent
e77685f605
commit
20608a9f65
@ -26,7 +26,7 @@ DIST_SUBDIRS = linux
|
||||
|
||||
CFILES =
|
||||
|
||||
EXTRA_DIST = $(CFILES) *.h
|
||||
EXTRA_DIST = $(CFILES)
|
||||
|
||||
.PHONY: package package-clean package-install package-uninstall
|
||||
package package-clean package-install package-uninstall:
|
||||
|
@ -112,7 +112,7 @@ GrowWorkerThreadPool(int growNumber)
|
||||
// Notes: The serverMutex needs to be held when calling this
|
||||
// procedure.
|
||||
//
|
||||
// L0
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
DbgTrace(1, "GrowWorkerThreadPool- Start\n", 0);
|
||||
@ -157,7 +157,7 @@ WorkerThreadBusy(void)
|
||||
//
|
||||
// Notes:
|
||||
//
|
||||
// L0
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
DbgTrace(1, "WorkerThreadBusy- Start\n", 0);
|
||||
@ -191,7 +191,7 @@ WorkerThreadWaiting(void)
|
||||
//
|
||||
// Notes:
|
||||
//
|
||||
// L0
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
bool retValue;
|
||||
@ -237,7 +237,7 @@ WorkerThread(void*)
|
||||
//
|
||||
// Notes:
|
||||
//
|
||||
// L0
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
bool perishingThread = false;
|
||||
@ -282,6 +282,7 @@ WorkerThread(void*)
|
||||
// references later.
|
||||
env->PushLocalFrame(10);
|
||||
|
||||
// Encapsulate the request data into a string object
|
||||
jstring inString = env->NewStringUTF(pReqData);
|
||||
if (inString)
|
||||
{
|
||||
@ -289,7 +290,8 @@ WorkerThread(void*)
|
||||
jstring outString = (jstring) env->CallStaticObjectMethod(helperClass, mId, inString);
|
||||
if (outString)
|
||||
{
|
||||
// The helper method succeded, complete the request.
|
||||
// The helper method succeded, complete the request
|
||||
// with the data returned.
|
||||
const char *pOutChars = env->GetStringUTFChars(outString, NULL);
|
||||
if (pOutChars)
|
||||
{
|
||||
@ -424,7 +426,7 @@ InitJavaInvoke(void)
|
||||
//
|
||||
// Notes:
|
||||
//
|
||||
// L0
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
int retStatus = -1;
|
||||
@ -469,7 +471,7 @@ UnInitJavaInvoke(void)
|
||||
//
|
||||
// Notes:
|
||||
//
|
||||
// L0
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
DbgTrace(1, "UnInitJavaInvoke- Start\n", 0);
|
||||
@ -498,7 +500,7 @@ DaemonInit(
|
||||
// Notes: Copy of daemon_init() in Richard Stevens Unix Network
|
||||
// Programming Book.
|
||||
//
|
||||
// L0
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
pid_t pid;
|
||||
@ -647,7 +649,7 @@ main(
|
||||
//
|
||||
// Notes:
|
||||
//
|
||||
// L0
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
int optionsSpecified = 0;
|
||||
|
@ -26,7 +26,7 @@ DIST_SUBDIRS = linux
|
||||
|
||||
CFILES =
|
||||
|
||||
EXTRA_DIST = $(CFILES) *.h
|
||||
EXTRA_DIST = $(CFILES)
|
||||
|
||||
.PHONY: package package-clean package-install package-uninstall
|
||||
package package-clean package-install package-uninstall:
|
||||
|
80
CASA-auth-token/non-java/utilities/IpcLibs/README
Normal file
80
CASA-auth-token/non-java/utilities/IpcLibs/README
Normal file
@ -0,0 +1,80 @@
|
||||
/***********************************************************************
|
||||
*
|
||||
* README for IpcLibs
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
INTRODUCTION
|
||||
|
||||
IpcLibs provides an IPC infrastructure that can be linked into client and server
|
||||
applications.
|
||||
|
||||
IpcLibs provides IPC communications over TCP or DOMAIN sockets. It does this in a scalable
|
||||
and un-serialized manner. The infrastructure can make use of multiple communication channels
|
||||
between a client and a server and is capabled of concurrently serving multiple requests over
|
||||
the different channels.
|
||||
|
||||
The IpcLib APIs are very simple to utilize and support multi-threaded applications.
|
||||
|
||||
SERVER APPLICATION PROGRAMMING NOTES
|
||||
|
||||
The IPC API for server applications is defined in casa_s_ipc.h. This API is provided by
|
||||
libcasa_s_ipc.so.
|
||||
|
||||
To utilize the IPC server services, an application must first initialize the infrastructure by
|
||||
calling IpcServerInit() which is then followed by the desired IpcServerSetXXAddress() call.
|
||||
|
||||
After the Ipc server is initialized and the server address is set, then the application calls
|
||||
IpcServerStart() to start the engine (This causes the engine to start to accept connections and
|
||||
receive requests from clients).
|
||||
|
||||
To start servicing requests, the application executesIpcServerGetRequest(); this calls blocks until
|
||||
a request is ready to be serviced at which time it returns with an ID which is associated with the
|
||||
request that needs to be serviced. The returned ID is then used by the application to retrieve the
|
||||
request data via the IpcServerGetRequestData(), once the application processes the request, it
|
||||
completes it by executing IpcServerCompleteRequest() with the ID and any data that it may want to
|
||||
send back to the client.
|
||||
|
||||
Note that a server application can call IpcServerGetRequest() from multiple threads to make itself
|
||||
more scalable.
|
||||
|
||||
For an example server application that utilizes the IPC API for servers, see file
|
||||
linux/server/test/testServer.c.
|
||||
|
||||
CLIENT APPLICATION PROGRAMMING NOTES
|
||||
|
||||
The IPC API for client applications is defined in casa_c_ipc.h. This API is provided by
|
||||
libcasa_c_ipc.so.
|
||||
|
||||
To utilize the IPC client services, an application must first initialize the infrastructure by
|
||||
calling IpcClientInit(). Once the IPC client is initialized, then the application needs to open
|
||||
endpoints for the servers that it wishes to submit requests. Endpoints are opened by calling the
|
||||
appropriate IpcClientOpenXXRemoteEndPoint() with information about the server listen address.
|
||||
|
||||
IpcClientOpenXXRemoteEndpoint() calls return a handles that are associated with the opened
|
||||
endpoints. This endpoint handles are then utilized by the application to specify the target of
|
||||
IPC requests.
|
||||
|
||||
To submit a request to a particular endpoint, the application executes IpcClientSubmitReq() with
|
||||
the endpoint handle and the request data. Calls to IpcClientSubmitReq() block until the requests
|
||||
is processed by the server at which time it returns the reply data.
|
||||
|
||||
For an example client application that utilizes the IPC API for clients, see file
|
||||
linux/client/test/testClient.c.
|
||||
|
||||
SECURITY CONSIDERATIONS
|
||||
|
||||
IpcLibs does not provide any security features beyond what is provided by the protocol stacks for
|
||||
tcp/ip and Domain sockets communications.
|
||||
|
||||
By leveraging the File System Access Control features, you can scope communications that occur over
|
||||
Domain sockets to specific or groups of users.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
14
CASA-auth-token/non-java/utilities/IpcLibs/TODO
Normal file
14
CASA-auth-token/non-java/utilities/IpcLibs/TODO
Normal file
@ -0,0 +1,14 @@
|
||||
/***********************************************************************
|
||||
*
|
||||
* TODO for IpcLibs
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
INTRODUCTION
|
||||
|
||||
This file contains a list of the items still outstanding for IpcLibs.
|
||||
|
||||
OUTSTANDING ITEMS
|
||||
|
||||
- Add APIs to allow for the senging of fragmented request and reply data.
|
||||
|
@ -26,7 +26,7 @@ DIST_SUBDIRS = common client server
|
||||
|
||||
CFILES =
|
||||
|
||||
EXTRA_DIST = $(CFILES) *.h
|
||||
EXTRA_DIST = $(CFILES)
|
||||
|
||||
.PHONY: package package-clean package-install package-uninstall
|
||||
package package-clean package-install package-uninstall:
|
||||
|
@ -385,7 +385,7 @@ CChannel::connectionThread(
|
||||
//
|
||||
// Notes:
|
||||
//
|
||||
// L1
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
CChannel *pCChannel = *pSmartCChannel;
|
||||
|
@ -116,7 +116,7 @@ IpcClientOpenUnixRemoteEndPoint(
|
||||
// Note: The service should have been initialized before calling
|
||||
// this procedure.
|
||||
//
|
||||
// L0
|
||||
// L1
|
||||
//=======================================================================--
|
||||
{
|
||||
int retStatus = -1;
|
||||
@ -216,7 +216,7 @@ IpcClientOpenInetRemoteEndPoint(
|
||||
// Note: The service should have been initialized before calling
|
||||
// this procedure.
|
||||
//
|
||||
// L0
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
int retStatus = -1;
|
||||
@ -305,7 +305,7 @@ IpcClientCloseRemoteEndPoint(
|
||||
// Note: The service should have been initialized before calling
|
||||
// this procedure.
|
||||
//
|
||||
// L0
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
int retStatus = -1;
|
||||
@ -398,7 +398,7 @@ IpcClientSubmitReq(
|
||||
// The buffer returned with the server data must be released
|
||||
// by the calling application by calling free().
|
||||
//
|
||||
// L0
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
int retStatus = -1;
|
||||
@ -485,7 +485,7 @@ IpcClientInit(
|
||||
// Note: It is necessary to call the appropriate function to
|
||||
// set the server address before a request can be submitted.
|
||||
//
|
||||
// L1
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
int retStatus = -1;
|
||||
@ -552,7 +552,7 @@ IpcClientShutdown(void)
|
||||
//
|
||||
// Abstract: Method to shutdown the IPC infrastructure for process.
|
||||
//
|
||||
// L0
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
DbgTrace(1, "IpcClientShutdown- Start\n", 0);
|
||||
|
@ -75,7 +75,7 @@ RemoteEndPoint::RemoteEndPoint(
|
||||
//
|
||||
// Notes:
|
||||
//
|
||||
// L0
|
||||
// L1
|
||||
//=======================================================================--
|
||||
{
|
||||
DbgTrace(1, "RemoteEndPoint::RemoteEndPoint- Start, Obj = %08X\n", this);
|
||||
@ -135,7 +135,7 @@ RemoteEndPoint::RemoteEndPoint(
|
||||
//
|
||||
// Notes:
|
||||
//
|
||||
// L0
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
DbgTrace(1, "RemoteEndPoint::RemoteEndPoint- Start, Obj = %08X\n", this);
|
||||
@ -188,7 +188,7 @@ RemoteEndPoint::~RemoteEndPoint(void)
|
||||
//
|
||||
// Notes:
|
||||
//
|
||||
// L0
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
DbgTrace(1, "RemoteEndPoint::~RemoteEndPoint- Start, Obj = %08X\n", this);
|
||||
@ -224,7 +224,7 @@ RemoteEndPoint::getCChannel(void)
|
||||
//
|
||||
// Notes:
|
||||
//
|
||||
// L0
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
SmartCChannel *pSmartCChannel = NULL;
|
||||
@ -337,7 +337,7 @@ RemoteEndPoint::submitReq(
|
||||
//
|
||||
// Notes:
|
||||
//
|
||||
// L0
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
int retStatus = -1;
|
||||
|
@ -134,7 +134,7 @@ ServiceRequest(
|
||||
//
|
||||
// Notes:
|
||||
//
|
||||
// L1
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
int retStatus = -1;
|
||||
@ -707,7 +707,7 @@ IpcServerGetRequest(void)
|
||||
// An application can execute this method from multiple
|
||||
// threads to allow requests to be process concurrently.
|
||||
//
|
||||
// L1
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
int32_t requestId = 0;
|
||||
@ -834,7 +834,7 @@ IpcServerGetRequestData(
|
||||
// data indicated. You may be able to leverage this to
|
||||
// treat the data as a NULL terminated string in cases
|
||||
// where the request consists of ASCII characters.
|
||||
// L1
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
int32_t reqDataLen = 0;
|
||||
@ -900,7 +900,7 @@ IpcServerCompleteRequest(
|
||||
//
|
||||
// Notes: The returned buffer will not NOT be released by the method.
|
||||
//
|
||||
// L1
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
DbgTrace(1, "IpcServerCompleteRequest- Start, requestId = %08X\n", requestId);
|
||||
@ -962,7 +962,7 @@ IpcServerAbortRequest(
|
||||
//
|
||||
// Notes:
|
||||
//
|
||||
// L1
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
DbgTrace(1, "IpcServerAbortRequest- Start, requestId = %08X\n", requestId);
|
||||
|
Loading…
Reference in New Issue
Block a user