https://github.com/matb85/aws-iam-parsing
Home assignment for the Remitly Summer Internship 2024 recruitment process
https://github.com/matb85/aws-iam-parsing
Last synced: 2 months ago
JSON representation
Home assignment for the Remitly Summer Internship 2024 recruitment process
- Host: GitHub
- URL: https://github.com/matb85/aws-iam-parsing
- Owner: Matb85
- Created: 2024-04-06T11:19:20.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-10T08:15:31.000Z (about 2 years ago)
- Last Synced: 2025-01-17T20:41:16.597Z (over 1 year ago)
- Language: Go
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Home assignment for the Remitly Summer Internship 2024 recruitment process
## Created by Mateusz Bis 10 IV 2024
### Features
This project impements an **verifyPolicyJSON** method that:
- takes in a single argument - an AWS IAM Policy string as []bytes
- verifies whether the []bytes string is a **valid** AWS::IAM::Role Policy
- returns a bool value: **true** if the Resource policy field contains exactly one asterisk character, otherwise it returns **false** (inluding when the policy is invalid)
The method can be executed by running main.go - it reads JSON from data.json (which should be located in the root working directory), passes it to **verifyPolicyJSON** and prints out the function's result.
### Requirements
I've tested the project on go1.22.2, I cannot guarantee it will work on older versions.
Link to download Golang version 1.22.2: https://go.dev/dl/
### Steps to run the project:
1. Clone the project
```bash
$ git clone https://github.com/Matb85/remitly-home-assignment.git
$ cd ./remitly-home-assignment
```
2. Install dependencies
```bash
$ go get ./...
# or
$ go mod download
```
3. Prepare data and insert it to the data.json file
```bash
$ echo YOURDATA >> data.json
```
4. Run the project
```bash
$ go run ./main.go
```
5. Alternatively, build & run the project
```bash
$ go build ./main.go
$ ./main
```
### Unit Tests
I have written several unit tests for **verifyPolicyJSON** and **UnmarshalJSON** methods in order to ensure that everything works as expected.
To run the test suite, execute the following command:
```bash
$ go test ./...
```