Implement dataset-level authorisation in the CITYdata using metadata-driven access control.
Requirements
- Associate each dataset with a metadata file stored in src/test/resources
- Metadata file format:
- First line: dataset type (Public, Protected, or Private)
- Following lines: usernames authorized to access the dataset
- Implement authorisation logic to:
- Validate the authenticated user
- Read the corresponding metadata file
- Check if the username is authorized
- Grant or deny access accordingly
Test Setup
Create:
- 3 datasets (public, protected, private)
- 3 corresponding metadata files
Dataset contents should contain access confirmation messages (e.g., “You have access to Public dataset”).
Unit Tests
Add tests for each dataset covering:
Positive cases
- Authorised user successfully accesses dataset
Negative cases
- Unauthorised user is denied access with an appropriate error/exception
Implement dataset-level authorisation in the
CITYdatausing metadata-driven access control.Requirements
Test Setup
Create:
Dataset contents should contain access confirmation messages (e.g., “You have access to Public dataset”).
Unit Tests
Add tests for each dataset covering:
Positive cases
Negative cases