Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.
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: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
ci:
uses: xmidt-org/shared-go/.github/workflows/ci.yml@59f5d322b0ee953245334530336f8e6503cacb65 # v4.4.27
with:
style-skip: true
release-type: program
yaml-lint-skip: false
secrets: inherit
6 changes: 3 additions & 3 deletions deviceStatus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func TestGetStatusInfo(t *testing.T) {
{
description: "Expired Records Error",
recordsToReturn: []db.Record{
db.Record{
{
DeathDate: previousTime,
Alg: string(voynicrypto.None),
KID: "none",
Expand Down Expand Up @@ -231,7 +231,7 @@ func TestGetStatusInfo(t *testing.T) {

ciphers := voynicrypto.Ciphers{
Options: map[voynicrypto.AlgorithmType]map[string]voynicrypto.Decrypt{
voynicrypto.None: map[string]voynicrypto.Decrypt{
voynicrypto.None: {
"none": mockDecrypter,
},
},
Expand Down Expand Up @@ -335,7 +335,7 @@ func TestHandleGetStatus(t *testing.T) {

ciphers := voynicrypto.Ciphers{
Options: map[voynicrypto.AlgorithmType]map[string]voynicrypto.Decrypt{
voynicrypto.None: map[string]voynicrypto.Decrypt{
voynicrypto.None: {
"none": mockDecrypter,
},
},
Expand Down
22 changes: 11 additions & 11 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
// The purpose of this application is to provide an API
// that returns event information for a device.
//
// Schemes: https
// Host: localhost
// BasePath: /api/v1
// Version: 0.1.1
// Schemes: https
// Host: localhost
// BasePath: /api/v1
// Version: 0.1.1
//
// Produces:
// - application/json
// Produces:
// - application/json
//
// SecurityDefinitions:
// bearer_token:
// type: http
// scheme: bearer
// bearerFormat: JWT
// SecurityDefinitions:
// bearer_token:
// type: http
// scheme: bearer
// bearerFormat: JWT
//
// swagger:meta
package main
3 changes: 2 additions & 1 deletion model/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import (
//go:generate codecgen -st "json" -o event_codec.go event.go

// Event is the extension of wrp message
// https://github.com/xmidt-org/wrp-c/wiki/Web-Routing-Protocol
//
// https://github.com/xmidt-org/wrp-c/wiki/Web-Routing-Protocol
//
// swagger:response Event
type Event struct {
Expand Down
18 changes: 9 additions & 9 deletions primaryHandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func TestGetDeviceInfo(t *testing.T) {
{
description: "Expired Records Error",
recordsToReturn: []db.Record{
db.Record{
{
DeathDate: previousTime,
Alg: string(voynicrypto.None),
KID: "none",
Expand All @@ -134,7 +134,7 @@ func TestGetDeviceInfo(t *testing.T) {
},
expectedFailureMetric: 1.0,
expectedEvents: []model.Event{
model.Event{Message: wrp.Message{Type: 11}, BirthDate: 0},
{Message: wrp.Message{Type: 11}, BirthDate: 0},
},
},
{
Expand All @@ -149,7 +149,7 @@ func TestGetDeviceInfo(t *testing.T) {
},
decryptErr: errors.New("failed to decrypt"),
expectedEvents: []model.Event{
model.Event{Message: wrp.Message{Type: 11}, BirthDate: 0},
{Message: wrp.Message{Type: 11}, BirthDate: 0},
},
},
{
Expand All @@ -164,7 +164,7 @@ func TestGetDeviceInfo(t *testing.T) {
},
},
expectedEvents: []model.Event{
model.Event{Message: wrp.Message{Type: 11}, BirthDate: prevTime.UnixNano()},
{Message: wrp.Message{Type: 11}, BirthDate: prevTime.UnixNano()},
},
},
{
Expand All @@ -179,7 +179,7 @@ func TestGetDeviceInfo(t *testing.T) {
},
},
expectedEvents: []model.Event{
model.Event{Message: goodOnlineEvent, BirthDate: prevTime.UnixNano()},
{Message: goodOnlineEvent, BirthDate: prevTime.UnixNano()},
},
},
}
Expand All @@ -197,7 +197,7 @@ func TestGetDeviceInfo(t *testing.T) {

ciphers := voynicrypto.Ciphers{
Options: map[voynicrypto.AlgorithmType]map[string]voynicrypto.Decrypt{
voynicrypto.None: map[string]voynicrypto.Decrypt{
voynicrypto.None: {
"none": mockDecrypter,
},
},
Expand Down Expand Up @@ -356,7 +356,7 @@ func TestHandleGetEvents(t *testing.T) {

ciphers := voynicrypto.Ciphers{
Options: map[voynicrypto.AlgorithmType]map[string]voynicrypto.Decrypt{
voynicrypto.None: map[string]voynicrypto.Decrypt{
voynicrypto.None: {
"none": new(voynicrypto.NOOP),
},
},
Expand Down Expand Up @@ -436,7 +436,7 @@ func TestLongPoll(t *testing.T) {
},
},
expectedEvents: []model.Event{
model.Event{Message: wrp.Message{Type: 11}, BirthDate: birthDate},
{Message: wrp.Message{Type: 11}, BirthDate: birthDate},
},
contextTimeout: time.Minute,
longPollTimeout: time.Minute,
Expand All @@ -453,7 +453,7 @@ func TestLongPoll(t *testing.T) {

ciphers := voynicrypto.Ciphers{
Options: map[voynicrypto.AlgorithmType]map[string]voynicrypto.Decrypt{
voynicrypto.None: map[string]voynicrypto.Decrypt{
voynicrypto.None: {
"none": new(voynicrypto.NOOP),
},
},
Expand Down
Loading