docstring_tokens stringlengths 0 76.5k | code_tokens stringlengths 75 1.81M | label_window listlengths 4 2.12k | html_url stringlengths 74 116 | file_name stringlengths 3 311 |
|---|---|---|---|---|
a, err = newAccessCtx(nil, clients, nil)
require.NoError(t, err) | <mask> if !tc.allowed {
<mask> allowedRules, disallowedRules = disallowedRules, allowedRules
<mask> }
<mask>
<mask> aCtx, err := newAccessCtx(allowedRules, disallowedRules, nil)
<mask> require.NoError(t, err)
<mask>
<mask> disallowed, rule := aCtx.IsBlockedIP(tc.ip)
<mask> assert.Equal(t, tc.wantDis, disallowed)
<mask> assert.Equal(t, tc.wantRule, rule)
<mask> })
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove disallowed, rule := aCtx.IsBlockedIP(tc.ip)
assert.Equal(t, tc.wantDis, disallowed)
assert.Equal(t, tc.wantRule, rule)
})
}
</s> add assert.True(t, a.isBlockedClientID(clientID)) </s> remove if !tc.allowed {
allowedRules, disallowedRules = disallowedRules, allowedRules
}
</s> add assert.False(t, a.isBlockedClientID(clientID)) </s> remove t.Run(prefix+tc.name, func(t *testing.T) {
allowedRules := rules
var disallowedRules []string
</s> add a, err := newAccessCtx(clients, nil, nil)
require.NoError(t, err) </s> remove assert.Equal(t, h.WHOISInfo, whois)
</s> add assert.Equal(t, rc.WHOISInfo, whois) </s> remove func TestIsBlockedDomain(t *testing.T) {
aCtx, err := newAccessCtx(nil, nil, []string{
</s> add func TestIsBlockedHost(t *testing.T) {
a, err := newAccessCtx(nil, nil, []string{ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/access_test.go |
assert.True(t, a.isBlockedClientID(clientID)) | <mask>
<mask> aCtx, err := newAccessCtx(allowedRules, disallowedRules, nil)
<mask> require.NoError(t, err)
<mask>
<mask> disallowed, rule := aCtx.IsBlockedIP(tc.ip)
<mask> assert.Equal(t, tc.wantDis, disallowed)
<mask> assert.Equal(t, tc.wantRule, rule)
<mask> })
<mask> }
<mask> }
<mask>
<mask> func TestIsBlockedDomain(t *testing.T) {
<mask> aCtx, err := newAccessCtx(nil, nil, []string{
<mask> "host1",
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove aCtx, err := newAccessCtx(allowedRules, disallowedRules, nil)
require.NoError(t, err)
</s> add a, err = newAccessCtx(nil, clients, nil)
require.NoError(t, err) </s> remove func TestIsBlockedDomain(t *testing.T) {
aCtx, err := newAccessCtx(nil, nil, []string{
</s> add func TestIsBlockedHost(t *testing.T) {
a, err := newAccessCtx(nil, nil, []string{ </s> remove if !tc.allowed {
allowedRules, disallowedRules = disallowedRules, allowedRules
}
</s> add assert.False(t, a.isBlockedClientID(clientID)) </s> remove t.Run(prefix+tc.name, func(t *testing.T) {
allowedRules := rules
var disallowedRules []string
</s> add a, err := newAccessCtx(clients, nil, nil)
require.NoError(t, err) </s> remove ok, err := clients.AddHost("1.1.1.1", "host1", ClientSourceRDNS)
</s> add ok, err := clients.AddHost(net.IP{1, 1, 1, 1}, "host1", ClientSourceRDNS) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/access_test.go |
func TestIsBlockedHost(t *testing.T) {
a, err := newAccessCtx(nil, nil, []string{ | <mask> })
<mask> }
<mask> }
<mask>
<mask> func TestIsBlockedDomain(t *testing.T) {
<mask> aCtx, err := newAccessCtx(nil, nil, []string{
<mask> "host1",
<mask> "*.host.com",
<mask> "||host3.com^",
<mask> })
<mask> require.NoError(t, err)
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove disallowed, rule := aCtx.IsBlockedIP(tc.ip)
assert.Equal(t, tc.wantDis, disallowed)
assert.Equal(t, tc.wantRule, rule)
})
}
</s> add assert.True(t, a.isBlockedClientID(clientID)) </s> remove ok, err := clients.AddHost("1.1.1.1", "host1", ClientSourceRDNS)
</s> add ok, err := clients.AddHost(net.IP{1, 1, 1, 1}, "host1", ClientSourceRDNS) </s> remove aCtx, err := newAccessCtx(allowedRules, disallowedRules, nil)
require.NoError(t, err)
</s> add a, err = newAccessCtx(nil, clients, nil)
require.NoError(t, err) </s> remove clients.SetWHOISInfo("1.1.1.2", whois)
require.Nil(t, clients.ipToRC["1.1.1.2"])
</s> add clients.SetWHOISInfo(ip, whois)
v, _ := clients.ipToRC.Get(ip)
require.Nil(t, v)
</s> remove assert.True(t, clients.Exists("1.2.3.4", ClientSourceDHCP))
</s> add assert.True(t, ok)
assert.True(t, clients.Exists(ip, ClientSourceDHCP)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/access_test.go |
name string
host string
want bool | <mask> })
<mask> require.NoError(t, err)
<mask>
<mask> testCases := []struct {
<mask> name string
<mask> domain string
<mask> want bool
<mask> }{{
<mask> name: "plain_match",
<mask> domain: "host1",
<mask> want: true,
<mask> }, {
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove name: "plain_match",
domain: "host1",
want: true,
</s> add name: "plain_match",
host: "host1",
want: true, </s> remove proto string
</s> add net string
proto proxy.Proto </s> remove name: "plain_mismatch",
domain: "host2",
want: false,
</s> add name: "plain_mismatch",
host: "host2",
want: false, </s> remove func TestProcessClientID_https(t *testing.T) {
</s> add func TestClientIDFromDNSContextHTTPS(t *testing.T) { </s> remove proto string
</s> add proto proxy.Proto | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/access_test.go |
name: "plain_match",
host: "host1",
want: true, | <mask> name string
<mask> domain string
<mask> want bool
<mask> }{{
<mask> name: "plain_match",
<mask> domain: "host1",
<mask> want: true,
<mask> }, {
<mask> name: "plain_mismatch",
<mask> domain: "host2",
<mask> want: false,
<mask> }, {
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove name string
domain string
want bool
</s> add name string
host string
want bool </s> remove name: "plain_mismatch",
domain: "host2",
want: false,
</s> add name: "plain_mismatch",
host: "host2",
want: false, </s> remove name: "wildcard_type-1_match_short",
domain: "asdf.host.com",
want: true,
</s> add name: "subdomain_match_short",
host: "asdf.host.com",
want: true, </s> remove name: "wildcard_type-1_mismatch_no-lead",
domain: "host.com",
want: false,
</s> add name: "subdomain_mismatch_no_lead",
host: "host.com",
want: false, </s> remove name: "wildcard_type-1_mismatch_bad-asterisk",
domain: "asdf.zhost.com",
want: false,
</s> add name: "subdomain_mismatch_bad_asterisk",
host: "asdf.zhost.com",
want: false, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/access_test.go |
name: "plain_mismatch",
host: "host2",
want: false, | <mask> name: "plain_match",
<mask> domain: "host1",
<mask> want: true,
<mask> }, {
<mask> name: "plain_mismatch",
<mask> domain: "host2",
<mask> want: false,
<mask> }, {
<mask> name: "wildcard_type-1_match_short",
<mask> domain: "asdf.host.com",
<mask> want: true,
<mask> }, {
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove name: "wildcard_type-1_match_short",
domain: "asdf.host.com",
want: true,
</s> add name: "subdomain_match_short",
host: "asdf.host.com",
want: true, </s> remove name: "plain_match",
domain: "host1",
want: true,
</s> add name: "plain_match",
host: "host1",
want: true, </s> remove name: "wildcard_type-1_match_long",
domain: "qwer.asdf.host.com",
want: true,
</s> add name: "subdomain_match_long",
host: "qwer.asdf.host.com",
want: true, </s> remove name: "wildcard_type-2_match_simple",
domain: "host3.com",
want: true,
</s> add name: "rule_match_simple",
host: "host3.com",
want: true, </s> remove name: "wildcard_type-1_mismatch_no-lead",
domain: "host.com",
want: false,
</s> add name: "subdomain_mismatch_no_lead",
host: "host.com",
want: false, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/access_test.go |
name: "subdomain_match_short",
host: "asdf.host.com",
want: true, | <mask> name: "plain_mismatch",
<mask> domain: "host2",
<mask> want: false,
<mask> }, {
<mask> name: "wildcard_type-1_match_short",
<mask> domain: "asdf.host.com",
<mask> want: true,
<mask> }, {
<mask> name: "wildcard_type-1_match_long",
<mask> domain: "qwer.asdf.host.com",
<mask> want: true,
<mask> }, {
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove name: "plain_mismatch",
domain: "host2",
want: false,
</s> add name: "plain_mismatch",
host: "host2",
want: false, </s> remove name: "wildcard_type-1_match_long",
domain: "qwer.asdf.host.com",
want: true,
</s> add name: "subdomain_match_long",
host: "qwer.asdf.host.com",
want: true, </s> remove name: "wildcard_type-1_mismatch_no-lead",
domain: "host.com",
want: false,
</s> add name: "subdomain_mismatch_no_lead",
host: "host.com",
want: false, </s> remove name: "plain_match",
domain: "host1",
want: true,
</s> add name: "plain_match",
host: "host1",
want: true, </s> remove name: "wildcard_type-2_match_simple",
domain: "host3.com",
want: true,
</s> add name: "rule_match_simple",
host: "host3.com",
want: true, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/access_test.go |
name: "subdomain_match_long",
host: "qwer.asdf.host.com",
want: true, | <mask> name: "wildcard_type-1_match_short",
<mask> domain: "asdf.host.com",
<mask> want: true,
<mask> }, {
<mask> name: "wildcard_type-1_match_long",
<mask> domain: "qwer.asdf.host.com",
<mask> want: true,
<mask> }, {
<mask> name: "wildcard_type-1_mismatch_no-lead",
<mask> domain: "host.com",
<mask> want: false,
<mask> }, {
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove name: "wildcard_type-1_match_short",
domain: "asdf.host.com",
want: true,
</s> add name: "subdomain_match_short",
host: "asdf.host.com",
want: true, </s> remove name: "wildcard_type-1_mismatch_no-lead",
domain: "host.com",
want: false,
</s> add name: "subdomain_mismatch_no_lead",
host: "host.com",
want: false, </s> remove name: "plain_mismatch",
domain: "host2",
want: false,
</s> add name: "plain_mismatch",
host: "host2",
want: false, </s> remove name: "wildcard_type-1_mismatch_bad-asterisk",
domain: "asdf.zhost.com",
want: false,
</s> add name: "subdomain_mismatch_bad_asterisk",
host: "asdf.zhost.com",
want: false, </s> remove name: "wildcard_type-2_match_simple",
domain: "host3.com",
want: true,
</s> add name: "rule_match_simple",
host: "host3.com",
want: true, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/access_test.go |
name: "subdomain_mismatch_no_lead",
host: "host.com",
want: false, | <mask> name: "wildcard_type-1_match_long",
<mask> domain: "qwer.asdf.host.com",
<mask> want: true,
<mask> }, {
<mask> name: "wildcard_type-1_mismatch_no-lead",
<mask> domain: "host.com",
<mask> want: false,
<mask> }, {
<mask> name: "wildcard_type-1_mismatch_bad-asterisk",
<mask> domain: "asdf.zhost.com",
<mask> want: false,
<mask> }, {
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove name: "wildcard_type-1_mismatch_bad-asterisk",
domain: "asdf.zhost.com",
want: false,
</s> add name: "subdomain_mismatch_bad_asterisk",
host: "asdf.zhost.com",
want: false, </s> remove name: "wildcard_type-1_match_long",
domain: "qwer.asdf.host.com",
want: true,
</s> add name: "subdomain_match_long",
host: "qwer.asdf.host.com",
want: true, </s> remove name: "wildcard_type-2_match_simple",
domain: "host3.com",
want: true,
</s> add name: "rule_match_simple",
host: "host3.com",
want: true, </s> remove name: "wildcard_type-1_match_short",
domain: "asdf.host.com",
want: true,
</s> add name: "subdomain_match_short",
host: "asdf.host.com",
want: true, </s> remove name: "plain_mismatch",
domain: "host2",
want: false,
</s> add name: "plain_mismatch",
host: "host2",
want: false, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/access_test.go |
name: "subdomain_mismatch_bad_asterisk",
host: "asdf.zhost.com",
want: false, | <mask> name: "wildcard_type-1_mismatch_no-lead",
<mask> domain: "host.com",
<mask> want: false,
<mask> }, {
<mask> name: "wildcard_type-1_mismatch_bad-asterisk",
<mask> domain: "asdf.zhost.com",
<mask> want: false,
<mask> }, {
<mask> name: "wildcard_type-2_match_simple",
<mask> domain: "host3.com",
<mask> want: true,
<mask> }, {
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove name: "wildcard_type-1_mismatch_no-lead",
domain: "host.com",
want: false,
</s> add name: "subdomain_mismatch_no_lead",
host: "host.com",
want: false, </s> remove name: "wildcard_type-2_match_simple",
domain: "host3.com",
want: true,
</s> add name: "rule_match_simple",
host: "host3.com",
want: true, </s> remove name: "wildcard_type-1_match_long",
domain: "qwer.asdf.host.com",
want: true,
</s> add name: "subdomain_match_long",
host: "qwer.asdf.host.com",
want: true, </s> remove name: "wildcard_type-2_match_complex",
domain: "asdf.host3.com",
want: true,
</s> add name: "rule_match_complex",
host: "asdf.host3.com",
want: true, </s> remove name: "plain_mismatch",
domain: "host2",
want: false,
</s> add name: "plain_mismatch",
host: "host2",
want: false, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/access_test.go |
name: "rule_match_simple",
host: "host3.com",
want: true, | <mask> name: "wildcard_type-1_mismatch_bad-asterisk",
<mask> domain: "asdf.zhost.com",
<mask> want: false,
<mask> }, {
<mask> name: "wildcard_type-2_match_simple",
<mask> domain: "host3.com",
<mask> want: true,
<mask> }, {
<mask> name: "wildcard_type-2_match_complex",
<mask> domain: "asdf.host3.com",
<mask> want: true,
<mask> }, {
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove name: "wildcard_type-1_mismatch_bad-asterisk",
domain: "asdf.zhost.com",
want: false,
</s> add name: "subdomain_mismatch_bad_asterisk",
host: "asdf.zhost.com",
want: false, </s> remove name: "wildcard_type-2_match_complex",
domain: "asdf.host3.com",
want: true,
</s> add name: "rule_match_complex",
host: "asdf.host3.com",
want: true, </s> remove name: "wildcard_type-1_mismatch_no-lead",
domain: "host.com",
want: false,
</s> add name: "subdomain_mismatch_no_lead",
host: "host.com",
want: false, </s> remove name: "plain_mismatch",
domain: "host2",
want: false,
</s> add name: "plain_mismatch",
host: "host2",
want: false, </s> remove name: "wildcard_type-1_match_long",
domain: "qwer.asdf.host.com",
want: true,
</s> add name: "subdomain_match_long",
host: "qwer.asdf.host.com",
want: true, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/access_test.go |
name: "rule_match_complex",
host: "asdf.host3.com",
want: true, | <mask> name: "wildcard_type-2_match_simple",
<mask> domain: "host3.com",
<mask> want: true,
<mask> }, {
<mask> name: "wildcard_type-2_match_complex",
<mask> domain: "asdf.host3.com",
<mask> want: true,
<mask> }, {
<mask> name: "wildcard_type-2_mismatch",
<mask> domain: ".host3.com",
<mask> want: false,
<mask> }}
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove name: "wildcard_type-2_match_simple",
domain: "host3.com",
want: true,
</s> add name: "rule_match_simple",
host: "host3.com",
want: true, </s> remove name: "wildcard_type-2_mismatch",
domain: ".host3.com",
want: false,
</s> add name: "rule_mismatch",
host: ".host3.com",
want: false, </s> remove name: "wildcard_type-1_mismatch_bad-asterisk",
domain: "asdf.zhost.com",
want: false,
</s> add name: "subdomain_mismatch_bad_asterisk",
host: "asdf.zhost.com",
want: false, </s> remove name: "plain_mismatch",
domain: "host2",
want: false,
</s> add name: "plain_mismatch",
host: "host2",
want: false, </s> remove name: "wildcard_type-1_match_long",
domain: "qwer.asdf.host.com",
want: true,
</s> add name: "subdomain_match_long",
host: "qwer.asdf.host.com",
want: true, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/access_test.go |
name: "rule_mismatch",
host: ".host3.com",
want: false, | <mask> name: "wildcard_type-2_match_complex",
<mask> domain: "asdf.host3.com",
<mask> want: true,
<mask> }, {
<mask> name: "wildcard_type-2_mismatch",
<mask> domain: ".host3.com",
<mask> want: false,
<mask> }}
<mask>
<mask> for _, tc := range testCases {
<mask> t.Run(tc.name, func(t *testing.T) {
<mask> assert.Equal(t, tc.want, aCtx.IsBlockedDomain(tc.domain))
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove name: "wildcard_type-2_match_complex",
domain: "asdf.host3.com",
want: true,
</s> add name: "rule_match_complex",
host: "asdf.host3.com",
want: true, </s> remove name: "wildcard_type-2_match_simple",
domain: "host3.com",
want: true,
</s> add name: "rule_match_simple",
host: "host3.com",
want: true, </s> remove assert.Equal(t, tc.want, aCtx.IsBlockedDomain(tc.domain))
</s> add assert.Equal(t, tc.want, a.isBlockedHost(tc.host)) </s> remove name: "plain_mismatch",
domain: "host2",
want: false,
</s> add name: "plain_mismatch",
host: "host2",
want: false, </s> remove name: "wildcard_type-1_mismatch_bad-asterisk",
domain: "asdf.zhost.com",
want: false,
</s> add name: "subdomain_mismatch_bad_asterisk",
host: "asdf.zhost.com",
want: false, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/access_test.go |
assert.Equal(t, tc.want, a.isBlockedHost(tc.host)) | <mask> }}
<mask>
<mask> for _, tc := range testCases {
<mask> t.Run(tc.name, func(t *testing.T) {
<mask> assert.Equal(t, tc.want, aCtx.IsBlockedDomain(tc.domain))
<mask> })
<mask> }
<mask> }
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove name: "wildcard_type-2_mismatch",
domain: ".host3.com",
want: false,
</s> add name: "rule_mismatch",
host: ".host3.com",
want: false, </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove ups, err := upstream.AddressToUpstream("1.1.1.1", upstream.Options{})
</s> add ups, err := upstream.AddressToUpstream("1.1.1.1", nil) </s> remove wantRes: resultCodeError,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/access_test.go |
"encoding/binary" | <mask> import (
<mask> "crypto/tls"
<mask> "fmt"
<mask> "path"
<mask> "strings"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/dnsproxy/proxy"
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove "sync"
</s> add </s> remove import { BLOCK_ACTIONS, R_CLIENT_ID, STATUS_COLORS } from '../../helpers/constants';
</s> add import { BLOCK_ACTIONS, STATUS_COLORS } from '../../helpers/constants'; | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
// clientIDFromDNSContextHTTPS extracts the client's ID from the path of the | <mask>
<mask> return clientID, nil
<mask> }
<mask>
<mask> // processClientIDHTTPS extracts the client's ID from the path of the
<mask> // client's DNS-over-HTTPS request.
<mask> func processClientIDHTTPS(ctx *dnsContext) (rc resultCode) {
<mask> pctx := ctx.proxyCtx
<mask> r := pctx.HTTPRequest
<mask> if r == nil {
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove func processClientIDHTTPS(ctx *dnsContext) (rc resultCode) {
pctx := ctx.proxyCtx
</s> add func clientIDFromDNSContextHTTPS(pctx *proxy.DNSContext) (clientID string, err error) { </s> remove // processClientID extracts the client's ID from the server name of the client's
// DoT or DoQ request or the path of the client's DoH.
func processClientID(dctx *dnsContext) (rc resultCode) {
pctx := dctx.proxyCtx
</s> add // clientIDFromDNSContext extracts the client's ID from the server name of the
// client's DoT or DoQ request or the path of the client's DoH. If the protocol
// is not one of these, clientID is an empty string and err is nil.
func (s *Server) clientIDFromDNSContext(pctx *proxy.DNSContext) (clientID string, err error) { </s> remove ctx.err = fmt.Errorf("proxy ctx http request of proto %s is nil", pctx.Proto)
return resultCodeError
</s> add return "", fmt.Errorf(
"proxy ctx http request of proto %s is nil",
pctx.Proto,
) </s> remove return resultCodeError
</s> add return clientID, nil
}
// processClientID puts the clientID into the DNS context, if there is one.
func (s *Server) processClientID(dctx *dnsContext) (rc resultCode) {
pctx := dctx.proxyCtx
var key [8]byte
binary.BigEndian.PutUint64(key[:], pctx.RequestID)
clientIDData := s.clientIDCache.Get(key[:])
if clientIDData == nil {
return resultCodeSuccess | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
func clientIDFromDNSContextHTTPS(pctx *proxy.DNSContext) (clientID string, err error) { | <mask> }
<mask>
<mask> // processClientIDHTTPS extracts the client's ID from the path of the
<mask> // client's DNS-over-HTTPS request.
<mask> func processClientIDHTTPS(ctx *dnsContext) (rc resultCode) {
<mask> pctx := ctx.proxyCtx
<mask> r := pctx.HTTPRequest
<mask> if r == nil {
<mask> ctx.err = fmt.Errorf("proxy ctx http request of proto %s is nil", pctx.Proto)
<mask>
<mask> return resultCodeError
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove // processClientIDHTTPS extracts the client's ID from the path of the
</s> add // clientIDFromDNSContextHTTPS extracts the client's ID from the path of the </s> remove ctx.err = fmt.Errorf("proxy ctx http request of proto %s is nil", pctx.Proto)
return resultCodeError
</s> add return "", fmt.Errorf(
"proxy ctx http request of proto %s is nil",
pctx.Proto,
) </s> remove // processClientID extracts the client's ID from the server name of the client's
// DoT or DoQ request or the path of the client's DoH.
func processClientID(dctx *dnsContext) (rc resultCode) {
pctx := dctx.proxyCtx
</s> add // clientIDFromDNSContext extracts the client's ID from the server name of the
// client's DoT or DoQ request or the path of the client's DoH. If the protocol
// is not one of these, clientID is an empty string and err is nil.
func (s *Server) clientIDFromDNSContext(pctx *proxy.DNSContext) (clientID string, err error) { </s> remove dctx.err = fmt.Errorf("proxy ctx conn of proto %s is %T, want *tls.Conn", proto, conn)
return resultCodeError
</s> add return "", fmt.Errorf(
"proxy ctx conn of proto %s is %T, want *tls.Conn",
proto,
conn,
) </s> remove } else if proto == proxy.ProtoQUIC {
</s> add case proxy.ProtoQUIC: | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
return "", fmt.Errorf(
"proxy ctx http request of proto %s is nil",
pctx.Proto,
) | <mask> func processClientIDHTTPS(ctx *dnsContext) (rc resultCode) {
<mask> pctx := ctx.proxyCtx
<mask> r := pctx.HTTPRequest
<mask> if r == nil {
<mask> ctx.err = fmt.Errorf("proxy ctx http request of proto %s is nil", pctx.Proto)
<mask>
<mask> return resultCodeError
<mask> }
<mask>
<mask> origPath := r.URL.Path
<mask> parts := strings.Split(path.Clean(origPath), "/")
<mask> if parts[0] == "" {
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove func processClientIDHTTPS(ctx *dnsContext) (rc resultCode) {
pctx := ctx.proxyCtx
</s> add func clientIDFromDNSContextHTTPS(pctx *proxy.DNSContext) (clientID string, err error) { </s> remove // processClientIDHTTPS extracts the client's ID from the path of the
</s> add // clientIDFromDNSContextHTTPS extracts the client's ID from the path of the </s> remove return processClientIDHTTPS(dctx)
</s> add return clientIDFromDNSContextHTTPS(pctx) </s> remove dctx.err = fmt.Errorf("proxy ctx conn of proto %s is %T, want *tls.Conn", proto, conn)
return resultCodeError
</s> add return "", fmt.Errorf(
"proxy ctx conn of proto %s is %T, want *tls.Conn",
proto,
conn,
) </s> remove if proto == proxy.ProtoTLS {
</s> add switch proto {
case proxy.ProtoTLS: | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
return "", fmt.Errorf("client id check: invalid path %q", origPath) | <mask> parts = parts[1:]
<mask> }
<mask>
<mask> if len(parts) == 0 || parts[0] != "dns-query" {
<mask> ctx.err = fmt.Errorf("client id check: invalid path %q", origPath)
<mask>
<mask> return resultCodeError
<mask> }
<mask>
<mask> clientID := ""
<mask> switch len(parts) {
<mask> case 1:
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove return resultCodeSuccess
</s> add return "", nil </s> remove ctx.err = fmt.Errorf("client id check: invalid path %q: extra parts", origPath)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: invalid path %q: extra parts", origPath) </s> remove clientID := ""
</s> add </s> remove ctx.err = fmt.Errorf("client id check: %w", err)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: %w", err) </s> remove err := ValidateClientID(clientID)
</s> add err = ValidateClientID(clientID) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
<mask>
<mask> return resultCodeError
<mask> }
<mask>
<mask> clientID := ""
<mask> switch len(parts) {
<mask> case 1:
<mask> // Just /dns-query, no client ID.
<mask> return resultCodeSuccess
<mask> case 2:
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove return resultCodeSuccess
</s> add return "", nil </s> remove ctx.err = fmt.Errorf("client id check: invalid path %q", origPath)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: invalid path %q", origPath) </s> remove ctx.err = fmt.Errorf("client id check: invalid path %q: extra parts", origPath)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: invalid path %q: extra parts", origPath) </s> remove if proto == proxy.ProtoTLS {
</s> add switch proto {
case proxy.ProtoTLS: | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go | |
return "", nil | <mask> clientID := ""
<mask> switch len(parts) {
<mask> case 1:
<mask> // Just /dns-query, no client ID.
<mask> return resultCodeSuccess
<mask> case 2:
<mask> clientID = parts[1]
<mask> default:
<mask> ctx.err = fmt.Errorf("client id check: invalid path %q: extra parts", origPath)
<mask>
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove ctx.err = fmt.Errorf("client id check: invalid path %q: extra parts", origPath)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: invalid path %q: extra parts", origPath) </s> remove clientID := ""
</s> add </s> remove ctx.err = fmt.Errorf("client id check: invalid path %q", origPath)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: invalid path %q", origPath) </s> remove ctx.err = fmt.Errorf("client id check: %w", err)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: %w", err) </s> remove wantRes: resultCodeError,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
return "", fmt.Errorf("client id check: invalid path %q: extra parts", origPath) | <mask> return resultCodeSuccess
<mask> case 2:
<mask> clientID = parts[1]
<mask> default:
<mask> ctx.err = fmt.Errorf("client id check: invalid path %q: extra parts", origPath)
<mask>
<mask> return resultCodeError
<mask> }
<mask>
<mask> err := ValidateClientID(clientID)
<mask> if err != nil {
<mask> ctx.err = fmt.Errorf("client id check: %w", err)
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove return resultCodeSuccess
</s> add return "", nil </s> remove ctx.err = fmt.Errorf("client id check: %w", err)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: %w", err) </s> remove ctx.err = fmt.Errorf("client id check: invalid path %q", origPath)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: invalid path %q", origPath) </s> remove err := ValidateClientID(clientID)
</s> add err = ValidateClientID(clientID) </s> remove dctx.err = fmt.Errorf("client id check: %w", err)
</s> add return "", fmt.Errorf("client id check: %w", err)
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
err = ValidateClientID(clientID) | <mask>
<mask> return resultCodeError
<mask> }
<mask>
<mask> err := ValidateClientID(clientID)
<mask> if err != nil {
<mask> ctx.err = fmt.Errorf("client id check: %w", err)
<mask>
<mask> return resultCodeError
<mask> }
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove ctx.err = fmt.Errorf("client id check: %w", err)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: %w", err) </s> remove ctx.err = fmt.Errorf("client id check: invalid path %q: extra parts", origPath)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: invalid path %q: extra parts", origPath) </s> remove dctx.err = fmt.Errorf("client id check: %w", err)
</s> add return "", fmt.Errorf("client id check: %w", err)
} </s> remove clientID, err := clientIDFromClientServerName(hostSrvName, cliSrvName, srvConf.StrictSNICheck)
</s> add clientID, err = clientIDFromClientServerName(
hostSrvName,
cliSrvName,
s.conf.StrictSNICheck,
) </s> remove ctx.err = fmt.Errorf("client id check: invalid path %q", origPath)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: invalid path %q", origPath) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
return "", fmt.Errorf("client id check: %w", err) | <mask> }
<mask>
<mask> err := ValidateClientID(clientID)
<mask> if err != nil {
<mask> ctx.err = fmt.Errorf("client id check: %w", err)
<mask>
<mask> return resultCodeError
<mask> }
<mask>
<mask> ctx.clientID = clientID
<mask>
<mask> return resultCodeSuccess
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove err := ValidateClientID(clientID)
</s> add err = ValidateClientID(clientID) </s> remove ctx.err = fmt.Errorf("client id check: invalid path %q: extra parts", origPath)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: invalid path %q: extra parts", origPath) </s> remove dctx.err = fmt.Errorf("client id check: %w", err)
</s> add return "", fmt.Errorf("client id check: %w", err)
} </s> remove ctx.err = fmt.Errorf("client id check: invalid path %q", origPath)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: invalid path %q", origPath) </s> remove return resultCodeError
</s> add return clientID, nil
}
// processClientID puts the clientID into the DNS context, if there is one.
func (s *Server) processClientID(dctx *dnsContext) (rc resultCode) {
pctx := dctx.proxyCtx
var key [8]byte
binary.BigEndian.PutUint64(key[:], pctx.RequestID)
clientIDData := s.clientIDCache.Get(key[:])
if clientIDData == nil {
return resultCodeSuccess | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
return clientID, nil | <mask>
<mask> return resultCodeError
<mask> }
<mask>
<mask> ctx.clientID = clientID
<mask>
<mask> return resultCodeSuccess
<mask> }
<mask>
<mask> // tlsConn is a narrow interface for *tls.Conn to simplify testing.
<mask> type tlsConn interface {
<mask> ConnectionState() (cs tls.ConnectionState)
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove // processClientID extracts the client's ID from the server name of the client's
// DoT or DoQ request or the path of the client's DoH.
func processClientID(dctx *dnsContext) (rc resultCode) {
pctx := dctx.proxyCtx
</s> add // clientIDFromDNSContext extracts the client's ID from the server name of the
// client's DoT or DoQ request or the path of the client's DoH. If the protocol
// is not one of these, clientID is an empty string and err is nil.
func (s *Server) clientIDFromDNSContext(pctx *proxy.DNSContext) (clientID string, err error) { </s> remove ctx.err = fmt.Errorf("client id check: %w", err)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: %w", err) </s> remove dctx.clientID = clientID
</s> add dctx.clientID = string(clientIDData) </s> remove clientID := ""
</s> add </s> remove return resultCodeError
</s> add return clientID, nil
}
// processClientID puts the clientID into the DNS context, if there is one.
func (s *Server) processClientID(dctx *dnsContext) (rc resultCode) {
pctx := dctx.proxyCtx
var key [8]byte
binary.BigEndian.PutUint64(key[:], pctx.RequestID)
clientIDData := s.clientIDCache.Get(key[:])
if clientIDData == nil {
return resultCodeSuccess | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
// clientIDFromDNSContext extracts the client's ID from the server name of the
// client's DoT or DoQ request or the path of the client's DoH. If the protocol
// is not one of these, clientID is an empty string and err is nil.
func (s *Server) clientIDFromDNSContext(pctx *proxy.DNSContext) (clientID string, err error) { | <mask> type quicSession interface {
<mask> ConnectionState() (cs quic.ConnectionState)
<mask> }
<mask>
<mask> // processClientID extracts the client's ID from the server name of the client's
<mask> // DoT or DoQ request or the path of the client's DoH.
<mask> func processClientID(dctx *dnsContext) (rc resultCode) {
<mask> pctx := dctx.proxyCtx
<mask> proto := pctx.Proto
<mask> if proto == proxy.ProtoHTTPS {
<mask> return processClientIDHTTPS(dctx)
<mask> } else if proto != proxy.ProtoTLS && proto != proxy.ProtoQUIC {
<mask> return resultCodeSuccess
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove return processClientIDHTTPS(dctx)
</s> add return clientIDFromDNSContextHTTPS(pctx) </s> remove // processClientIDHTTPS extracts the client's ID from the path of the
</s> add // clientIDFromDNSContextHTTPS extracts the client's ID from the path of the </s> remove func processClientIDHTTPS(ctx *dnsContext) (rc resultCode) {
pctx := ctx.proxyCtx
</s> add func clientIDFromDNSContextHTTPS(pctx *proxy.DNSContext) (clientID string, err error) { </s> remove return resultCodeSuccess
</s> add return "", nil </s> remove srvConf := dctx.srv.conf
hostSrvName := srvConf.TLSConfig.ServerName
</s> add hostSrvName := s.conf.ServerName | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
return clientIDFromDNSContextHTTPS(pctx) | <mask> func processClientID(dctx *dnsContext) (rc resultCode) {
<mask> pctx := dctx.proxyCtx
<mask> proto := pctx.Proto
<mask> if proto == proxy.ProtoHTTPS {
<mask> return processClientIDHTTPS(dctx)
<mask> } else if proto != proxy.ProtoTLS && proto != proxy.ProtoQUIC {
<mask> return resultCodeSuccess
<mask> }
<mask>
<mask> srvConf := dctx.srv.conf
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove return resultCodeSuccess
</s> add return "", nil </s> remove srvConf := dctx.srv.conf
hostSrvName := srvConf.TLSConfig.ServerName
</s> add hostSrvName := s.conf.ServerName </s> remove // processClientID extracts the client's ID from the server name of the client's
// DoT or DoQ request or the path of the client's DoH.
func processClientID(dctx *dnsContext) (rc resultCode) {
pctx := dctx.proxyCtx
</s> add // clientIDFromDNSContext extracts the client's ID from the server name of the
// client's DoT or DoQ request or the path of the client's DoH. If the protocol
// is not one of these, clientID is an empty string and err is nil.
func (s *Server) clientIDFromDNSContext(pctx *proxy.DNSContext) (clientID string, err error) { </s> remove return resultCodeSuccess
</s> add return "", nil </s> remove ctx.err = fmt.Errorf("proxy ctx http request of proto %s is nil", pctx.Proto)
return resultCodeError
</s> add return "", fmt.Errorf(
"proxy ctx http request of proto %s is nil",
pctx.Proto,
) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
return "", nil | <mask> proto := pctx.Proto
<mask> if proto == proxy.ProtoHTTPS {
<mask> return processClientIDHTTPS(dctx)
<mask> } else if proto != proxy.ProtoTLS && proto != proxy.ProtoQUIC {
<mask> return resultCodeSuccess
<mask> }
<mask>
<mask> srvConf := dctx.srv.conf
<mask> hostSrvName := srvConf.TLSConfig.ServerName
<mask> if hostSrvName == "" {
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove srvConf := dctx.srv.conf
hostSrvName := srvConf.TLSConfig.ServerName
</s> add hostSrvName := s.conf.ServerName </s> remove return processClientIDHTTPS(dctx)
</s> add return clientIDFromDNSContextHTTPS(pctx) </s> remove return resultCodeSuccess
</s> add return "", nil </s> remove if proto == proxy.ProtoTLS {
</s> add switch proto {
case proxy.ProtoTLS: </s> remove // processClientID extracts the client's ID from the server name of the client's
// DoT or DoQ request or the path of the client's DoH.
func processClientID(dctx *dnsContext) (rc resultCode) {
pctx := dctx.proxyCtx
</s> add // clientIDFromDNSContext extracts the client's ID from the server name of the
// client's DoT or DoQ request or the path of the client's DoH. If the protocol
// is not one of these, clientID is an empty string and err is nil.
func (s *Server) clientIDFromDNSContext(pctx *proxy.DNSContext) (clientID string, err error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
hostSrvName := s.conf.ServerName | <mask> } else if proto != proxy.ProtoTLS && proto != proxy.ProtoQUIC {
<mask> return resultCodeSuccess
<mask> }
<mask>
<mask> srvConf := dctx.srv.conf
<mask> hostSrvName := srvConf.TLSConfig.ServerName
<mask> if hostSrvName == "" {
<mask> return resultCodeSuccess
<mask> }
<mask>
<mask> cliSrvName := ""
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove return resultCodeSuccess
</s> add return "", nil </s> remove return resultCodeSuccess
</s> add return "", nil </s> remove return processClientIDHTTPS(dctx)
</s> add return clientIDFromDNSContextHTTPS(pctx) </s> remove if proto == proxy.ProtoTLS {
</s> add switch proto {
case proxy.ProtoTLS: </s> remove dctx.err = fmt.Errorf("proxy ctx conn of proto %s is %T, want *tls.Conn", proto, conn)
return resultCodeError
</s> add return "", fmt.Errorf(
"proxy ctx conn of proto %s is %T, want *tls.Conn",
proto,
conn,
) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
return "", nil | <mask>
<mask> srvConf := dctx.srv.conf
<mask> hostSrvName := srvConf.TLSConfig.ServerName
<mask> if hostSrvName == "" {
<mask> return resultCodeSuccess
<mask> }
<mask>
<mask> cliSrvName := ""
<mask> if proto == proxy.ProtoTLS {
<mask> conn := pctx.Conn
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove srvConf := dctx.srv.conf
hostSrvName := srvConf.TLSConfig.ServerName
</s> add hostSrvName := s.conf.ServerName </s> remove return resultCodeSuccess
</s> add return "", nil </s> remove if proto == proxy.ProtoTLS {
</s> add switch proto {
case proxy.ProtoTLS: </s> remove return processClientIDHTTPS(dctx)
</s> add return clientIDFromDNSContextHTTPS(pctx) </s> remove dctx.err = fmt.Errorf("proxy ctx conn of proto %s is %T, want *tls.Conn", proto, conn)
return resultCodeError
</s> add return "", fmt.Errorf(
"proxy ctx conn of proto %s is %T, want *tls.Conn",
proto,
conn,
) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
switch proto {
case proxy.ProtoTLS: | <mask> return resultCodeSuccess
<mask> }
<mask>
<mask> cliSrvName := ""
<mask> if proto == proxy.ProtoTLS {
<mask> conn := pctx.Conn
<mask> tc, ok := conn.(tlsConn)
<mask> if !ok {
<mask> dctx.err = fmt.Errorf("proxy ctx conn of proto %s is %T, want *tls.Conn", proto, conn)
<mask>
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove dctx.err = fmt.Errorf("proxy ctx conn of proto %s is %T, want *tls.Conn", proto, conn)
return resultCodeError
</s> add return "", fmt.Errorf(
"proxy ctx conn of proto %s is %T, want *tls.Conn",
proto,
conn,
) </s> remove dctx.err = fmt.Errorf("proxy ctx quic session of proto %s is %T, want quic.Session", proto, pctx.QUICSession)
return resultCodeError
</s> add return "", fmt.Errorf(
"proxy ctx quic session of proto %s is %T, want quic.Session",
proto,
pctx.QUICSession,
) </s> remove } else if proto == proxy.ProtoQUIC {
</s> add case proxy.ProtoQUIC: </s> remove return resultCodeSuccess
</s> add return "", nil </s> remove srvConf := dctx.srv.conf
hostSrvName := srvConf.TLSConfig.ServerName
</s> add hostSrvName := s.conf.ServerName | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
return "", fmt.Errorf(
"proxy ctx conn of proto %s is %T, want *tls.Conn",
proto,
conn,
) | <mask> if proto == proxy.ProtoTLS {
<mask> conn := pctx.Conn
<mask> tc, ok := conn.(tlsConn)
<mask> if !ok {
<mask> dctx.err = fmt.Errorf("proxy ctx conn of proto %s is %T, want *tls.Conn", proto, conn)
<mask>
<mask> return resultCodeError
<mask> }
<mask>
<mask> cliSrvName = tc.ConnectionState().ServerName
<mask> } else if proto == proxy.ProtoQUIC {
<mask> qs, ok := pctx.QUICSession.(quicSession)
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove if proto == proxy.ProtoTLS {
</s> add switch proto {
case proxy.ProtoTLS: </s> remove } else if proto == proxy.ProtoQUIC {
</s> add case proxy.ProtoQUIC: </s> remove dctx.err = fmt.Errorf("proxy ctx quic session of proto %s is %T, want quic.Session", proto, pctx.QUICSession)
return resultCodeError
</s> add return "", fmt.Errorf(
"proxy ctx quic session of proto %s is %T, want quic.Session",
proto,
pctx.QUICSession,
) </s> remove return resultCodeSuccess
</s> add return "", nil </s> remove srvConf := dctx.srv.conf
hostSrvName := srvConf.TLSConfig.ServerName
</s> add hostSrvName := s.conf.ServerName | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
case proxy.ProtoQUIC: | <mask> return resultCodeError
<mask> }
<mask>
<mask> cliSrvName = tc.ConnectionState().ServerName
<mask> } else if proto == proxy.ProtoQUIC {
<mask> qs, ok := pctx.QUICSession.(quicSession)
<mask> if !ok {
<mask> dctx.err = fmt.Errorf("proxy ctx quic session of proto %s is %T, want quic.Session", proto, pctx.QUICSession)
<mask>
<mask> return resultCodeError
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove dctx.err = fmt.Errorf("proxy ctx quic session of proto %s is %T, want quic.Session", proto, pctx.QUICSession)
return resultCodeError
</s> add return "", fmt.Errorf(
"proxy ctx quic session of proto %s is %T, want quic.Session",
proto,
pctx.QUICSession,
) </s> remove dctx.err = fmt.Errorf("proxy ctx conn of proto %s is %T, want *tls.Conn", proto, conn)
return resultCodeError
</s> add return "", fmt.Errorf(
"proxy ctx conn of proto %s is %T, want *tls.Conn",
proto,
conn,
) </s> remove if proto == proxy.ProtoTLS {
</s> add switch proto {
case proxy.ProtoTLS: </s> remove ctx.err = fmt.Errorf("proxy ctx http request of proto %s is nil", pctx.Proto)
return resultCodeError
</s> add return "", fmt.Errorf(
"proxy ctx http request of proto %s is nil",
pctx.Proto,
) </s> remove func processClientIDHTTPS(ctx *dnsContext) (rc resultCode) {
pctx := ctx.proxyCtx
</s> add func clientIDFromDNSContextHTTPS(pctx *proxy.DNSContext) (clientID string, err error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
return "", fmt.Errorf(
"proxy ctx quic session of proto %s is %T, want quic.Session",
proto,
pctx.QUICSession,
) | <mask> cliSrvName = tc.ConnectionState().ServerName
<mask> } else if proto == proxy.ProtoQUIC {
<mask> qs, ok := pctx.QUICSession.(quicSession)
<mask> if !ok {
<mask> dctx.err = fmt.Errorf("proxy ctx quic session of proto %s is %T, want quic.Session", proto, pctx.QUICSession)
<mask>
<mask> return resultCodeError
<mask> }
<mask>
<mask> cliSrvName = qs.ConnectionState().TLS.ServerName
<mask> }
<mask>
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove } else if proto == proxy.ProtoQUIC {
</s> add case proxy.ProtoQUIC: </s> remove dctx.err = fmt.Errorf("proxy ctx conn of proto %s is %T, want *tls.Conn", proto, conn)
return resultCodeError
</s> add return "", fmt.Errorf(
"proxy ctx conn of proto %s is %T, want *tls.Conn",
proto,
conn,
) </s> remove if proto == proxy.ProtoTLS {
</s> add switch proto {
case proxy.ProtoTLS: </s> remove ctx.err = fmt.Errorf("proxy ctx http request of proto %s is nil", pctx.Proto)
return resultCodeError
</s> add return "", fmt.Errorf(
"proxy ctx http request of proto %s is nil",
pctx.Proto,
) </s> remove srvConf := dctx.srv.conf
hostSrvName := srvConf.TLSConfig.ServerName
</s> add hostSrvName := s.conf.ServerName | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
clientID, err = clientIDFromClientServerName(
hostSrvName,
cliSrvName,
s.conf.StrictSNICheck,
) | <mask>
<mask> cliSrvName = qs.ConnectionState().TLS.ServerName
<mask> }
<mask>
<mask> clientID, err := clientIDFromClientServerName(hostSrvName, cliSrvName, srvConf.StrictSNICheck)
<mask> if err != nil {
<mask> dctx.err = fmt.Errorf("client id check: %w", err)
<mask>
<mask> return resultCodeError
<mask> }
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove dctx.err = fmt.Errorf("client id check: %w", err)
</s> add return "", fmt.Errorf("client id check: %w", err)
} </s> remove return resultCodeError
</s> add return clientID, nil
}
// processClientID puts the clientID into the DNS context, if there is one.
func (s *Server) processClientID(dctx *dnsContext) (rc resultCode) {
pctx := dctx.proxyCtx
var key [8]byte
binary.BigEndian.PutUint64(key[:], pctx.RequestID)
clientIDData := s.clientIDCache.Get(key[:])
if clientIDData == nil {
return resultCodeSuccess </s> remove ctx.err = fmt.Errorf("client id check: %w", err)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: %w", err) </s> remove err := ValidateClientID(clientID)
</s> add err = ValidateClientID(clientID) </s> remove ctx.err = fmt.Errorf("client id check: invalid path %q: extra parts", origPath)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: invalid path %q: extra parts", origPath) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
return "", fmt.Errorf("client id check: %w", err)
} | <mask> }
<mask>
<mask> clientID, err := clientIDFromClientServerName(hostSrvName, cliSrvName, srvConf.StrictSNICheck)
<mask> if err != nil {
<mask> dctx.err = fmt.Errorf("client id check: %w", err)
<mask>
<mask> return resultCodeError
<mask> }
<mask>
<mask> dctx.clientID = clientID
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove clientID, err := clientIDFromClientServerName(hostSrvName, cliSrvName, srvConf.StrictSNICheck)
</s> add clientID, err = clientIDFromClientServerName(
hostSrvName,
cliSrvName,
s.conf.StrictSNICheck,
) </s> remove return resultCodeError
</s> add return clientID, nil
}
// processClientID puts the clientID into the DNS context, if there is one.
func (s *Server) processClientID(dctx *dnsContext) (rc resultCode) {
pctx := dctx.proxyCtx
var key [8]byte
binary.BigEndian.PutUint64(key[:], pctx.RequestID)
clientIDData := s.clientIDCache.Get(key[:])
if clientIDData == nil {
return resultCodeSuccess </s> remove ctx.err = fmt.Errorf("client id check: %w", err)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: %w", err) </s> remove err := ValidateClientID(clientID)
</s> add err = ValidateClientID(clientID) </s> remove ctx.err = fmt.Errorf("client id check: invalid path %q: extra parts", origPath)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: invalid path %q: extra parts", origPath) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
return clientID, nil
}
// processClientID puts the clientID into the DNS context, if there is one.
func (s *Server) processClientID(dctx *dnsContext) (rc resultCode) {
pctx := dctx.proxyCtx
var key [8]byte
binary.BigEndian.PutUint64(key[:], pctx.RequestID)
clientIDData := s.clientIDCache.Get(key[:])
if clientIDData == nil {
return resultCodeSuccess | <mask> clientID, err := clientIDFromClientServerName(hostSrvName, cliSrvName, srvConf.StrictSNICheck)
<mask> if err != nil {
<mask> dctx.err = fmt.Errorf("client id check: %w", err)
<mask>
<mask> return resultCodeError
<mask> }
<mask>
<mask> dctx.clientID = clientID
<mask>
<mask> return resultCodeSuccess
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove dctx.err = fmt.Errorf("client id check: %w", err)
</s> add return "", fmt.Errorf("client id check: %w", err)
} </s> remove clientID, err := clientIDFromClientServerName(hostSrvName, cliSrvName, srvConf.StrictSNICheck)
</s> add clientID, err = clientIDFromClientServerName(
hostSrvName,
cliSrvName,
s.conf.StrictSNICheck,
) </s> remove ctx.err = fmt.Errorf("client id check: %w", err)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: %w", err) </s> remove ctx.err = fmt.Errorf("client id check: invalid path %q: extra parts", origPath)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: invalid path %q: extra parts", origPath) </s> remove err := ValidateClientID(clientID)
</s> add err = ValidateClientID(clientID) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
dctx.clientID = string(clientIDData) | <mask>
<mask> return resultCodeError
<mask> }
<mask>
<mask> dctx.clientID = clientID
<mask>
<mask> return resultCodeSuccess
<mask> }
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove dctx.err = fmt.Errorf("client id check: %w", err)
</s> add return "", fmt.Errorf("client id check: %w", err)
} </s> remove return resultCodeError
</s> add return clientID, nil
}
// processClientID puts the clientID into the DNS context, if there is one.
func (s *Server) processClientID(dctx *dnsContext) (rc resultCode) {
pctx := dctx.proxyCtx
var key [8]byte
binary.BigEndian.PutUint64(key[:], pctx.RequestID)
clientIDData := s.clientIDCache.Get(key[:])
if clientIDData == nil {
return resultCodeSuccess </s> remove clientID := ""
</s> add </s> remove ctx.clientID = clientID
return resultCodeSuccess
</s> add return clientID, nil </s> remove ctx.err = fmt.Errorf("client id check: %w", err)
return resultCodeError
</s> add return "", fmt.Errorf("client id check: %w", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid.go |
func TestServer_clientIDFromDNSContext(t *testing.T) { | <mask>
<mask> return cs
<mask> }
<mask>
<mask> func TestProcessClientID(t *testing.T) {
<mask> testCases := []struct {
<mask> name string
<mask> proto string
<mask> hostSrvName string
<mask> cliSrvName string
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove proto string
</s> add proto proxy.Proto </s> remove proto string
</s> add proto proxy.Proto </s> remove func TestProcessClientID_https(t *testing.T) {
</s> add func TestClientIDFromDNSContextHTTPS(t *testing.T) { </s> remove proto string
</s> add net string
proto proxy.Proto </s> remove name string
domain string
want bool
</s> add name string
host string
want bool | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go |
proto proxy.Proto | <mask>
<mask> func TestProcessClientID(t *testing.T) {
<mask> testCases := []struct {
<mask> name string
<mask> proto string
<mask> hostSrvName string
<mask> cliSrvName string
<mask> wantClientID string
<mask> wantErrMsg string
<mask> wantRes resultCode
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove func TestProcessClientID(t *testing.T) {
</s> add func TestServer_clientIDFromDNSContext(t *testing.T) { </s> remove func TestProcessClientID_https(t *testing.T) {
</s> add func TestClientIDFromDNSContextHTTPS(t *testing.T) { </s> remove wantRes resultCode
</s> add </s> remove proto string
</s> add proto proxy.Proto </s> remove wantRes resultCode
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go |
<mask> hostSrvName string
<mask> cliSrvName string
<mask> wantClientID string
<mask> wantErrMsg string
<mask> wantRes resultCode
<mask> strictSNI bool
<mask> }{{
<mask> name: "udp",
<mask> proto: proxy.ProtoUDP,
<mask> hostSrvName: "",
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove wantRes resultCode
</s> add </s> remove proto string
</s> add proto proxy.Proto </s> remove proto string
</s> add net string
proto proxy.Proto </s> remove name string
domain string
want bool
</s> add name string
host string
want bool | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go | |
<mask> hostSrvName: "",
<mask> cliSrvName: "",
<mask> wantClientID: "",
<mask> wantErrMsg: "",
<mask> wantRes: resultCodeSuccess,
<mask> strictSNI: false,
<mask> }, {
<mask> name: "tls_no_client_id",
<mask> proto: proxy.ProtoTLS,
<mask> hostSrvName: "example.com",
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go | |
<mask> hostSrvName: "example.com",
<mask> cliSrvName: "example.com",
<mask> wantClientID: "",
<mask> wantErrMsg: "",
<mask> wantRes: resultCodeSuccess,
<mask> strictSNI: true,
<mask> }, {
<mask> name: "tls_no_client_server_name",
<mask> proto: proxy.ProtoTLS,
<mask> hostSrvName: "example.com",
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go | |
<mask> cliSrvName: "",
<mask> wantClientID: "",
<mask> wantErrMsg: `client id check: client server name "" ` +
<mask> `doesn't match host server name "example.com"`,
<mask> wantRes: resultCodeError,
<mask> strictSNI: true,
<mask> }, {
<mask> name: "tls_no_client_server_name_no_strict",
<mask> proto: proxy.ProtoTLS,
<mask> hostSrvName: "example.com",
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go | |
<mask> hostSrvName: "example.com",
<mask> cliSrvName: "",
<mask> wantClientID: "",
<mask> wantErrMsg: "",
<mask> wantRes: resultCodeSuccess,
<mask> strictSNI: false,
<mask> }, {
<mask> name: "tls_client_id",
<mask> proto: proxy.ProtoTLS,
<mask> hostSrvName: "example.com",
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go | |
<mask> hostSrvName: "example.com",
<mask> cliSrvName: "cli.example.com",
<mask> wantClientID: "cli",
<mask> wantErrMsg: "",
<mask> wantRes: resultCodeSuccess,
<mask> strictSNI: true,
<mask> }, {
<mask> name: "tls_client_id_hostname_error",
<mask> proto: proxy.ProtoTLS,
<mask> hostSrvName: "example.com",
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeError,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go | |
<mask> cliSrvName: "cli.example.net",
<mask> wantClientID: "",
<mask> wantErrMsg: `client id check: client server name "cli.example.net" ` +
<mask> `doesn't match host server name "example.com"`,
<mask> wantRes: resultCodeError,
<mask> strictSNI: true,
<mask> }, {
<mask> name: "tls_invalid_client_id",
<mask> proto: proxy.ProtoTLS,
<mask> hostSrvName: "example.com",
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go | |
<mask> cliSrvName: "!!!.example.com",
<mask> wantClientID: "",
<mask> wantErrMsg: `client id check: invalid client id "!!!": ` +
<mask> `invalid char '!' at index 0`,
<mask> wantRes: resultCodeError,
<mask> strictSNI: true,
<mask> }, {
<mask> name: "tls_client_id_too_long",
<mask> proto: proxy.ProtoTLS,
<mask> hostSrvName: "example.com",
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go | |
<mask> wantClientID: "",
<mask> wantErrMsg: `client id check: invalid client id "abcdefghijklmno` +
<mask> `pqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789": ` +
<mask> `label is too long, max: 63`,
<mask> wantRes: resultCodeError,
<mask> strictSNI: true,
<mask> }, {
<mask> name: "quic_client_id",
<mask> proto: proxy.ProtoQUIC,
<mask> hostSrvName: "example.com",
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go | |
<mask> hostSrvName: "example.com",
<mask> cliSrvName: "cli.example.com",
<mask> wantClientID: "cli",
<mask> wantErrMsg: "",
<mask> wantRes: resultCodeSuccess,
<mask> strictSNI: true,
<mask> }}
<mask>
<mask> for _, tc := range testCases {
<mask> t.Run(tc.name, func(t *testing.T) {
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeError,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go | |
pctx := &proxy.DNSContext{
Proto: tc.proto,
Conn: conn,
QUICSession: qs, | <mask> serverName: tc.cliSrvName,
<mask> }
<mask> }
<mask>
<mask> dctx := &dnsContext{
<mask> srv: srv,
<mask> proxyCtx: &proxy.DNSContext{
<mask> Proto: tc.proto,
<mask> Conn: conn,
<mask> QUICSession: qs,
<mask> },
<mask> }
<mask>
<mask> res := processClientID(dctx)
<mask> assert.Equal(t, tc.wantRes, res)
<mask> assert.Equal(t, tc.wantClientID, dctx.clientID)
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove dctx := &dnsContext{
proxyCtx: &proxy.DNSContext{
Proto: proxy.ProtoHTTPS,
HTTPRequest: r,
},
</s> add pctx := &proxy.DNSContext{
Proto: proxy.ProtoHTTPS,
HTTPRequest: r, </s> remove res := processClientID(dctx)
assert.Equal(t, tc.wantRes, res)
assert.Equal(t, tc.wantClientID, dctx.clientID)
</s> add clientID, err := srv.clientIDFromDNSContext(pctx)
assert.Equal(t, tc.wantClientID, clientID) </s> remove res := processClientID(dctx)
assert.Equal(t, tc.wantRes, res)
assert.Equal(t, tc.wantClientID, dctx.clientID)
</s> add clientID, err := clientIDFromDNSContextHTTPS(pctx)
assert.Equal(t, tc.wantClientID, clientID) </s> remove assert.NoError(t, dctx.err)
</s> add assert.NoError(t, err) </s> remove assert.NoError(t, dctx.err)
</s> add assert.NoError(t, err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go |
clientID, err := srv.clientIDFromDNSContext(pctx)
assert.Equal(t, tc.wantClientID, clientID) | <mask> QUICSession: qs,
<mask> },
<mask> }
<mask>
<mask> res := processClientID(dctx)
<mask> assert.Equal(t, tc.wantRes, res)
<mask> assert.Equal(t, tc.wantClientID, dctx.clientID)
<mask>
<mask> if tc.wantErrMsg == "" {
<mask> assert.NoError(t, dctx.err)
<mask> } else {
<mask> require.Error(t, dctx.err)
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove res := processClientID(dctx)
assert.Equal(t, tc.wantRes, res)
assert.Equal(t, tc.wantClientID, dctx.clientID)
</s> add clientID, err := clientIDFromDNSContextHTTPS(pctx)
assert.Equal(t, tc.wantClientID, clientID) </s> remove assert.NoError(t, dctx.err)
</s> add assert.NoError(t, err) </s> remove assert.NoError(t, dctx.err)
</s> add assert.NoError(t, err) </s> remove dctx := &dnsContext{
srv: srv,
proxyCtx: &proxy.DNSContext{
Proto: tc.proto,
Conn: conn,
QUICSession: qs,
},
</s> add pctx := &proxy.DNSContext{
Proto: tc.proto,
Conn: conn,
QUICSession: qs, </s> remove require.Error(t, dctx.err)
assert.Equal(t, tc.wantErrMsg, dctx.err.Error())
</s> add require.Error(t, err)
assert.Equal(t, tc.wantErrMsg, err.Error()) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go |
assert.NoError(t, err) | <mask> assert.Equal(t, tc.wantRes, res)
<mask> assert.Equal(t, tc.wantClientID, dctx.clientID)
<mask>
<mask> if tc.wantErrMsg == "" {
<mask> assert.NoError(t, dctx.err)
<mask> } else {
<mask> require.Error(t, dctx.err)
<mask> assert.Equal(t, tc.wantErrMsg, dctx.err.Error())
<mask> }
<mask> })
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove assert.NoError(t, dctx.err)
</s> add assert.NoError(t, err) </s> remove require.Error(t, dctx.err)
assert.Equal(t, tc.wantErrMsg, dctx.err.Error())
</s> add require.Error(t, err)
assert.Equal(t, tc.wantErrMsg, err.Error()) </s> remove res := processClientID(dctx)
assert.Equal(t, tc.wantRes, res)
assert.Equal(t, tc.wantClientID, dctx.clientID)
</s> add clientID, err := srv.clientIDFromDNSContext(pctx)
assert.Equal(t, tc.wantClientID, clientID) </s> remove res := processClientID(dctx)
assert.Equal(t, tc.wantRes, res)
assert.Equal(t, tc.wantClientID, dctx.clientID)
</s> add clientID, err := clientIDFromDNSContextHTTPS(pctx)
assert.Equal(t, tc.wantClientID, clientID) </s> remove require.Error(t, dctx.err)
</s> add require.Error(t, err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go |
require.Error(t, err)
assert.Equal(t, tc.wantErrMsg, err.Error()) | <mask>
<mask> if tc.wantErrMsg == "" {
<mask> assert.NoError(t, dctx.err)
<mask> } else {
<mask> require.Error(t, dctx.err)
<mask> assert.Equal(t, tc.wantErrMsg, dctx.err.Error())
<mask> }
<mask> })
<mask> }
<mask> }
<mask>
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove require.Error(t, dctx.err)
</s> add require.Error(t, err) </s> remove assert.NoError(t, dctx.err)
</s> add assert.NoError(t, err) </s> remove assert.NoError(t, dctx.err)
</s> add assert.NoError(t, err) </s> remove assert.Equal(t, tc.wantErrMsg, dctx.err.Error())
</s> add assert.Equal(t, tc.wantErrMsg, err.Error()) </s> remove res := processClientID(dctx)
assert.Equal(t, tc.wantRes, res)
assert.Equal(t, tc.wantClientID, dctx.clientID)
</s> add clientID, err := srv.clientIDFromDNSContext(pctx)
assert.Equal(t, tc.wantClientID, clientID) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go |
func TestClientIDFromDNSContextHTTPS(t *testing.T) { | <mask> })
<mask> }
<mask> }
<mask>
<mask> func TestProcessClientID_https(t *testing.T) {
<mask> testCases := []struct {
<mask> name string
<mask> path string
<mask> wantClientID string
<mask> wantErrMsg string
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove proto string
</s> add proto proxy.Proto </s> remove func TestProcessClientID(t *testing.T) {
</s> add func TestServer_clientIDFromDNSContext(t *testing.T) { </s> remove proto string
</s> add proto proxy.Proto </s> remove wantRes resultCode
</s> add </s> remove name string
domain string
want bool
</s> add name string
host string
want bool | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go |
<mask> name string
<mask> path string
<mask> wantClientID string
<mask> wantErrMsg string
<mask> wantRes resultCode
<mask> }{{
<mask> name: "no_client_id",
<mask> path: "/dns-query",
<mask> wantClientID: "",
<mask> wantErrMsg: "",
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove wantRes resultCode
</s> add </s> remove proto string
</s> add proto proxy.Proto </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove func TestProcessClientID_https(t *testing.T) {
</s> add func TestClientIDFromDNSContextHTTPS(t *testing.T) { </s> remove name string
domain string
want bool
</s> add name string
host string
want bool | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go | |
<mask> name: "no_client_id",
<mask> path: "/dns-query",
<mask> wantClientID: "",
<mask> wantErrMsg: "",
<mask> wantRes: resultCodeSuccess,
<mask> }, {
<mask> name: "no_client_id_slash",
<mask> path: "/dns-query/",
<mask> wantClientID: "",
<mask> wantErrMsg: "",
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes resultCode
</s> add </s> remove wantRes: resultCodeError,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go | |
<mask> name: "no_client_id_slash",
<mask> path: "/dns-query/",
<mask> wantClientID: "",
<mask> wantErrMsg: "",
<mask> wantRes: resultCodeSuccess,
<mask> }, {
<mask> name: "client_id",
<mask> path: "/dns-query/cli",
<mask> wantClientID: "cli",
<mask> wantErrMsg: "",
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go | |
<mask> name: "client_id",
<mask> path: "/dns-query/cli",
<mask> wantClientID: "cli",
<mask> wantErrMsg: "",
<mask> wantRes: resultCodeSuccess,
<mask> }, {
<mask> name: "client_id_slash",
<mask> path: "/dns-query/cli/",
<mask> wantClientID: "cli",
<mask> wantErrMsg: "",
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeError,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go | |
<mask> name: "client_id_slash",
<mask> path: "/dns-query/cli/",
<mask> wantClientID: "cli",
<mask> wantErrMsg: "",
<mask> wantRes: resultCodeSuccess,
<mask> }, {
<mask> name: "bad_url",
<mask> path: "/foo",
<mask> wantClientID: "",
<mask> wantErrMsg: `client id check: invalid path "/foo"`,
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go | |
<mask> name: "bad_url",
<mask> path: "/foo",
<mask> wantClientID: "",
<mask> wantErrMsg: `client id check: invalid path "/foo"`,
<mask> wantRes: resultCodeError,
<mask> }, {
<mask> name: "extra",
<mask> path: "/dns-query/cli/foo",
<mask> wantClientID: "",
<mask> wantErrMsg: `client id check: invalid path "/dns-query/cli/foo": extra parts`,
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go | |
<mask> name: "extra",
<mask> path: "/dns-query/cli/foo",
<mask> wantClientID: "",
<mask> wantErrMsg: `client id check: invalid path "/dns-query/cli/foo": extra parts`,
<mask> wantRes: resultCodeError,
<mask> }, {
<mask> name: "invalid_client_id",
<mask> path: "/dns-query/!!!",
<mask> wantClientID: "",
<mask> wantErrMsg: `client id check: invalid client id "!!!": ` +
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go | |
<mask> path: "/dns-query/!!!",
<mask> wantClientID: "",
<mask> wantErrMsg: `client id check: invalid client id "!!!": ` +
<mask> `invalid char '!' at index 0`,
<mask> wantRes: resultCodeError,
<mask> }}
<mask>
<mask> for _, tc := range testCases {
<mask> t.Run(tc.name, func(t *testing.T) {
<mask> r := &http.Request{
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeError,
</s> add </s> remove wantRes: resultCodeSuccess,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go | |
pctx := &proxy.DNSContext{
Proto: proxy.ProtoHTTPS,
HTTPRequest: r, | <mask> Path: tc.path,
<mask> },
<mask> }
<mask>
<mask> dctx := &dnsContext{
<mask> proxyCtx: &proxy.DNSContext{
<mask> Proto: proxy.ProtoHTTPS,
<mask> HTTPRequest: r,
<mask> },
<mask> }
<mask>
<mask> res := processClientID(dctx)
<mask> assert.Equal(t, tc.wantRes, res)
<mask> assert.Equal(t, tc.wantClientID, dctx.clientID)
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove dctx := &dnsContext{
srv: srv,
proxyCtx: &proxy.DNSContext{
Proto: tc.proto,
Conn: conn,
QUICSession: qs,
},
</s> add pctx := &proxy.DNSContext{
Proto: tc.proto,
Conn: conn,
QUICSession: qs, </s> remove res := processClientID(dctx)
assert.Equal(t, tc.wantRes, res)
assert.Equal(t, tc.wantClientID, dctx.clientID)
</s> add clientID, err := clientIDFromDNSContextHTTPS(pctx)
assert.Equal(t, tc.wantClientID, clientID) </s> remove res := processClientID(dctx)
assert.Equal(t, tc.wantRes, res)
assert.Equal(t, tc.wantClientID, dctx.clientID)
</s> add clientID, err := srv.clientIDFromDNSContext(pctx)
assert.Equal(t, tc.wantClientID, clientID) </s> remove assert.NoError(t, dctx.err)
</s> add assert.NoError(t, err) </s> remove assert.NoError(t, dctx.err)
</s> add assert.NoError(t, err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go |
clientID, err := clientIDFromDNSContextHTTPS(pctx)
assert.Equal(t, tc.wantClientID, clientID) | <mask> HTTPRequest: r,
<mask> },
<mask> }
<mask>
<mask> res := processClientID(dctx)
<mask> assert.Equal(t, tc.wantRes, res)
<mask> assert.Equal(t, tc.wantClientID, dctx.clientID)
<mask>
<mask> if tc.wantErrMsg == "" {
<mask> assert.NoError(t, dctx.err)
<mask> } else {
<mask> require.Error(t, dctx.err)
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove res := processClientID(dctx)
assert.Equal(t, tc.wantRes, res)
assert.Equal(t, tc.wantClientID, dctx.clientID)
</s> add clientID, err := srv.clientIDFromDNSContext(pctx)
assert.Equal(t, tc.wantClientID, clientID) </s> remove assert.NoError(t, dctx.err)
</s> add assert.NoError(t, err) </s> remove assert.NoError(t, dctx.err)
</s> add assert.NoError(t, err) </s> remove dctx := &dnsContext{
proxyCtx: &proxy.DNSContext{
Proto: proxy.ProtoHTTPS,
HTTPRequest: r,
},
</s> add pctx := &proxy.DNSContext{
Proto: proxy.ProtoHTTPS,
HTTPRequest: r, </s> remove require.Error(t, dctx.err)
assert.Equal(t, tc.wantErrMsg, dctx.err.Error())
</s> add require.Error(t, err)
assert.Equal(t, tc.wantErrMsg, err.Error()) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go |
assert.NoError(t, err) | <mask> assert.Equal(t, tc.wantRes, res)
<mask> assert.Equal(t, tc.wantClientID, dctx.clientID)
<mask>
<mask> if tc.wantErrMsg == "" {
<mask> assert.NoError(t, dctx.err)
<mask> } else {
<mask> require.Error(t, dctx.err)
<mask>
<mask> assert.Equal(t, tc.wantErrMsg, dctx.err.Error())
<mask> }
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove assert.NoError(t, dctx.err)
</s> add assert.NoError(t, err) </s> remove res := processClientID(dctx)
assert.Equal(t, tc.wantRes, res)
assert.Equal(t, tc.wantClientID, dctx.clientID)
</s> add clientID, err := clientIDFromDNSContextHTTPS(pctx)
assert.Equal(t, tc.wantClientID, clientID) </s> remove res := processClientID(dctx)
assert.Equal(t, tc.wantRes, res)
assert.Equal(t, tc.wantClientID, dctx.clientID)
</s> add clientID, err := srv.clientIDFromDNSContext(pctx)
assert.Equal(t, tc.wantClientID, clientID) </s> remove require.Error(t, dctx.err)
assert.Equal(t, tc.wantErrMsg, dctx.err.Error())
</s> add require.Error(t, err)
assert.Equal(t, tc.wantErrMsg, err.Error()) </s> remove require.Error(t, dctx.err)
</s> add require.Error(t, err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go |
require.Error(t, err) | <mask>
<mask> if tc.wantErrMsg == "" {
<mask> assert.NoError(t, dctx.err)
<mask> } else {
<mask> require.Error(t, dctx.err)
<mask>
<mask> assert.Equal(t, tc.wantErrMsg, dctx.err.Error())
<mask> }
<mask> })
<mask> }
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove require.Error(t, dctx.err)
assert.Equal(t, tc.wantErrMsg, dctx.err.Error())
</s> add require.Error(t, err)
assert.Equal(t, tc.wantErrMsg, err.Error()) </s> remove assert.NoError(t, dctx.err)
</s> add assert.NoError(t, err) </s> remove assert.NoError(t, dctx.err)
</s> add assert.NoError(t, err) </s> remove assert.Equal(t, tc.wantErrMsg, dctx.err.Error())
</s> add assert.Equal(t, tc.wantErrMsg, err.Error()) </s> remove res := processClientID(dctx)
assert.Equal(t, tc.wantRes, res)
assert.Equal(t, tc.wantClientID, dctx.clientID)
</s> add clientID, err := clientIDFromDNSContextHTTPS(pctx)
assert.Equal(t, tc.wantClientID, clientID) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go |
assert.Equal(t, tc.wantErrMsg, err.Error()) | <mask> assert.NoError(t, dctx.err)
<mask> } else {
<mask> require.Error(t, dctx.err)
<mask>
<mask> assert.Equal(t, tc.wantErrMsg, dctx.err.Error())
<mask> }
<mask> })
<mask> }
<mask> }
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove require.Error(t, dctx.err)
assert.Equal(t, tc.wantErrMsg, dctx.err.Error())
</s> add require.Error(t, err)
assert.Equal(t, tc.wantErrMsg, err.Error()) </s> remove require.Error(t, dctx.err)
</s> add require.Error(t, err) </s> remove assert.NoError(t, dctx.err)
</s> add assert.NoError(t, err) </s> remove assert.NoError(t, dctx.err)
</s> add assert.NoError(t, err) </s> remove res := processClientID(dctx)
assert.Equal(t, tc.wantRes, res)
assert.Equal(t, tc.wantClientID, dctx.clientID)
</s> add clientID, err := clientIDFromDNSContextHTTPS(pctx)
assert.Equal(t, tc.wantClientID, clientID) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/clientid_test.go |
&upstream.Options{ | <mask>
<mask> upstreams = aghstrings.FilterOut(upstreams, aghstrings.IsCommentOrEmpty)
<mask> upstreamConfig, err := proxy.ParseUpstreamsConfig(
<mask> upstreams,
<mask> upstream.Options{
<mask> Bootstrap: s.conf.BootstrapDNS,
<mask> Timeout: s.conf.UpstreamTimeout,
<mask> },
<mask> )
<mask> if err != nil {
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove upstream.Options{
</s> add &upstream.Options{ </s> remove upstream.Options{
</s> add &upstream.Options{ </s> remove upstream.Options{
</s> add &upstream.Options{ </s> remove var uc proxy.UpstreamConfig
</s> add var uc *proxy.UpstreamConfig </s> remove var conf proxy.UpstreamConfig
</s> add var conf *proxy.UpstreamConfig | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/config.go |
var uc *proxy.UpstreamConfig | <mask> }
<mask>
<mask> if len(upstreamConfig.Upstreams) == 0 {
<mask> log.Info("warning: no default upstream servers specified, using %v", defaultDNS)
<mask> var uc proxy.UpstreamConfig
<mask> uc, err = proxy.ParseUpstreamsConfig(
<mask> defaultDNS,
<mask> upstream.Options{
<mask> Bootstrap: s.conf.BootstrapDNS,
<mask> Timeout: s.conf.UpstreamTimeout,
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove upstream.Options{
</s> add &upstream.Options{ </s> remove upstream.Options{
</s> add &upstream.Options{ </s> remove var conf proxy.UpstreamConfig
</s> add var conf *proxy.UpstreamConfig </s> remove upstream.Options{
</s> add &upstream.Options{ </s> remove var upsConfig proxy.UpstreamConfig
upsConfig, err = proxy.ParseUpstreamsConfig(localAddrs, upstream.Options{
Bootstrap: bootstraps,
Timeout: defaultLocalTimeout,
// TODO(e.burkov): Should we verify server's ceritificates?
})
</s> add var upsConfig *proxy.UpstreamConfig
upsConfig, err = proxy.ParseUpstreamsConfig(
localAddrs,
&upstream.Options{
Bootstrap: bootstraps,
Timeout: defaultLocalTimeout,
// TODO(e.burkov): Should we verify server's ceritificates?
},
) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/config.go |
&upstream.Options{ | <mask> log.Info("warning: no default upstream servers specified, using %v", defaultDNS)
<mask> var uc proxy.UpstreamConfig
<mask> uc, err = proxy.ParseUpstreamsConfig(
<mask> defaultDNS,
<mask> upstream.Options{
<mask> Bootstrap: s.conf.BootstrapDNS,
<mask> Timeout: s.conf.UpstreamTimeout,
<mask> },
<mask> )
<mask> if err != nil {
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove var uc proxy.UpstreamConfig
</s> add var uc *proxy.UpstreamConfig </s> remove upstream.Options{
</s> add &upstream.Options{ </s> remove upstream.Options{
</s> add &upstream.Options{ </s> remove var conf proxy.UpstreamConfig
</s> add var conf *proxy.UpstreamConfig </s> remove upstream.Options{
</s> add &upstream.Options{ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/config.go |
s.conf.UpstreamConfig = upstreamConfig
| <mask> }
<mask> upstreamConfig.Upstreams = uc.Upstreams
<mask> }
<mask>
<mask> s.conf.UpstreamConfig = &upstreamConfig
<mask> return nil
<mask> }
<mask>
<mask> // prepareIntlProxy - initializes DNS proxy that we use for internal DNS queries
<mask> func (s *Server) prepareIntlProxy() {
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove func (s *Server) setTableIPToHost(t ipToHostTable) {
</s> add func (s *Server) setTableIPToHost(t *aghnet.IPMap) { </s> remove
return nil
</s> add </s> remove return resultCodeError
</s> add return clientID, nil
}
// processClientID puts the clientID into the DNS context, if there is one.
func (s *Server) processClientID(dctx *dnsContext) (rc resultCode) {
pctx := dctx.proxyCtx
var key [8]byte
binary.BigEndian.PutUint64(key[:], pctx.RequestID)
clientIDData := s.clientIDCache.Get(key[:])
if clientIDData == nil {
return resultCodeSuccess </s> remove return &conf, nil
</s> add return conf, nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/config.go |
s.processClientID, | <mask> s.processDetermineLocal,
<mask> s.processInternalHosts,
<mask> s.processRestrictLocal,
<mask> s.processInternalIPAddrs,
<mask> processClientID,
<mask> processFilteringBeforeRequest,
<mask> s.processLocalPTR,
<mask> s.processUpstream,
<mask> processDNSSECAfterResponse,
<mask> processFilteringAfterResponse,
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove name: "wildcard_type-2_mismatch",
domain: ".host3.com",
want: false,
</s> add name: "rule_mismatch",
host: ".host3.com",
want: false, </s> remove // processClientIDHTTPS extracts the client's ID from the path of the
</s> add // clientIDFromDNSContextHTTPS extracts the client's ID from the path of the </s> remove func processClientIDHTTPS(ctx *dnsContext) (rc resultCode) {
pctx := ctx.proxyCtx
</s> add func clientIDFromDNSContextHTTPS(pctx *proxy.DNSContext) (clientID string, err error) { </s> remove ctx.err = fmt.Errorf("proxy ctx http request of proto %s is nil", pctx.Proto)
return resultCodeError
</s> add return "", fmt.Errorf(
"proxy ctx http request of proto %s is nil",
pctx.Proto,
) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dns.go |
func (s *Server) setTableIPToHost(t *aghnet.IPMap) { | <mask>
<mask> s.tableHostToIP = t
<mask> }
<mask>
<mask> func (s *Server) setTableIPToHost(t ipToHostTable) {
<mask> s.tableIPToHostLock.Lock()
<mask> defer s.tableIPToHostLock.Unlock()
<mask>
<mask> s.tableIPToHost = t
<mask> }
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove
return nil
</s> add </s> remove if (R_CLIENT_ID.test(ip)) {
return null;
}
</s> add </s> remove s.conf.UpstreamConfig = &upstreamConfig
</s> add s.conf.UpstreamConfig = upstreamConfig
</s> remove j := accessListJSON{}
err := json.NewDecoder(r.Body).Decode(&j)
</s> add list := accessListJSON{}
err := json.NewDecoder(r.Body).Decode(&list) </s> remove httpError(r, w, http.StatusBadRequest, "json.Decode: %s", err)
return
}
</s> add httpError(r, w, http.StatusBadRequest, "decoding request: %s", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dns.go |
var ipToHost *aghnet.IPMap | <mask> return
<mask> }
<mask>
<mask> var hostToIP hostToIPTable
<mask> var ipToHost ipToHostTable
<mask> if add {
<mask> hostToIP = make(hostToIPTable)
<mask> ipToHost = make(ipToHostTable)
<mask>
<mask> ll := s.dhcpServer.Leases(dhcpd.LeasesAll)
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove hostToIP = make(hostToIPTable)
ipToHost = make(ipToHostTable)
</s> add </s> remove var cj clientJSON
</s> add var cj *clientJSON </s> remove var found bool
cj, found = clients.findRuntime(ip, idStr)
if !found {
continue
}
</s> add cj = clients.findRuntime(ip, idStr) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dns.go |
<mask>
<mask> var hostToIP hostToIPTable
<mask> var ipToHost ipToHostTable
<mask> if add {
<mask> hostToIP = make(hostToIPTable)
<mask> ipToHost = make(ipToHostTable)
<mask>
<mask> ll := s.dhcpServer.Leases(dhcpd.LeasesAll)
<mask>
<mask> for _, l := range ll {
<mask> // TODO(a.garipov): Remove this after we're finished
<mask> // with the client hostname validations in the DHCP
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove var ipToHost ipToHostTable
</s> add var ipToHost *aghnet.IPMap </s> remove // ipToHostTable is an alias for the type of Server.tableIPToHost.
//
// TODO(a.garipov): Define an IPMap type in aghnet and use here and in other
// places?
type ipToHostTable = map[string]string
</s> add </s> remove testIP := net.IP{1, 2, 3, 4}
</s> add ip := net.IP{1, 2, 3, 4} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dns.go | |
hostToIP = make(hostToIPTable, len(ll))
ipToHost = aghnet.NewIPMap(len(ll))
| <mask> var ipToHost *aghnet.IPMap
<mask> if add {
<mask> ll := s.dhcpServer.Leases(dhcpd.LeasesAll)
<mask>
<mask> for _, l := range ll {
<mask> // TODO(a.garipov): Remove this after we're finished
<mask> // with the client hostname validations in the DHCP
<mask> // server code.
<mask> err = aghnet.ValidateDomainName(l.Hostname)
<mask> if err != nil {
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove hostToIP = make(hostToIPTable)
ipToHost = make(ipToHostTable)
</s> add </s> remove var ipToHost ipToHostTable
</s> add var ipToHost *aghnet.IPMap </s> remove // Split array of IP or CIDR into 2 containers for fast search
func processIPCIDRArray(dst *aghstrings.Set, dstIPNet *[]net.IPNet, src []string) error {
for _, s := range src {
ip := net.ParseIP(s)
if ip != nil {
dst.Add(s)
continue
}
</s> add // allowlistMode returns true if this *accessCtx is in the allowlist mode.
func (a *accessCtx) allowlistMode() (ok bool) {
return a.allowedIPs.Len() != 0 || a.allowedClientIDs.Len() != 0 || len(a.allowedNets) != 0
} </s> remove testIP := net.IP{1, 2, 3, 4}
</s> add ip := net.IP{1, 2, 3, 4} </s> remove // /etc/hosts tables, DHCP leases, or blocklists.
func (clients *clientsContainer) findRuntime(ip net.IP, idStr string) (cj clientJSON, found bool) {
if ip == nil {
return cj, false
}
rc, ok := clients.FindRuntimeClient(idStr)
</s> add // /etc/hosts tables, DHCP leases, or blocklists. cj is guaranteed to be
// non-nil.
func (clients *clientsContainer) findRuntime(ip net.IP, idStr string) (cj *clientJSON) {
rc, ok := clients.FindRuntimeClient(ip) | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dns.go |
ipToHost.Set(l.IP, lowhost) | <mask> }
<mask>
<mask> lowhost := strings.ToLower(l.Hostname)
<mask>
<mask> ipToHost[l.IP.String()] = lowhost
<mask>
<mask> ip := make(net.IP, 4)
<mask> copy(ip, l.IP.To4())
<mask> hostToIP[lowhost] = ip
<mask> }
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove log.Debug("dns: added %d A/PTR entries from DHCP", len(ipToHost))
</s> add log.Debug("dns: added %d A/PTR entries from DHCP", ipToHost.Len()) </s> remove d = append(d, net.ParseIP(it.Name))
</s> add ip := net.ParseIP(it.Name)
if ip != nil {
d = append(d, ip)
} </s> remove func checkIPCIDRArray(src []string) error {
for _, s := range src {
ip := net.ParseIP(s)
if ip != nil {
continue
}
_, _, err := net.ParseCIDR(s)
if err != nil {
return err
}
</s> add return </s> remove ipReal := UnreverseAddr(addr)
if ipReal == nil {
</s> add ip := UnreverseAddr(addr)
if ip == nil { </s> remove func onDNSRequest(d *proxy.DNSContext) {
ip := aghnet.IPFromAddr(d.Addr)
</s> add func onDNSRequest(pctx *proxy.DNSContext) {
ip := aghnet.IPFromAddr(pctx.Addr) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dns.go |
log.Debug("dns: added %d A/PTR entries from DHCP", ipToHost.Len()) | <mask> copy(ip, l.IP.To4())
<mask> hostToIP[lowhost] = ip
<mask> }
<mask>
<mask> log.Debug("dns: added %d A/PTR entries from DHCP", len(ipToHost))
<mask> }
<mask>
<mask> s.setTableHostToIP(hostToIP)
<mask> s.setTableIPToHost(ipToHost)
<mask> }
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove ipToHost[l.IP.String()] = lowhost
</s> add ipToHost.Set(l.IP, lowhost) </s> remove log.Debug("Clients: added %d client aliases from system hosts-file", n)
</s> add return true
})
log.Debug("clients: added %d client aliases from system hosts-file", n) </s> remove }
</s> add </s> remove log.Debug("clients: added %q -> %q [%d]", ip, host, len(clients.ipToRC))
</s> add log.Debug("clients: added %s -> %q [%d]", ip, host, clients.ipToRC.Len()) </s> remove }
</s> add return true
}) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dns.go |
var v interface{}
v, ok = s.tableIPToHost.Get(ip)
var typOK bool
if host, typOK = v.(string); !typOK {
log.Error("dns: bad type %T in tableIPToHost for %s", v, ip)
return "", false
} | <mask> if s.tableIPToHost == nil {
<mask> return "", false
<mask> }
<mask>
<mask> host, ok = s.tableIPToHost[ip.String()]
<mask>
<mask> return host, ok
<mask> }
<mask>
<mask> // Respond to PTR requests if the target IP is leased by our DHCP server and the
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove // /etc/hosts tables, DHCP leases, or blocklists.
func (clients *clientsContainer) findRuntime(ip net.IP, idStr string) (cj clientJSON, found bool) {
if ip == nil {
return cj, false
}
rc, ok := clients.FindRuntimeClient(idStr)
</s> add // /etc/hosts tables, DHCP leases, or blocklists. cj is guaranteed to be
// non-nil.
func (clients *clientsContainer) findRuntime(ip net.IP, idStr string) (cj *clientJSON) {
rc, ok := clients.FindRuntimeClient(ip) </s> remove log.Debug("etchostscontainer: answer: %s -> %v", host, ipsCopy)
</s> add log.Debug("etchosts: answer: %s -> %v", host, ipsCopy) </s> remove var rc *RuntimeClient
rc, ok = clients.ipToRC[id]
</s> add rc, ok := clients.findRuntimeClientLocked(ip) </s> remove func (clients *clientsContainer) FindRuntimeClient(ip string) (RuntimeClient, bool) {
ipAddr := net.ParseIP(ip)
if ipAddr == nil {
return RuntimeClient{}, false
</s> add func (clients *clientsContainer) FindRuntimeClient(ip net.IP) (rc *RuntimeClient, ok bool) {
if ip == nil {
return nil, false </s> remove func (clients *clientsContainer) AddHost(ip, host string, src clientSource) (ok bool, err error) {
</s> add func (clients *clientsContainer) AddHost(ip net.IP, host string, src clientSource) (ok bool, err error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dns.go |
"github.com/AdguardTeam/golibs/cache" | <mask> "github.com/AdguardTeam/dnsproxy/proxy"
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/miekg/dns"
<mask> )
<mask>
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dnsforward.go |
// defaultClientIDCacheCount is the default count of items in the LRU client ID
// cache. The assumption here is that there won't be more than this many
// requests between the BeforeRequestHandler stage and the actual processing.
const defaultClientIDCacheCount = 1024
| <mask> // DefaultTimeout is the default upstream timeout
<mask> const DefaultTimeout = 10 * time.Second
<mask>
<mask> const (
<mask> safeBrowsingBlockHost = "standard-block.dns.adguard.com"
<mask> parentalBlockHost = "family-block.dns.adguard.com"
<mask> )
<mask>
<mask> var defaultDNS = []string{
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove if (R_CLIENT_ID.test(ip)) {
return null;
}
</s> add </s> remove upstream.Options{
</s> add &upstream.Options{ </s> remove var uc proxy.UpstreamConfig
</s> add var uc *proxy.UpstreamConfig </s> remove // ipToHostTable is an alias for the type of Server.tableIPToHost.
//
// TODO(a.garipov): Define an IPMap type in aghnet and use here and in other
// places?
type ipToHostTable = map[string]string
</s> add </s> remove func TestIsBlockedIP(t *testing.T) {
const (
ip int = iota
cidr
)
rules := []string{
ip: "1.1.1.1",
cidr: "2.2.0.0/16",
}
testCases := []struct {
name string
allowed bool
ip net.IP
wantDis bool
wantRule string
}{{
name: "allow_ip",
allowed: true,
ip: net.IPv4(1, 1, 1, 1),
wantDis: false,
wantRule: "",
}, {
name: "disallow_ip",
allowed: true,
ip: net.IPv4(1, 1, 1, 2),
wantDis: true,
wantRule: "",
}, {
name: "allow_cidr",
allowed: true,
ip: net.IPv4(2, 2, 1, 1),
wantDis: false,
wantRule: "",
}, {
name: "disallow_cidr",
allowed: true,
ip: net.IPv4(2, 3, 1, 1),
wantDis: true,
wantRule: "",
}, {
name: "allow_ip",
allowed: false,
ip: net.IPv4(1, 1, 1, 1),
wantDis: true,
wantRule: rules[ip],
}, {
name: "disallow_ip",
allowed: false,
ip: net.IPv4(1, 1, 1, 2),
wantDis: false,
wantRule: "",
}, {
name: "allow_cidr",
allowed: false,
ip: net.IPv4(2, 2, 1, 1),
wantDis: true,
wantRule: rules[cidr],
}, {
name: "disallow_cidr",
allowed: false,
ip: net.IPv4(2, 3, 1, 1),
wantDis: false,
wantRule: "",
}}
for _, tc := range testCases {
prefix := "allowed_"
if !tc.allowed {
prefix = "disallowed_"
}
</s> add func TestIsBlockedClientID(t *testing.T) {
clientID := "client-1"
clients := []string{clientID} | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dnsforward.go |
<mask>
<mask> // hostToIPTable is an alias for the type of Server.tableHostToIP.
<mask> type hostToIPTable = map[string]net.IP
<mask>
<mask> // ipToHostTable is an alias for the type of Server.tableIPToHost.
<mask> //
<mask> // TODO(a.garipov): Define an IPMap type in aghnet and use here and in other
<mask> // places?
<mask> type ipToHostTable = map[string]string
<mask>
<mask> // Server is the main way to start a DNS server.
<mask> //
<mask> // Example:
<mask> // s := dnsforward.Server{}
<mask> // err := s.Start(nil) // will start a DNS server listening on default port 53, in a goroutine
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove // tableReverse is the IP-to-hosts map.
//
// TODO(a.garipov): Make better use of newtypes. Perhaps a custom map.
tableReverse map[string][]string
</s> add // tableReverse is the IP-to-hosts map. The type of the values in the
// map is []string.
tableReverse *IPMap </s> remove // List returns an IP-to-hostnames table. It is safe for concurrent use.
func (ehc *EtcHostsContainer) List() (ipToHosts map[string][]string) {
</s> add // List returns an IP-to-hostnames table. The type of the values in the map is
// []string. It is safe for concurrent use.
func (ehc *EtcHostsContainer) List() (ipToHosts *IPMap) { </s> remove allowedClientsIPNet []net.IPNet // CIDRs of whitelist clients
disallowedClientsIPNet []net.IPNet // CIDRs of clients that should be blocked
</s> add // TODO(a.garipov): Create a type for a set of IP networks.
// aghnet.IPNetSet?
allowedNets []*net.IPNet
blockedNets []*net.IPNet
}
// unit is a convenient alias for struct{}
type unit = struct{}
// processAccessClients is a helper for processing a list of client strings,
// which may be an IP address, a CIDR, or a ClientID.
func processAccessClients(
clientStrs []string,
ips *aghnet.IPMap,
nets *[]*net.IPNet,
clientIDs *aghstrings.Set,
) (err error) {
for i, s := range clientStrs {
if ip := net.ParseIP(s); ip != nil {
ips.Set(ip, unit{})
} else if cidrIP, ipnet, cidrErr := net.ParseCIDR(s); cidrErr == nil {
ipnet.IP = cidrIP
*nets = append(*nets, ipnet)
} else {
idErr := ValidateClientID(s)
if idErr != nil {
return fmt.Errorf(
"value %q at index %d: bad ip, cidr, or clientid",
s,
i,
)
}
clientIDs.Add(s)
}
} </s> remove tableIPToHost ipToHostTable
</s> add tableIPToHost *aghnet.IPMap </s> remove // processClientID extracts the client's ID from the server name of the client's
// DoT or DoQ request or the path of the client's DoH.
func processClientID(dctx *dnsContext) (rc resultCode) {
pctx := dctx.proxyCtx
</s> add // clientIDFromDNSContext extracts the client's ID from the server name of the
// client's DoT or DoQ request or the path of the client's DoH. If the protocol
// is not one of these, clientID is an empty string and err is nil.
func (s *Server) clientIDFromDNSContext(pctx *proxy.DNSContext) (clientID string, err error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dnsforward.go | |
tableIPToHost *aghnet.IPMap | <mask>
<mask> tableHostToIP hostToIPTable
<mask> tableHostToIPLock sync.Mutex
<mask>
<mask> tableIPToHost ipToHostTable
<mask> tableIPToHostLock sync.Mutex
<mask>
<mask> // DNS proxy instance for internal usage
<mask> // We don't Start() it and so no listen port is required.
<mask> internalProxy *proxy.Proxy
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove // ipToHostTable is an alias for the type of Server.tableIPToHost.
//
// TODO(a.garipov): Define an IPMap type in aghnet and use here and in other
// places?
type ipToHostTable = map[string]string
</s> add </s> remove list map[string]*Client // name -> client
idIndex map[string]*Client // ID -> client
ipToRC map[string]*RuntimeClient // IP -> runtime client
lock sync.Mutex
</s> add list map[string]*Client // name -> client
idIndex map[string]*Client // ID -> client
// ipToRC is the IP address to *RuntimeClient map.
ipToRC *aghnet.IPMap
lock sync.Mutex </s> remove s.conf.UpstreamConfig = &upstreamConfig
</s> add s.conf.UpstreamConfig = upstreamConfig
</s> remove hostToIP = make(hostToIPTable)
ipToHost = make(ipToHostTable)
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dnsforward.go |
// clientIDCache is a temporary storage for clientIDs that were
// extracted during the BeforeRequestHandler stage.
clientIDCache cache.Cache
| <mask> tableIPToHostLock sync.Mutex
<mask>
<mask> // DNS proxy instance for internal usage
<mask> // We don't Start() it and so no listen port is required.
<mask> internalProxy *proxy.Proxy
<mask>
<mask> isRunning bool
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove tableIPToHost ipToHostTable
</s> add tableIPToHost *aghnet.IPMap </s> remove s.conf.UpstreamConfig = &upstreamConfig
</s> add s.conf.UpstreamConfig = upstreamConfig
</s> remove // ipToHostTable is an alias for the type of Server.tableIPToHost.
//
// TODO(a.garipov): Define an IPMap type in aghnet and use here and in other
// places?
type ipToHostTable = map[string]string
</s> add </s> remove list map[string]*Client // name -> client
idIndex map[string]*Client // ID -> client
ipToRC map[string]*RuntimeClient // IP -> runtime client
lock sync.Mutex
</s> add list map[string]*Client // name -> client
idIndex map[string]*Client // ID -> client
// ipToRC is the IP address to *RuntimeClient map.
ipToRC *aghnet.IPMap
lock sync.Mutex </s> remove return nil
</s> add return a.blockedClientIDs.Has(id) | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dnsforward.go |
clientIDCache: cache.New(cache.Config{
EnableLRU: true,
MaxCount: defaultClientIDCacheCount,
}), | <mask> subnetDetector: p.SubnetDetector,
<mask> localDomainSuffix: localDomainSuffix,
<mask> recDetector: newRecursionDetector(recursionTTL, cachedRecurrentReqNum),
<mask> }
<mask>
<mask> // TODO(e.burkov): Enable the refresher after the actual implementation
<mask> // passes the public testing.
<mask> s.sysResolvers, err = aghnet.NewSystemResolvers(0, nil)
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove hostToIP = make(hostToIPTable)
ipToHost = make(ipToHostTable)
</s> add </s> remove // processClientID extracts the client's ID from the server name of the client's
// DoT or DoQ request or the path of the client's DoH.
func processClientID(dctx *dnsContext) (rc resultCode) {
pctx := dctx.proxyCtx
</s> add // clientIDFromDNSContext extracts the client's ID from the server name of the
// client's DoT or DoQ request or the path of the client's DoH. If the protocol
// is not one of these, clientID is an empty string and err is nil.
func (s *Server) clientIDFromDNSContext(pctx *proxy.DNSContext) (clientID string, err error) { </s> remove // processClientIDHTTPS extracts the client's ID from the path of the
</s> add // clientIDFromDNSContextHTTPS extracts the client's ID from the path of the | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dnsforward.go |
var upsConfig *proxy.UpstreamConfig
upsConfig, err = proxy.ParseUpstreamsConfig(
localAddrs,
&upstream.Options{
Bootstrap: bootstraps,
Timeout: defaultLocalTimeout,
// TODO(e.burkov): Should we verify server's ceritificates?
},
) | <mask> }
<mask>
<mask> log.Debug("upstreams to resolve PTR for local addresses: %v", localAddrs)
<mask>
<mask> var upsConfig proxy.UpstreamConfig
<mask> upsConfig, err = proxy.ParseUpstreamsConfig(localAddrs, upstream.Options{
<mask> Bootstrap: bootstraps,
<mask> Timeout: defaultLocalTimeout,
<mask> // TODO(e.burkov): Should we verify server's ceritificates?
<mask> })
<mask> if err != nil {
<mask> return fmt.Errorf("parsing upstreams: %w", err)
<mask> }
<mask>
<mask> s.localResolvers = &proxy.Proxy{
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove var conf proxy.UpstreamConfig
</s> add var conf *proxy.UpstreamConfig </s> remove u, err = upstream.AddressToUpstream(input, upstream.Options{
</s> add u, err = upstream.AddressToUpstream(input, &upstream.Options{ </s> remove var uc proxy.UpstreamConfig
</s> add var uc *proxy.UpstreamConfig </s> remove upstream.Options{
</s> add &upstream.Options{ </s> remove upstream.Options{
</s> add &upstream.Options{ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dnsforward.go |
UpstreamConfig: upsConfig, | <mask> }
<mask>
<mask> s.localResolvers = &proxy.Proxy{
<mask> Config: proxy.Config{
<mask> UpstreamConfig: &upsConfig,
<mask> },
<mask> }
<mask>
<mask> return nil
<mask> }
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove var upsConfig proxy.UpstreamConfig
upsConfig, err = proxy.ParseUpstreamsConfig(localAddrs, upstream.Options{
Bootstrap: bootstraps,
Timeout: defaultLocalTimeout,
// TODO(e.burkov): Should we verify server's ceritificates?
})
</s> add var upsConfig *proxy.UpstreamConfig
upsConfig, err = proxy.ParseUpstreamsConfig(
localAddrs,
&upstream.Options{
Bootstrap: bootstraps,
Timeout: defaultLocalTimeout,
// TODO(e.burkov): Should we verify server's ceritificates?
},
) </s> remove *dstIPNet = append(*dstIPNet, *ipnet)
</s> add if allowlistMode {
return !a.allowedClientIDs.Has(id) </s> remove func checkIPCIDRArray(src []string) error {
for _, s := range src {
ip := net.ParseIP(s)
if ip != nil {
continue
}
_, _, err := net.ParseCIDR(s)
if err != nil {
return err
}
</s> add return </s> remove
return nil
</s> add </s> remove return nil, fmt.Errorf("filterlist.NewRuleStorage(): %w", err)
</s> add return nil, fmt.Errorf("adding blocked hosts: %w", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dnsforward.go |
// IsBlockedClient returns true if the client is blocked by the current access
// settings.
func (s *Server) IsBlockedClient(ip net.IP, clientID string) (blocked bool, rule string) {
s.serverLock.RLock()
defer s.serverLock.RUnlock()
allowlistMode := s.access.allowlistMode()
blockedByIP, rule := s.access.isBlockedIP(ip)
blockedByClientID := s.access.isBlockedClientID(clientID)
// Allow if at least one of the checks allows in allowlist mode, but
// block if at least one of the checks blocks in blocklist mode.
if allowlistMode && blockedByIP && blockedByClientID {
log.Debug("client %s (id %q) is not in access allowlist", ip, clientID)
// Return now without substituting the empty rule for the
// clientID because the rule can't be empty here.
return true, rule
} else if !allowlistMode && (blockedByIP || blockedByClientID) {
log.Debug("client %s (id %q) is in access blocklist", ip, clientID)
blocked = true
}
if rule == "" {
rule = clientID | <mask> p.ServeHTTP(w, r)
<mask> }
<mask> }
<mask>
<mask> // IsBlockedIP - return TRUE if this client should be blocked
<mask> func (s *Server) IsBlockedIP(ip net.IP) (bool, string) {
<mask> if ip == nil {
<mask> return false, ""
<mask> }
<mask>
<mask> return s.access.IsBlockedIP(ip)
<mask> }
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove return false, ""
}
// IsBlockedDomain - return TRUE if this domain should be blocked
func (a *accessCtx) IsBlockedDomain(host string) (ok bool) {
a.lock.Lock()
defer a.lock.Unlock()
_, ok = a.blockedHostsEngine.Match(strings.ToLower(host))
return ok
</s> add return !blocked, "" </s> remove // IsBlockedIP - return TRUE if this client should be blocked
// Returns the item from the "disallowedClients" list that lead to blocking IP.
// If it returns TRUE and an empty string, it means that the "allowedClients" is not empty,
// but the ip does not belong to it.
func (a *accessCtx) IsBlockedIP(ip net.IP) (bool, string) {
ipStr := ip.String()
</s> add // isBlockedHost returns true if host should be blocked.
func (a *accessCtx) isBlockedHost(host string) (ok bool) {
_, ok = a.blockedHostsEng.Match(strings.ToLower(host)) </s> remove a.lock.Lock()
defer a.lock.Unlock()
</s> add return ok
} </s> remove return nil
</s> add return a.blockedClientIDs.Has(id) </s> remove return s.access.IsBlockedIP(ip)
</s> add return blocked, rule | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dnsforward.go |
return blocked, rule | <mask> if ip == nil {
<mask> return false, ""
<mask> }
<mask>
<mask> return s.access.IsBlockedIP(ip)
<mask> }
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove ipReal := UnreverseAddr(addr)
if ipReal == nil {
</s> add ip := UnreverseAddr(addr)
if ip == nil { </s> remove if len(a.allowedClientsIPNet) != 0 {
for _, ipnet := range a.allowedClientsIPNet {
if ipnet.Contains(ip) {
return false, ""
}
}
}
return true, ""
</s> add if a.allowlistMode() {
// Enable allowlist mode and use the allowlist sets.
blocked = false
ips = a.allowedIPs
ipnets = a.allowedNets </s> remove if len(d.Req.Question) == 1 {
host := strings.TrimSuffix(d.Req.Question[0].Name, ".")
if s.access.IsBlockedDomain(host) {
log.Tracef("domain %s is blocked by access settings", host)
</s> add if len(pctx.Req.Question) == 1 {
host := strings.TrimSuffix(pctx.Req.Question[0].Name, ".")
if s.access.isBlockedHost(host) {
log.Debug("host %s is in access blocklist", host) </s> remove a.lock.Lock()
defer a.lock.Unlock()
</s> add return ok
} </s> remove return resultCodeSuccess
</s> add return "", nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dnsforward.go |
net string
proto proxy.Proto | <mask> startDeferStop(t, s)
<mask>
<mask> testCases := []struct {
<mask> name string
<mask> proto string
<mask> }{{
<mask> name: "message_over_udp",
<mask> proto: proxy.ProtoUDP,
<mask> }, {
<mask> name: "message_over_tcp",
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove name string
domain string
want bool
</s> add name string
host string
want bool </s> remove proto string
</s> add proto proxy.Proto </s> remove proto string
</s> add proto proxy.Proto </s> remove func TestProcessClientID(t *testing.T) {
</s> add func TestServer_clientIDFromDNSContext(t *testing.T) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dnsforward_test.go |
net: "", | <mask> net string
<mask> proto proxy.Proto
<mask> }{{
<mask> name: "message_over_udp",
<mask> proto: proxy.ProtoUDP,
<mask> }, {
<mask> name: "message_over_tcp",
<mask> net: "tcp",
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove proto string
</s> add net string
proto proxy.Proto </s> remove wantRes resultCode
</s> add </s> remove name: "plain_match",
domain: "host1",
want: true,
</s> add name: "plain_match",
host: "host1",
want: true, </s> remove name string
domain string
want bool
</s> add name string
host string
want bool | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dnsforward_test.go |
net: "tcp", | <mask> }, {
<mask> name: "message_over_tcp",
<mask> proto: proxy.ProtoTCP,
<mask> }}
<mask>
<mask> for _, tc := range testCases {
<mask> t.Run(tc.name, func(t *testing.T) {
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove name: "wildcard_type-2_mismatch",
domain: ".host3.com",
want: false,
</s> add name: "rule_mismatch",
host: ".host3.com",
want: false, </s> remove assert.Equal(t, tc.want, aCtx.IsBlockedDomain(tc.domain))
</s> add assert.Equal(t, tc.want, a.isBlockedHost(tc.host)) </s> remove wantRes: resultCodeSuccess,
</s> add </s> remove ups, err := upstream.AddressToUpstream("1.1.1.1", upstream.Options{})
</s> add ups, err := upstream.AddressToUpstream("1.1.1.1", nil) </s> remove wantRes: resultCodeError,
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dnsforward_test.go |
opts := &upstream.Options{InsecureSkipVerify: true} | <mask> startDeferStop(t, s)
<mask>
<mask> // Create a DNS-over-QUIC upstream.
<mask> addr := s.dnsProxy.Addr(proxy.ProtoQUIC)
<mask> opts := upstream.Options{InsecureSkipVerify: true}
<mask> u, err := upstream.AddressToUpstream(fmt.Sprintf("%s://%s", proxy.ProtoQUIC, addr), opts)
<mask> require.NoError(t, err)
<mask>
<mask> // Send the test message.
<mask> req := createGoogleATestMessage()
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove conn, err := dns.Dial(proxy.ProtoUDP, addr.String())
</s> add conn, err := dns.Dial("udp", addr.String()) </s> remove client := dns.Client{Net: proxy.ProtoUDP}
</s> add client := &dns.Client{} </s> remove IDs: []string{testIP.String()},
</s> add IDs: []string{ip.String()}, </s> remove ups, err := upstream.AddressToUpstream("1.1.1.1", upstream.Options{})
</s> add ups, err := upstream.AddressToUpstream("1.1.1.1", nil) </s> remove Net: proxy.ProtoUDP,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dnsforward_test.go |
conn, err := dns.Dial("udp", addr.String()) | <mask> startDeferStop(t, s)
<mask>
<mask> // Message over UDP.
<mask> addr := s.dnsProxy.Addr(proxy.ProtoUDP)
<mask> conn, err := dns.Dial(proxy.ProtoUDP, addr.String())
<mask> require.NoErrorf(t, err, "cannot connect to the proxy: %s", err)
<mask>
<mask> sendTestMessagesAsync(t, conn)
<mask> }
<mask>
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove opts := upstream.Options{InsecureSkipVerify: true}
</s> add opts := &upstream.Options{InsecureSkipVerify: true} </s> remove client := dns.Client{Net: proxy.ProtoUDP}
</s> add client := &dns.Client{} </s> remove log.Error("etchostscontainer: %s", err)
</s> add log.Error("etchosts: %s", err) </s> remove log.Debug("etchostscontainer: modified: %s", event.Name)
</s> add log.Debug("etchosts: modified: %s", event.Name) </s> remove Net: proxy.ProtoUDP,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dnsforward_test.go |
client := &dns.Client{} | <mask> s := createTestServer(t, filterConf, forwardConf, nil)
<mask> startDeferStop(t, s)
<mask>
<mask> addr := s.dnsProxy.Addr(proxy.ProtoUDP).String()
<mask> client := dns.Client{Net: proxy.ProtoUDP}
<mask>
<mask> yandexIP := net.IP{213, 180, 193, 56}
<mask> googleIP, _ := resolver.HostToIPs("forcesafesearch.google.com")
<mask>
<mask> testCases := []struct {
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove proto string
</s> add net string
proto proxy.Proto </s> remove opts := upstream.Options{InsecureSkipVerify: true}
</s> add opts := &upstream.Options{InsecureSkipVerify: true} </s> remove conn, err := dns.Dial(proxy.ProtoUDP, addr.String())
</s> add conn, err := dns.Dial("udp", addr.String()) </s> remove proto string
</s> add proto proxy.Proto </s> remove ups, err := upstream.AddressToUpstream("1.1.1.1", upstream.Options{})
</s> add ups, err := upstream.AddressToUpstream("1.1.1.1", nil) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dnsforward_test.go |
<mask> }
<mask>
<mask> // Send a DNS request without question.
<mask> _, _, err := (&dns.Client{
<mask> Net: proxy.ProtoUDP,
<mask> Timeout: 500 * time.Millisecond,
<mask> }).Exchange(&req, addr)
<mask>
<mask> assert.NoErrorf(t, err, "got a response to an invalid query")
<mask> }
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove // ipToHostTable is an alias for the type of Server.tableIPToHost.
//
// TODO(a.garipov): Define an IPMap type in aghnet and use here and in other
// places?
type ipToHostTable = map[string]string
</s> add </s> remove d = append(d, net.ParseIP(it.Name))
</s> add ip := net.ParseIP(it.Name)
if ip != nil {
d = append(d, ip)
} </s> remove conn, err := dns.Dial(proxy.ProtoUDP, addr.String())
</s> add conn, err := dns.Dial("udp", addr.String()) </s> remove func checkIPCIDRArray(src []string) error {
for _, s := range src {
ip := net.ParseIP(s)
if ip != nil {
continue
}
_, _, err := net.ParseCIDR(s)
if err != nil {
return err
}
</s> add return </s> remove _, ipnet, err := net.ParseCIDR(s)
if err != nil {
return err
}
</s> add // isBlockedClientID returns true if the ClientID should be blocked.
func (a *accessCtx) isBlockedClientID(id string) (ok bool) {
allowlistMode := a.allowlistMode()
if id == "" {
// In allowlist mode, consider requests without client IDs
// blocked by default.
return allowlistMode
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/dnsforward_test.go | |
"encoding/binary" | <mask>
<mask> import (
<mask> "fmt"
<mask> "strings"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering"
<mask> "github.com/AdguardTeam/dnsproxy/proxy"
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove "sync"
</s> add </s> remove import { BLOCK_ACTIONS, R_CLIENT_ID, STATUS_COLORS } from '../../helpers/constants';
</s> add import { BLOCK_ACTIONS, STATUS_COLORS } from '../../helpers/constants'; | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/filter.go |
// beforeRequestHandler is the handler that is called before any other
// processing, including logs. It performs access checks and puts the client
// ID, if there is one, into the server's cache.
func (s *Server) beforeRequestHandler(
_ *proxy.Proxy,
pctx *proxy.DNSContext,
) (reply bool, err error) {
ip := aghnet.IPFromAddr(pctx.Addr)
clientID, err := s.clientIDFromDNSContext(pctx)
if err != nil {
return false, fmt.Errorf("getting clientid: %w", err)
}
blocked, _ := s.IsBlockedClient(ip, clientID)
if blocked { | <mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/miekg/dns"
<mask> )
<mask>
<mask> func (s *Server) beforeRequestHandler(_ *proxy.Proxy, d *proxy.DNSContext) (bool, error) {
<mask> ip := aghnet.IPFromAddr(d.Addr)
<mask> disallowed, _ := s.access.IsBlockedIP(ip)
<mask> if disallowed {
<mask> log.Tracef("Client IP %s is blocked by settings", ip)
<mask> return false, nil
<mask> }
<mask>
<mask> if len(d.Req.Question) == 1 {
<mask> host := strings.TrimSuffix(d.Req.Question[0].Name, ".")
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove if len(d.Req.Question) == 1 {
host := strings.TrimSuffix(d.Req.Question[0].Name, ".")
if s.access.IsBlockedDomain(host) {
log.Tracef("domain %s is blocked by access settings", host)
</s> add if len(pctx.Req.Question) == 1 {
host := strings.TrimSuffix(pctx.Req.Question[0].Name, ".")
if s.access.isBlockedHost(host) {
log.Debug("host %s is in access blocklist", host) </s> remove func onDNSRequest(d *proxy.DNSContext) {
ip := aghnet.IPFromAddr(d.Addr)
</s> add func onDNSRequest(pctx *proxy.DNSContext) {
ip := aghnet.IPFromAddr(pctx.Addr) </s> remove d = append(d, net.ParseIP(it.Name))
</s> add ip := net.ParseIP(it.Name)
if ip != nil {
d = append(d, ip)
} </s> remove // IsBlockedIP - return TRUE if this client should be blocked
func (s *Server) IsBlockedIP(ip net.IP) (bool, string) {
if ip == nil {
return false, ""
</s> add // IsBlockedClient returns true if the client is blocked by the current access
// settings.
func (s *Server) IsBlockedClient(ip net.IP, clientID string) (blocked bool, rule string) {
s.serverLock.RLock()
defer s.serverLock.RUnlock()
allowlistMode := s.access.allowlistMode()
blockedByIP, rule := s.access.isBlockedIP(ip)
blockedByClientID := s.access.isBlockedClientID(clientID)
// Allow if at least one of the checks allows in allowlist mode, but
// block if at least one of the checks blocks in blocklist mode.
if allowlistMode && blockedByIP && blockedByClientID {
log.Debug("client %s (id %q) is not in access allowlist", ip, clientID)
// Return now without substituting the empty rule for the
// clientID because the rule can't be empty here.
return true, rule
} else if !allowlistMode && (blockedByIP || blockedByClientID) {
log.Debug("client %s (id %q) is in access blocklist", ip, clientID)
blocked = true
}
if rule == "" {
rule = clientID | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/filter.go |
if len(pctx.Req.Question) == 1 {
host := strings.TrimSuffix(pctx.Req.Question[0].Name, ".")
if s.access.isBlockedHost(host) {
log.Debug("host %s is in access blocklist", host) | <mask> log.Tracef("Client IP %s is blocked by settings", ip)
<mask> return false, nil
<mask> }
<mask>
<mask> if len(d.Req.Question) == 1 {
<mask> host := strings.TrimSuffix(d.Req.Question[0].Name, ".")
<mask> if s.access.IsBlockedDomain(host) {
<mask> log.Tracef("domain %s is blocked by access settings", host)
<mask>
<mask> return false, nil
<mask> }
<mask> }
<mask>
</s> Pull request: all: allow clientid in access settings
Updates #2624.
Updates #3162.
Squashed commit of the following:
commit 68860da717a23a0bfeba14b7fe10b5e4ad38726d
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:41:33 2021 +0300
all: imp types, names
commit ebd4ec26636853d0d58c4e331e6a78feede20813
Merge: 239eb721 16e5e09c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:14:33 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 239eb7215abc47e99a0300a0f4cf56002689b1a9
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 15:13:10 2021 +0300
all: fix client blocking check
commit e6bece3ea8367b3cbe3d90702a3368c870ad4f13
Merge: 9935f2a3 9d1656b5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Jun 29 13:12:28 2021 +0300
Merge branch 'master' into 2624-clientid-access
commit 9935f2a30bcfae2b853f3ef610c0ab7a56a8f448
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Jun 29 11:26:51 2021 +0300
client: show block button for client id
commit ed786a6a74a081cd89e9d67df3537a4fadd54831
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:56:23 2021 +0300
client: imp i18n
commit 4fed21c68473ad408960c08a7d87624cabce1911
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 15:34:09 2021 +0300
all: imp i18n, docs
commit 55e65c0d6b939560c53dcb834a4557eb3853d194
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Jun 25 13:34:01 2021 +0300
all: fix cache, imp code, docs, tests
commit c1e5a83e76deb44b1f92729bb9ddfcc6a96ac4a8
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Thu Jun 24 19:27:12 2021 +0300
all: allow clientid in access settings </s> remove func (s *Server) beforeRequestHandler(_ *proxy.Proxy, d *proxy.DNSContext) (bool, error) {
ip := aghnet.IPFromAddr(d.Addr)
disallowed, _ := s.access.IsBlockedIP(ip)
if disallowed {
log.Tracef("Client IP %s is blocked by settings", ip)
</s> add // beforeRequestHandler is the handler that is called before any other
// processing, including logs. It performs access checks and puts the client
// ID, if there is one, into the server's cache.
func (s *Server) beforeRequestHandler(
_ *proxy.Proxy,
pctx *proxy.DNSContext,
) (reply bool, err error) {
ip := aghnet.IPFromAddr(pctx.Addr)
clientID, err := s.clientIDFromDNSContext(pctx)
if err != nil {
return false, fmt.Errorf("getting clientid: %w", err)
}
blocked, _ := s.IsBlockedClient(ip, clientID)
if blocked { </s> remove // IsBlockedIP - return TRUE if this client should be blocked
func (s *Server) IsBlockedIP(ip net.IP) (bool, string) {
if ip == nil {
return false, ""
</s> add // IsBlockedClient returns true if the client is blocked by the current access
// settings.
func (s *Server) IsBlockedClient(ip net.IP, clientID string) (blocked bool, rule string) {
s.serverLock.RLock()
defer s.serverLock.RUnlock()
allowlistMode := s.access.allowlistMode()
blockedByIP, rule := s.access.isBlockedIP(ip)
blockedByClientID := s.access.isBlockedClientID(clientID)
// Allow if at least one of the checks allows in allowlist mode, but
// block if at least one of the checks blocks in blocklist mode.
if allowlistMode && blockedByIP && blockedByClientID {
log.Debug("client %s (id %q) is not in access allowlist", ip, clientID)
// Return now without substituting the empty rule for the
// clientID because the rule can't be empty here.
return true, rule
} else if !allowlistMode && (blockedByIP || blockedByClientID) {
log.Debug("client %s (id %q) is in access blocklist", ip, clientID)
blocked = true
}
if rule == "" {
rule = clientID </s> remove _, ipnet, err := net.ParseCIDR(s)
if err != nil {
return err
}
</s> add // isBlockedClientID returns true if the ClientID should be blocked.
func (a *accessCtx) isBlockedClientID(id string) (ok bool) {
allowlistMode := a.allowlistMode()
if id == "" {
// In allowlist mode, consider requests without client IDs
// blocked by default.
return allowlistMode
} </s> remove ctx.err = fmt.Errorf("proxy ctx http request of proto %s is nil", pctx.Proto)
return resultCodeError
</s> add return "", fmt.Errorf(
"proxy ctx http request of proto %s is nil",
pctx.Proto,
) </s> remove if len(a.allowedClientsIPNet) != 0 {
for _, ipnet := range a.allowedClientsIPNet {
if ipnet.Contains(ip) {
return false, ""
}
}
}
return true, ""
</s> add if a.allowlistMode() {
// Enable allowlist mode and use the allowlist sets.
blocked = false
ips = a.allowedIPs
ipnets = a.allowedNets | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/e08a64ebe4919579275130e5a0c2e3f7c7ff070e | internal/dnsforward/filter.go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.