• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mendersoftware / mender-server / 1861958901

10 Jun 2025 08:53AM UTC coverage: 65.74%. First build
1861958901

push

gitlab-ci

web-flow
Merge pull request #711 from mendersoftware/MEN-8235

Merge MEN-8235 into main

285 of 347 new or added lines in 13 files covered. (82.13%)

32499 of 49436 relevant lines covered (65.74%)

1.39 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/backend/services/deviceauth/api/http/api_handler.go
1
// Copyright 2023 Northern.tech AS
2
//
3
//        Licensed under the Apache License, Version 2.0 (the "License");
4
//        you may not use this file except in compliance with the License.
5
//        You may obtain a copy of the License at
6
//
7
//            http://www.apache.org/licenses/LICENSE-2.0
8
//
9
//        Unless required by applicable law or agreed to in writing, software
10
//        distributed under the License is distributed on an "AS IS" BASIS,
11
//        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
//        See the License for the specific language governing permissions and
13
//        limitations under the License.
14
package http
15

16
import (
17
        "net/http"
18

19
        "github.com/mendersoftware/mender-server/services/deviceauth/devauth"
20
        "github.com/mendersoftware/mender-server/services/deviceauth/store"
21
)
22

23
// thin API handler interface
24
type ApiHandler interface {
25
        // produce a rest.App with routing setup or an error
26
        Build() (http.Handler, error)
27
}
28

29
type InternalAPI struct {
30
        App devauth.App
31
        Db  store.DataStore
32
}
33

34
// NewInternalHandler returns a new InternalAPI
NEW
35
func NewInternalHandler(DevAuth devauth.App, db store.DataStore) *InternalAPI {
×
NEW
36
        return &InternalAPI{
×
NEW
37
                App: DevAuth,
×
NEW
38
                Db:  db,
×
NEW
39
        }
×
NEW
40
}
×
41

42
type ManagementAPI struct {
43
        App devauth.App
44
        Db  store.DataStore
45
}
46

47
// NewManagementHandler returns a new ManagementAPI
NEW
48
func NewManagementHandler(DevAuth devauth.App, db store.DataStore) *ManagementAPI {
×
NEW
49
        return &ManagementAPI{
×
NEW
50
                App: DevAuth,
×
NEW
51
                Db:  db,
×
NEW
52
        }
×
NEW
53
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc