Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmaf-ingest-receiver update #216

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Generation of CMAF ingest streams with a REST-based API
- New program `cmaf-ingest-receiver` that can receive one or more CMAF ingest streams
- New option `--whitelistblocks` for unlimited number of requests to some CIDR blocks
- Much improved `cmaf-ingest-receiver`

### Fixed

Expand Down
20 changes: 11 additions & 9 deletions cmd/cmaf-ingest-receiver/app/basicauth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,19 @@ func TestBasicAuth(t *testing.T) {
defer cancel()
receiver, err := NewReceiver(ctx, &opts, &config)
require.NoError(t, err)
router := setupRouter(receiver)
router := setupRouter(receiver, opts.storage, "")
server := httptest.NewServer(router)
defer server.Close()
for _, c := range cases {
buf := bytes.NewBuffer(data)
url := fmt.Sprintf("%s%s/%s", server.URL, opts.prefix, c.url)
req, err := http.NewRequest(http.MethodPut, url, buf)
require.NoError(t, err)
req.SetBasicAuth(c.user, c.password)
resp, err := http.DefaultClient.Do(req)
require.NoError(t, err)
assert.Equal(t, c.expectedResponseCode, resp.StatusCode)
t.Run(c.desc, func(t *testing.T) {
buf := bytes.NewBuffer(data)
url := fmt.Sprintf("%s%s/%s", server.URL, opts.prefix, c.url)
req, err := http.NewRequest(http.MethodPut, url, buf)
require.NoError(t, err)
req.SetBasicAuth(c.user, c.password)
resp, err := http.DefaultClient.Do(req)
require.NoError(t, err)
assert.Equal(t, c.expectedResponseCode, resp.StatusCode)
})
}
}
Loading
Loading