This project involves implementing client and server components that adhere to the OAuth authentication model using the RPC protocol. The implementation is based on diagrams provided in the resource directory and project file.
- Implemented in C
- Server uses a linked list as a simple database
- Global variables defined in
auth.h
for access inrpc_server.c
- Interface defined in
auth.h
- Structures and functions for the server defined in
auth.x
- Only modified the server stub (
auth_svc.c
) - Parses input files to populate linked lists
- Uses global variables for list references (due to RPC protocol limitations)
- Defined a vector of clients in
rpc_client.c
- Each client handles a user based on IDs from
client.in
- Maintains a unique list of IDs (similar to a set)
- Implements logical ordering of execution flow for operations/requests
client.in:
1. oD0prOgBqAsXBW8, REQUEST, 0
2. oD0prOgBqAsXBW8, MODIFY, Files
3. OVotQBYz418Ozkz, REQUEST, 1
4. OVotQBYz418Ozkz, EXECUTE, Applications
5. OVotQBYz418Ozkz, DELETE, Files
6. oD0prOgBqAsXBW8, INSERT, UserData
7. OVotQBYz418Ozkz, READ, System Settings
- Two clients:
client[0].user_id = "oD0prOgBqAsXBW8"
andclient[1].user_id = "OVotQBYz418Ozkz"
- Operations executed in order based on client ID
- Server returns dynamically allocated strings with helper information
- Uses
strtok
function extensively - Refresh token "signed" with number 2 to indicate access token regeneration
- Implements functions as described in the project statement
- Additional
valid_permission
function for action verification
auth.h
: Interface definition and global variablesauth.x
: Structures and functions for the serverrpc_server.c
: Server implementationrpc_client.c
: Client implementationauth_svc.c
: Modified server stub
- Contains two rules:
run_client
andrun_server
- Test index can be modified in these rules
- Newlines added to test files for validation
- Implementation focused on logical ordering of execution flow
- Server unable to modify structure fields sent by reference; workaround implemented