Commit Graph

25 Commits

Author SHA1 Message Date
Max Radermacher
be8ba49b4e
[ServiceId] Update protobuf field names 2023-08-02 17:21:59 -05:00
Max Radermacher
2599b85e0b
Remove legacyMessage & clean up REST envelopes 2023-05-10 14:34:42 -07:00
Max Radermacher
94a9c8cd65 Improve the performance of some tests 2023-04-17 14:14:57 -07:00
Evan Hahn
370ff654e7
Change license to AGPL
Change license to AGPL

This commit:

- Updates the `LICENSE` file

- Start every file with something like:

      // Copyright YEAR_FIRST_PUBLISHED Signal Messenger, LLC
      // SPDX-License-Identifier: AGPL-3.0-only

---

First, I removed existing license headers with this Ruby 3.1.2 script:

    require 'set'

    EXTENSIONS_TO_CHECK = Set['.h', '.hpp', '.cpp', '.m', '.mm', '.pch', '.swift']

    same = 0
    different = 0

    all_files = `git ls-files`.lines.map { |line| line.strip }
    all_files.each do |relative_path|
      if relative_path == 'Pods'
        next
      end

      unless EXTENSIONS_TO_CHECK.include? File.extname(relative_path)
        next
      end

      path = File.expand_path(relative_path)

      contents = File.read(path)
      new_contents = contents.sub(/\/\/\n\/\/  Copyright .*\n\/\/\n\n/, '')

      if contents == new_contents
        same += 1
      else
        different += 1
      end

      File.write(path, new_contents)
    end

    puts "updated #{different} file(s), left #{same} untouched"

I'm sure this script could be improved, but it worked well enough.

Then, I created `Scripts/lint/lint-license-headers` and ran it to auto-
fix a lot of files. This changed the mode of some files, but I think
that's actually desirable. For example,
`SignalServiceKit/src/Util/AppContext.m` previously had a mode of
`0755/-rwxr-xr-x`, and it's now `0644/-rw-r--r--`.

Then I fixed some stragglers and updated the precommit script.

See [a similar change in the Desktop app][0].

[0]: 8bfaf598af
2022-10-13 08:25:37 -05:00
Evan Hahn
a066511a62 Remove useless test setup/teardown
We had a lot of functions like this, which are useless:

    override func setUp() {
        super.setUp()
    }

This removes them.
2022-10-04 14:06:34 -07:00
Evan Hahn
4a0141be41
Omit E164 from outgoing envelopes
[Android][0] and [Desktop][1] have already removed this field. This
follows suit.

The highlights:

- `SignalService.proto` removes some fields by making them `reserved`
- `ProtoWrappers.py` updates our code generation to support addresses
  that only have a UUID (previously, you needed both a UUID and E164
  field)
- Most everything else is removing E164s

[0]: 9c266e7995
[1]: 2b0d3cab40
2022-10-03 23:55:39 +00:00
Evan Hahn
abbbad7f90 Remove useless setup/teardown from test 2022-09-27 23:23:59 +00:00
Jordan Rose
fa1b3abf17 SSK: Add UUID parsing to ParamParser 2022-03-14 12:59:44 -07:00
Nora Trapp
c5214e38b6 Add Codable adherance to proto wrappers 2020-07-22 14:34:24 -07:00
Michelle Linington
e2a8244bbe Review feedback: Better handling of cast failures in ParamParser
This adds a new ParamParser private error constructor to be used on a
failed cast. It will populate the description of the thrown error with
information about the destination type of the failed cast.
2020-06-29 23:03:35 -07:00
Matthew Chen
3d5954dcf0 Update proto wrappers for group v2 protos (proto3, swift-only, free-standing enums, etc.) 2019-11-19 11:06:42 -03:00
Michael Kirk
2523e8306f adapt to rename source -> sourceE164 2019-06-24 10:06:45 -06:00
Michael Kirk
f82359b41d test v. optional proto enums 2019-06-13 14:37:45 -05:00
Matthew Chen
80fce0237b Fix test breakage. 2019-05-30 13:34:34 -04:00
Matthew Chen
32cf68bece Get all tests building. 2018-10-15 12:50:07 -04:00
Matthew Chen
7d727b7ac9 Modify proto wrapper builders to require required fields. 2018-10-01 09:08:23 -04:00
Matthew Chen
3935b019f4 Add base class for tests. 2018-09-10 17:30:18 -05:00
Matthew Chen
a4d24c78a4 Respond to CR. 2018-08-07 15:09:10 -04:00
Matthew Chen
90002459c4 Add unit tests around proto wrappers. 2018-08-07 14:50:14 -04:00
Matthew Chen
03a9b21cfd Respond to CR. 2018-08-03 14:35:22 -04:00
Matthew Chen
6be3d2e42d Code generate Swift wrappers for protocol buffers. 2018-08-03 14:05:20 -04:00
Matthew Chen
f814157a9e Code generate Swift wrappers for protocol buffers. 2018-08-01 11:20:55 -04:00
Michael Kirk
ac461ca2d1 Fixup parser: Robust to servers various "empty" types
For base64Encoded data, sometimes the server sends "null" sometimes the server
sends an empty string.
2018-07-26 11:56:22 -06:00
Michael Kirk
bae2e8649d Dry up Parameter parsing logic 2018-07-25 15:35:30 -06:00
Michael Kirk
d39906f606 CR: test malformed protos 2018-07-25 15:20:07 -06:00