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

mendersoftware / mender / 1057366047

01 Nov 2023 08:50AM UTC coverage: 80.121% (-0.07%) from 80.195%
1057366047

push

gitlab-ci

kacf
fix: Don't cache server URL and token locally in process.

The problem if we do is that is that we may then connect to a
forwarder address which doesn't exist anymore. This produces
"connection refused", not "Not authorized", and therefore it does not
trigger an authentication request by itself. So always ask.

This can be easily reproduced by bringing up both mender-auth and
mender-update, and then restarting mender-auth after the first auth
cycle.

This makes the whole `AuthenticatorExternalTokenUpdateTest` test
irrelevant, since we no longer need to test the caching capability of
the client side authenticator. So just remove it.

Changelog: None
Ticket: None

Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>

6 of 6 new or added lines in 1 file covered. (100.0%)

6884 of 8592 relevant lines covered (80.12%)

9363.06 hits per line

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

71.43
/src/common/identity_parser/identity_parser.cpp
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

15
#include <common/identity_parser.hpp>
16

17
#include <common/key_value_parser.hpp>
18
#include <common/processes.hpp>
19

20
namespace mender {
21
namespace common {
22
namespace identity_parser {
23

24
using namespace std;
25
namespace kvp = mender::common::key_value_parser;
26
namespace procs = mender::common::processes;
27

28
kvp::ExpectedKeyValuesMap GetIdentityData(const string &identity_data_generator) {
7✔
29
        procs::Process proc({identity_data_generator});
35✔
30
        auto ex_line_data = proc.GenerateLineData();
7✔
31
        if (!ex_line_data) {
7✔
32
                return expected::unexpected(
×
33
                        ex_line_data.error().WithContext("While getting identity data"));
×
34
        }
35

36
        auto ex_key_values = kvp::ParseKeyValues(ex_line_data.value());
7✔
37
        return ex_key_values;
38
}
39

40
} // namespace identity_parser
41
} // namespace common
42
} // namespace mender
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