slidge-whatsapp 0.2.7__cp312-cp312-manylinux_2_36_aarch64.whl → 0.3.0b0__cp312-cp312-manylinux_2_36_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- slidge_whatsapp/contact.py +13 -3
- slidge_whatsapp/event.go +107 -37
- slidge_whatsapp/gateway.go +7 -63
- slidge_whatsapp/gateway.py +2 -3
- slidge_whatsapp/generated/_whatsapp.cpython-312-aarch64-linux-gnu.h +186 -169
- slidge_whatsapp/generated/_whatsapp.cpython-312-aarch64-linux-gnu.so +0 -0
- slidge_whatsapp/generated/build.py +148 -134
- slidge_whatsapp/generated/whatsapp.c +1652 -1380
- slidge_whatsapp/generated/whatsapp.go +798 -687
- slidge_whatsapp/generated/whatsapp.py +1169 -1044
- slidge_whatsapp/generated/whatsapp_go.h +186 -169
- slidge_whatsapp/go.mod +18 -15
- slidge_whatsapp/go.sum +38 -26
- slidge_whatsapp/group.py +34 -30
- slidge_whatsapp/media/media.go +1 -1
- slidge_whatsapp/session.go +33 -16
- slidge_whatsapp/session.py +46 -14
- slidge_whatsapp/vendor/github.com/beeper/argo-go/LICENSE +9 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/block/blockreader.go +329 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/block/blockwriter.go +417 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/codec/decoder.go +652 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/codec/encoder.go +985 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/header/header.go +135 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/internal/util/util.go +133 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/label/label.go +384 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/label/wiremarkers.go +37 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/pkg/bitset/bitset.go +197 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/pkg/buf/buf.go +420 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/pkg/varint/varint.go +246 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/wire/wire.go +614 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/wirecodec/decode.go +341 -0
- slidge_whatsapp/vendor/github.com/elliotchance/orderedmap/v3/LICENSE +21 -0
- slidge_whatsapp/vendor/github.com/elliotchance/orderedmap/v3/list.go +95 -0
- slidge_whatsapp/vendor/github.com/elliotchance/orderedmap/v3/orderedmap.go +187 -0
- slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz.go +1 -0
- slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz_cgo.go +3 -0
- slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz_nocgo.go +4 -5
- slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/purego_darwin.go +11 -1
- slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/purego_linux.go +10 -0
- slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/purego_windows.go +12 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/.gitignore +0 -2
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/CHANGELOG.md +30 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/COPYRIGHT.txt +6 -1
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/README.md +14 -17
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/abi.go +1 -1
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/abi2.go +7 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/LICENSE +21 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/darwin_amd64/libffi.8.dylib +0 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/darwin_arm64/libffi.8.dylib +0 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/windows_amd64/libffi-8.dll +0 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/cif.go +15 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/cif_arm64.go +16 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed.go +49 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed_darwin_amd64.go +10 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed_darwin_arm64.go +10 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed_windows_amd64.go +10 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/ffi.go +51 -13
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/init.go +22 -9
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/README.md +2 -0
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c +3096 -1651
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h +188 -128
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_userauth.go +13 -140
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3ext.h +4 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.23.go +2 -2
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.25.go +37 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/LICENSE +19 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/argmap.go +37 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/collections.go +148 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/comment.go +31 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/decode.go +216 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/definition.go +110 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/directive.go +43 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/document.go +89 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/dumper.go +159 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/fragment.go +41 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/operation.go +32 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/path.go +72 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/selection.go +41 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/source.go +19 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/type.go +68 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/value.go +122 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/handleerrors.go +60 -26
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/networkerror.go +2 -1
- slidge_whatsapp/vendor/go.mau.fi/util/exstrings/stringutil.go +28 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exsync/event.go +19 -3
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/.pre-commit-config.yaml +3 -3
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/decode.go +1 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/hash.go +1 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate.go +5 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/argo/argo-wire-type-store.argo +63 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/argo/argo.go +62 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/argo/name-to-queryids.json +306 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/armadillomessage.go +3 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/call.go +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/client.go +15 -18
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/connectionevents.go +5 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download.go +4 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/errors.go +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/group.go +97 -25
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/internals.go +22 -10
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/message.go +10 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/msgsecret.go +2 -14
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/newsletter.go +83 -7
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/notification.go +5 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/pair-code.go +2 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/presence.go +15 -6
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waBotMetadata/WABotMetadata.pb.go +5156 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waBotMetadata/WABotMetadata.proto +516 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/WACompanionReg.pb.go +30 -3
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/WACompanionReg.proto +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.pb.go +8532 -11526
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.proto +132 -438
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.pb.go +52 -23
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.proto +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waStatusAttributions/WAStatusAttributions.pb.go +225 -73
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waStatusAttributions/WAStatusAttributions.proto +21 -5
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.pb.go +884 -441
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.proto +40 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.pb.go +60 -38
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.proto +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/receipt.go +8 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/send.go +6 -4
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/clientpayload.go +1 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/noop.go +3 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/store.go +25 -5
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/store.go +3 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/call.go +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/events/events.go +8 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/jid.go +2 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/user.go +2 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/user.go +12 -8
- slidge_whatsapp/vendor/golang.org/x/crypto/curve25519/curve25519.go +1 -1
- slidge_whatsapp/vendor/golang.org/x/net/http2/config.go +44 -2
- slidge_whatsapp/vendor/golang.org/x/net/http2/gotrack.go +14 -3
- slidge_whatsapp/vendor/golang.org/x/net/http2/http2.go +7 -29
- slidge_whatsapp/vendor/golang.org/x/net/http2/server.go +53 -71
- slidge_whatsapp/vendor/golang.org/x/net/http2/transport.go +20 -74
- slidge_whatsapp/vendor/golang.org/x/sys/unix/affinity_linux.go +1 -3
- slidge_whatsapp/vendor/golang.org/x/sys/unix/mkerrors.sh +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_darwin.go +1 -55
- slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_solaris.go +1 -1
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux.go +47 -16
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +4 -4
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux.go +168 -12
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +17 -1
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +18 -2
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +17 -1
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +17 -1
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +18 -2
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/windows/types_windows.go +6 -0
- slidge_whatsapp/vendor/golang.org/x/sys/windows/zsyscall_windows.go +483 -483
- slidge_whatsapp/vendor/google.golang.org/protobuf/encoding/protowire/wire.go +25 -1
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb +0 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/editions.go +10 -5
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/presence.go +33 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/api_gen.go +6 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +68 -22
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/codec_message_opaque.go +2 -1
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/message_opaque.go +8 -37
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/presence.go +0 -3
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/version/version.go +1 -1
- slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +8 -0
- slidge_whatsapp/vendor/modules.txt +43 -23
- {slidge_whatsapp-0.2.7.dist-info → slidge_whatsapp-0.3.0b0.dist-info}/METADATA +2 -2
- {slidge_whatsapp-0.2.7.dist-info → slidge_whatsapp-0.3.0b0.dist-info}/RECORD +208 -161
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/abi_amd64.go +0 -7
- slidge_whatsapp/vendor/golang.org/x/net/http2/config_go124.go +0 -61
- slidge_whatsapp/vendor/golang.org/x/net/http2/config_pre_go124.go +0 -16
- slidge_whatsapp/vendor/golang.org/x/net/http2/timer.go +0 -20
- {slidge_whatsapp-0.2.7.dist-info → slidge_whatsapp-0.3.0b0.dist-info}/LICENSE +0 -0
- {slidge_whatsapp-0.2.7.dist-info → slidge_whatsapp-0.3.0b0.dist-info}/WHEEL +0 -0
- {slidge_whatsapp-0.2.7.dist-info → slidge_whatsapp-0.3.0b0.dist-info}/entry_points.txt +0 -0
|
@@ -16,53 +16,10 @@ package sqlite3
|
|
|
16
16
|
#else
|
|
17
17
|
#include <sqlite3.h>
|
|
18
18
|
#endif
|
|
19
|
-
#include <stdlib.h>
|
|
20
|
-
|
|
21
|
-
static int
|
|
22
|
-
_sqlite3_user_authenticate(sqlite3* db, const char* zUsername, const char* aPW, int nPW)
|
|
23
|
-
{
|
|
24
|
-
return sqlite3_user_authenticate(db, zUsername, aPW, nPW);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
static int
|
|
28
|
-
_sqlite3_user_add(sqlite3* db, const char* zUsername, const char* aPW, int nPW, int isAdmin)
|
|
29
|
-
{
|
|
30
|
-
return sqlite3_user_add(db, zUsername, aPW, nPW, isAdmin);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
static int
|
|
34
|
-
_sqlite3_user_change(sqlite3* db, const char* zUsername, const char* aPW, int nPW, int isAdmin)
|
|
35
|
-
{
|
|
36
|
-
return sqlite3_user_change(db, zUsername, aPW, nPW, isAdmin);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
static int
|
|
40
|
-
_sqlite3_user_delete(sqlite3* db, const char* zUsername)
|
|
41
|
-
{
|
|
42
|
-
return sqlite3_user_delete(db, zUsername);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
static int
|
|
46
|
-
_sqlite3_auth_enabled(sqlite3* db)
|
|
47
|
-
{
|
|
48
|
-
int exists = -1;
|
|
49
|
-
|
|
50
|
-
sqlite3_stmt *stmt;
|
|
51
|
-
sqlite3_prepare_v2(db, "select count(type) from sqlite_master WHERE type='table' and name='sqlite_user';", -1, &stmt, NULL);
|
|
52
|
-
|
|
53
|
-
while ( sqlite3_step(stmt) == SQLITE_ROW) {
|
|
54
|
-
exists = sqlite3_column_int(stmt, 0);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
sqlite3_finalize(stmt);
|
|
58
|
-
|
|
59
|
-
return exists;
|
|
60
|
-
}
|
|
61
19
|
*/
|
|
62
20
|
import "C"
|
|
63
21
|
import (
|
|
64
22
|
"errors"
|
|
65
|
-
"unsafe"
|
|
66
23
|
)
|
|
67
24
|
|
|
68
25
|
const (
|
|
@@ -70,8 +27,9 @@ const (
|
|
|
70
27
|
)
|
|
71
28
|
|
|
72
29
|
var (
|
|
73
|
-
ErrUnauthorized
|
|
74
|
-
ErrAdminRequired
|
|
30
|
+
ErrUnauthorized = errors.New("SQLITE_AUTH: Unauthorized")
|
|
31
|
+
ErrAdminRequired = errors.New("SQLITE_AUTH: Unauthorized; Admin Privileges Required")
|
|
32
|
+
errUserAuthNoLongerSupported = errors.New("sqlite3: the sqlite_userauth tag is no longer supported as the userauth extension is no longer supported by the SQLite authors, see https://github.com/mattn/go-sqlite3/issues/1341")
|
|
75
33
|
)
|
|
76
34
|
|
|
77
35
|
// Authenticate will perform an authentication of the provided username
|
|
@@ -88,15 +46,7 @@ var (
|
|
|
88
46
|
// If the SQLITE_USER table is not present in the database file, then
|
|
89
47
|
// this interface is a harmless no-op returning SQLITE_OK.
|
|
90
48
|
func (c *SQLiteConn) Authenticate(username, password string) error {
|
|
91
|
-
|
|
92
|
-
switch rv {
|
|
93
|
-
case C.SQLITE_ERROR, C.SQLITE_AUTH:
|
|
94
|
-
return ErrUnauthorized
|
|
95
|
-
case C.SQLITE_OK:
|
|
96
|
-
return nil
|
|
97
|
-
default:
|
|
98
|
-
return c.lastError()
|
|
99
|
-
}
|
|
49
|
+
return errUserAuthNoLongerSupported
|
|
100
50
|
}
|
|
101
51
|
|
|
102
52
|
// authenticate provides the actual authentication to SQLite.
|
|
@@ -109,17 +59,7 @@ func (c *SQLiteConn) Authenticate(username, password string) error {
|
|
|
109
59
|
// C.SQLITE_ERROR (1)
|
|
110
60
|
// C.SQLITE_AUTH (23)
|
|
111
61
|
func (c *SQLiteConn) authenticate(username, password string) int {
|
|
112
|
-
|
|
113
|
-
cuser := C.CString(username)
|
|
114
|
-
cpass := C.CString(password)
|
|
115
|
-
|
|
116
|
-
// Free C Variables
|
|
117
|
-
defer func() {
|
|
118
|
-
C.free(unsafe.Pointer(cuser))
|
|
119
|
-
C.free(unsafe.Pointer(cpass))
|
|
120
|
-
}()
|
|
121
|
-
|
|
122
|
-
return int(C._sqlite3_user_authenticate(c.db, cuser, cpass, C.int(len(password))))
|
|
62
|
+
return 1
|
|
123
63
|
}
|
|
124
64
|
|
|
125
65
|
// AuthUserAdd can be used (by an admin user only)
|
|
@@ -131,20 +71,7 @@ func (c *SQLiteConn) authenticate(username, password string) int {
|
|
|
131
71
|
// for any ATTACH-ed databases. Any call to AuthUserAdd by a
|
|
132
72
|
// non-admin user results in an error.
|
|
133
73
|
func (c *SQLiteConn) AuthUserAdd(username, password string, admin bool) error {
|
|
134
|
-
|
|
135
|
-
if admin {
|
|
136
|
-
isAdmin = 1
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
rv := c.authUserAdd(username, password, isAdmin)
|
|
140
|
-
switch rv {
|
|
141
|
-
case C.SQLITE_ERROR, C.SQLITE_AUTH:
|
|
142
|
-
return ErrAdminRequired
|
|
143
|
-
case C.SQLITE_OK:
|
|
144
|
-
return nil
|
|
145
|
-
default:
|
|
146
|
-
return c.lastError()
|
|
147
|
-
}
|
|
74
|
+
return errUserAuthNoLongerSupported
|
|
148
75
|
}
|
|
149
76
|
|
|
150
77
|
// authUserAdd enables the User Authentication if not enabled.
|
|
@@ -162,17 +89,7 @@ func (c *SQLiteConn) AuthUserAdd(username, password string, admin bool) error {
|
|
|
162
89
|
// C.SQLITE_ERROR (1)
|
|
163
90
|
// C.SQLITE_AUTH (23)
|
|
164
91
|
func (c *SQLiteConn) authUserAdd(username, password string, admin int) int {
|
|
165
|
-
|
|
166
|
-
cuser := C.CString(username)
|
|
167
|
-
cpass := C.CString(password)
|
|
168
|
-
|
|
169
|
-
// Free C Variables
|
|
170
|
-
defer func() {
|
|
171
|
-
C.free(unsafe.Pointer(cuser))
|
|
172
|
-
C.free(unsafe.Pointer(cpass))
|
|
173
|
-
}()
|
|
174
|
-
|
|
175
|
-
return int(C._sqlite3_user_add(c.db, cuser, cpass, C.int(len(password)), C.int(admin)))
|
|
92
|
+
return 1
|
|
176
93
|
}
|
|
177
94
|
|
|
178
95
|
// AuthUserChange can be used to change a users
|
|
@@ -181,20 +98,7 @@ func (c *SQLiteConn) authUserAdd(username, password string, admin int) int {
|
|
|
181
98
|
// credentials or admin privilege setting. No user may change their own
|
|
182
99
|
// admin privilege setting.
|
|
183
100
|
func (c *SQLiteConn) AuthUserChange(username, password string, admin bool) error {
|
|
184
|
-
|
|
185
|
-
if admin {
|
|
186
|
-
isAdmin = 1
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
rv := c.authUserChange(username, password, isAdmin)
|
|
190
|
-
switch rv {
|
|
191
|
-
case C.SQLITE_ERROR, C.SQLITE_AUTH:
|
|
192
|
-
return ErrAdminRequired
|
|
193
|
-
case C.SQLITE_OK:
|
|
194
|
-
return nil
|
|
195
|
-
default:
|
|
196
|
-
return c.lastError()
|
|
197
|
-
}
|
|
101
|
+
return errUserAuthNoLongerSupported
|
|
198
102
|
}
|
|
199
103
|
|
|
200
104
|
// authUserChange allows to modify a user.
|
|
@@ -215,17 +119,7 @@ func (c *SQLiteConn) AuthUserChange(username, password string, admin bool) error
|
|
|
215
119
|
// C.SQLITE_ERROR (1)
|
|
216
120
|
// C.SQLITE_AUTH (23)
|
|
217
121
|
func (c *SQLiteConn) authUserChange(username, password string, admin int) int {
|
|
218
|
-
|
|
219
|
-
cuser := C.CString(username)
|
|
220
|
-
cpass := C.CString(password)
|
|
221
|
-
|
|
222
|
-
// Free C Variables
|
|
223
|
-
defer func() {
|
|
224
|
-
C.free(unsafe.Pointer(cuser))
|
|
225
|
-
C.free(unsafe.Pointer(cpass))
|
|
226
|
-
}()
|
|
227
|
-
|
|
228
|
-
return int(C._sqlite3_user_change(c.db, cuser, cpass, C.int(len(password)), C.int(admin)))
|
|
122
|
+
return 1
|
|
229
123
|
}
|
|
230
124
|
|
|
231
125
|
// AuthUserDelete can be used (by an admin user only)
|
|
@@ -234,15 +128,7 @@ func (c *SQLiteConn) authUserChange(username, password string, admin int) int {
|
|
|
234
128
|
// the database cannot be converted into a no-authentication-required
|
|
235
129
|
// database.
|
|
236
130
|
func (c *SQLiteConn) AuthUserDelete(username string) error {
|
|
237
|
-
|
|
238
|
-
switch rv {
|
|
239
|
-
case C.SQLITE_ERROR, C.SQLITE_AUTH:
|
|
240
|
-
return ErrAdminRequired
|
|
241
|
-
case C.SQLITE_OK:
|
|
242
|
-
return nil
|
|
243
|
-
default:
|
|
244
|
-
return c.lastError()
|
|
245
|
-
}
|
|
131
|
+
return errUserAuthNoLongerSupported
|
|
246
132
|
}
|
|
247
133
|
|
|
248
134
|
// authUserDelete can be used to delete a user.
|
|
@@ -258,25 +144,12 @@ func (c *SQLiteConn) AuthUserDelete(username string) error {
|
|
|
258
144
|
// C.SQLITE_ERROR (1)
|
|
259
145
|
// C.SQLITE_AUTH (23)
|
|
260
146
|
func (c *SQLiteConn) authUserDelete(username string) int {
|
|
261
|
-
|
|
262
|
-
cuser := C.CString(username)
|
|
263
|
-
|
|
264
|
-
// Free C Variables
|
|
265
|
-
defer func() {
|
|
266
|
-
C.free(unsafe.Pointer(cuser))
|
|
267
|
-
}()
|
|
268
|
-
|
|
269
|
-
return int(C._sqlite3_user_delete(c.db, cuser))
|
|
147
|
+
return 1
|
|
270
148
|
}
|
|
271
149
|
|
|
272
150
|
// AuthEnabled checks if the database is protected by user authentication
|
|
273
151
|
func (c *SQLiteConn) AuthEnabled() (exists bool) {
|
|
274
|
-
|
|
275
|
-
if rv == 1 {
|
|
276
|
-
exists = true
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
return
|
|
152
|
+
return false
|
|
280
153
|
}
|
|
281
154
|
|
|
282
155
|
// authEnabled perform the actual check for user authentication.
|
|
@@ -289,7 +162,7 @@ func (c *SQLiteConn) AuthEnabled() (exists bool) {
|
|
|
289
162
|
// 0 - Disabled
|
|
290
163
|
// 1 - Enabled
|
|
291
164
|
func (c *SQLiteConn) authEnabled() int {
|
|
292
|
-
return
|
|
165
|
+
return 0
|
|
293
166
|
}
|
|
294
167
|
|
|
295
168
|
// EOF
|
|
@@ -371,6 +371,8 @@ struct sqlite3_api_routines {
|
|
|
371
371
|
/* Version 3.44.0 and later */
|
|
372
372
|
void *(*get_clientdata)(sqlite3*,const char*);
|
|
373
373
|
int (*set_clientdata)(sqlite3*, const char*, void*, void(*)(void*));
|
|
374
|
+
/* Version 3.50.0 and later */
|
|
375
|
+
int (*setlk_timeout)(sqlite3*,int,int);
|
|
374
376
|
};
|
|
375
377
|
|
|
376
378
|
/*
|
|
@@ -704,6 +706,8 @@ typedef int (*sqlite3_loadext_entry)(
|
|
|
704
706
|
/* Version 3.44.0 and later */
|
|
705
707
|
#define sqlite3_get_clientdata sqlite3_api->get_clientdata
|
|
706
708
|
#define sqlite3_set_clientdata sqlite3_api->set_clientdata
|
|
709
|
+
/* Version 3.50.0 and later */
|
|
710
|
+
#define sqlite3_setlk_timeout sqlite3_api->setlk_timeout
|
|
707
711
|
#endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
|
|
708
712
|
|
|
709
713
|
#if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//go:build gc && go1.25
|
|
2
|
+
// +build gc,go1.25
|
|
3
|
+
|
|
4
|
+
package goid
|
|
5
|
+
|
|
6
|
+
type stack struct {
|
|
7
|
+
lo uintptr
|
|
8
|
+
hi uintptr
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type gobuf struct {
|
|
12
|
+
sp uintptr
|
|
13
|
+
pc uintptr
|
|
14
|
+
g uintptr
|
|
15
|
+
ctxt uintptr
|
|
16
|
+
lr uintptr
|
|
17
|
+
bp uintptr
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type g struct {
|
|
21
|
+
stack stack
|
|
22
|
+
stackguard0 uintptr
|
|
23
|
+
stackguard1 uintptr
|
|
24
|
+
|
|
25
|
+
_panic uintptr
|
|
26
|
+
_defer uintptr
|
|
27
|
+
m uintptr
|
|
28
|
+
sched gobuf
|
|
29
|
+
syscallsp uintptr
|
|
30
|
+
syscallpc uintptr
|
|
31
|
+
syscallbp uintptr
|
|
32
|
+
stktopsp uintptr
|
|
33
|
+
param uintptr
|
|
34
|
+
atomicstatus uint32
|
|
35
|
+
stackLock uint32
|
|
36
|
+
goid int64 // Here it is!
|
|
37
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2018 Adam Scarr
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
package ast
|
|
2
|
+
|
|
3
|
+
func arg2map(defs ArgumentDefinitionList, args ArgumentList, vars map[string]interface{}) map[string]interface{} {
|
|
4
|
+
result := map[string]interface{}{}
|
|
5
|
+
var err error
|
|
6
|
+
|
|
7
|
+
for _, argDef := range defs {
|
|
8
|
+
var val interface{}
|
|
9
|
+
var hasValue bool
|
|
10
|
+
|
|
11
|
+
if argValue := args.ForName(argDef.Name); argValue != nil {
|
|
12
|
+
if argValue.Value.Kind == Variable {
|
|
13
|
+
val, hasValue = vars[argValue.Value.Raw]
|
|
14
|
+
} else {
|
|
15
|
+
val, err = argValue.Value.Value(vars)
|
|
16
|
+
if err != nil {
|
|
17
|
+
panic(err)
|
|
18
|
+
}
|
|
19
|
+
hasValue = true
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if !hasValue && argDef.DefaultValue != nil {
|
|
24
|
+
val, err = argDef.DefaultValue.Value(vars)
|
|
25
|
+
if err != nil {
|
|
26
|
+
panic(err)
|
|
27
|
+
}
|
|
28
|
+
hasValue = true
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if hasValue {
|
|
32
|
+
result[argDef.Name] = val
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return result
|
|
37
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
package ast
|
|
2
|
+
|
|
3
|
+
type FieldList []*FieldDefinition
|
|
4
|
+
|
|
5
|
+
func (l FieldList) ForName(name string) *FieldDefinition {
|
|
6
|
+
for _, it := range l {
|
|
7
|
+
if it.Name == name {
|
|
8
|
+
return it
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return nil
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type EnumValueList []*EnumValueDefinition
|
|
15
|
+
|
|
16
|
+
func (l EnumValueList) ForName(name string) *EnumValueDefinition {
|
|
17
|
+
for _, it := range l {
|
|
18
|
+
if it.Name == name {
|
|
19
|
+
return it
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return nil
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type DirectiveList []*Directive
|
|
26
|
+
|
|
27
|
+
func (l DirectiveList) ForName(name string) *Directive {
|
|
28
|
+
for _, it := range l {
|
|
29
|
+
if it.Name == name {
|
|
30
|
+
return it
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return nil
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
func (l DirectiveList) ForNames(name string) []*Directive {
|
|
37
|
+
resp := []*Directive{}
|
|
38
|
+
for _, it := range l {
|
|
39
|
+
if it.Name == name {
|
|
40
|
+
resp = append(resp, it)
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return resp
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type OperationList []*OperationDefinition
|
|
47
|
+
|
|
48
|
+
func (l OperationList) ForName(name string) *OperationDefinition {
|
|
49
|
+
if name == "" && len(l) == 1 {
|
|
50
|
+
return l[0]
|
|
51
|
+
}
|
|
52
|
+
for _, it := range l {
|
|
53
|
+
if it.Name == name {
|
|
54
|
+
return it
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return nil
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
type FragmentDefinitionList []*FragmentDefinition
|
|
61
|
+
|
|
62
|
+
func (l FragmentDefinitionList) ForName(name string) *FragmentDefinition {
|
|
63
|
+
for _, it := range l {
|
|
64
|
+
if it.Name == name {
|
|
65
|
+
return it
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return nil
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
type VariableDefinitionList []*VariableDefinition
|
|
72
|
+
|
|
73
|
+
func (l VariableDefinitionList) ForName(name string) *VariableDefinition {
|
|
74
|
+
for _, it := range l {
|
|
75
|
+
if it.Variable == name {
|
|
76
|
+
return it
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return nil
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
type ArgumentList []*Argument
|
|
83
|
+
|
|
84
|
+
func (l ArgumentList) ForName(name string) *Argument {
|
|
85
|
+
for _, it := range l {
|
|
86
|
+
if it.Name == name {
|
|
87
|
+
return it
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return nil
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
type ArgumentDefinitionList []*ArgumentDefinition
|
|
94
|
+
|
|
95
|
+
func (l ArgumentDefinitionList) ForName(name string) *ArgumentDefinition {
|
|
96
|
+
for _, it := range l {
|
|
97
|
+
if it.Name == name {
|
|
98
|
+
return it
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return nil
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
type SchemaDefinitionList []*SchemaDefinition
|
|
105
|
+
|
|
106
|
+
type DirectiveDefinitionList []*DirectiveDefinition
|
|
107
|
+
|
|
108
|
+
func (l DirectiveDefinitionList) ForName(name string) *DirectiveDefinition {
|
|
109
|
+
for _, it := range l {
|
|
110
|
+
if it.Name == name {
|
|
111
|
+
return it
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return nil
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
type DefinitionList []*Definition
|
|
118
|
+
|
|
119
|
+
func (l DefinitionList) ForName(name string) *Definition {
|
|
120
|
+
for _, it := range l {
|
|
121
|
+
if it.Name == name {
|
|
122
|
+
return it
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return nil
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
type OperationTypeDefinitionList []*OperationTypeDefinition
|
|
129
|
+
|
|
130
|
+
func (l OperationTypeDefinitionList) ForType(name string) *OperationTypeDefinition {
|
|
131
|
+
for _, it := range l {
|
|
132
|
+
if it.Type == name {
|
|
133
|
+
return it
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return nil
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
type ChildValueList []*ChildValue
|
|
140
|
+
|
|
141
|
+
func (v ChildValueList) ForName(name string) *Value {
|
|
142
|
+
for _, f := range v {
|
|
143
|
+
if f.Name == name {
|
|
144
|
+
return f.Value
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return nil
|
|
148
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
package ast
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"strconv"
|
|
5
|
+
"strings"
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
type Comment struct {
|
|
9
|
+
Value string
|
|
10
|
+
Position *Position
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
func (c *Comment) Text() string {
|
|
14
|
+
return strings.TrimPrefix(c.Value, "#")
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
type CommentGroup struct {
|
|
18
|
+
List []*Comment
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
func (c *CommentGroup) Dump() string {
|
|
22
|
+
if len(c.List) == 0 {
|
|
23
|
+
return ""
|
|
24
|
+
}
|
|
25
|
+
var builder strings.Builder
|
|
26
|
+
for _, comment := range c.List {
|
|
27
|
+
builder.WriteString(comment.Value)
|
|
28
|
+
builder.WriteString("\n")
|
|
29
|
+
}
|
|
30
|
+
return strconv.Quote(builder.String())
|
|
31
|
+
}
|