Add test that unauthorized pushes are blocked
Some checks are pending
CI/CD Pipeline / Test Backend (push) Waiting to run
CI/CD Pipeline / Test Frontend (push) Waiting to run
CI/CD Pipeline / Build and Push Docker Images (push) Blocked by required conditions
CI/CD Pipeline / Deploy to Production (push) Blocked by required conditions

This commit is contained in:
continuist 2025-06-29 13:49:31 -04:00
parent 618ce2d679
commit 70407d7f35

View file

@ -756,13 +756,22 @@ docker pull YOUR_CI_CD_IP/APP_NAME/test:latest
# Verify the image was pulled successfully
docker images | grep APP_NAME/test
# Clean up test image
# Test that unauthorized push is blocked
echo "FROM alpine:latest" > /tmp/unauthorized.Dockerfile
echo "RUN echo 'This push should fail'" >> /tmp/unauthorized.Dockerfile
docker build -f /tmp/unauthorized.Dockerfile -t YOUR_CI_CD_IP/APP_NAME/unauthorized:latest /tmp
docker push YOUR_CI_CD_IP/APP_NAME/unauthorized:latest
# Expected: This should fail with authentication error
# Clean up test images
docker rmi YOUR_CI_CD_IP/APP_NAME/test:latest
docker rmi YOUR_CI_CD_IP/APP_NAME/unauthorized:latest
```
**Expected behavior**:
- ✅ **Push requires authentication**: `docker push` only works when logged in
- ✅ **Pull works without authentication**: `docker pull` works without login for public projects
- ✅ **Unauthorized push is blocked**: `docker push` fails when not logged in
- ✅ **Web UI accessible**: Harbor UI is available at `https://YOUR_CI_CD_IP`
#### 5.12 Harbor Access Model Summary