Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support creating and modifying repos #3

Merged
merged 9 commits into from
Dec 31, 2014
Merged

Support creating and modifying repos #3

merged 9 commits into from
Dec 31, 2014

Conversation

lmars
Copy link
Contributor

@lmars lmars commented Dec 26, 2014

There are a few TODOs in here which I plan to address, but opening to get feedback on the approach so far.

ping @titanous

@titanous
Copy link
Contributor

Ping @heavenlyhash more eyeballs on this would be great.

return nil
}

func hash256(r io.Reader) ([]byte, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's default to using SHA-512. It's quite a bit faster on x86_64.

Signed-off-by: Lewis Marshall <lewis@lmars.net>
@lmars
Copy link
Contributor Author

lmars commented Dec 30, 2014

@titanous @heavenlyhash comments addressed and implementation changed to match proposal #4.

I plan to do the following in smaller PRs once this is merged:

  • Add a test which checks generated signatures against data generated by the reference implementation
  • Passphrase protect keys (Passphrase-protect keys #5)
  • Implement tuf regenerate
  • Compress manifests when generating snapshot
  • Implement the client

This is a Go implementation of [The Update Framework (TUF)](http://theupdateframework.com/),
a framework for securing software update systems.

Reference documentation can be found in [this Github repository](https://github.com/theupdateframework/tuf).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this sentence is necessary, anyone interested can follow the link above.

@lmars
Copy link
Contributor Author

lmars commented Dec 30, 2014

@titanous @heavenlyhash comments addressed

type ErrInsufficientSignatures struct {
name string
err error
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These fields should be exported (in all of them).

Signed-off-by: Lewis Marshall <lewis@lmars.net>
@lmars
Copy link
Contributor Author

lmars commented Dec 30, 2014

@titanous comments addressed

@titanous
Copy link
Contributor

Looks like the hex encoding isn't working as expected? Probably needs a pointer receiver for the MarshalJSON method or vice versa.

$ cat keys/root-5244d08a4363a884910099276bea11ac62f1dbfa9c6a3d6c5c2f5f723fbfffb4.json
{"id":"5244d08a4363a884910099276bea11ac62f1dbfa9c6a3d6c5c2f5f723fbfffb4","public":[40,139,112,53,148,66,70,72,251,244,113,148,233,138,133,139,86,77,158,187,164,123,82,78,254,29,114,170,133,171,170,48],"private":[237,154,214,248,73,166,191,202,167,146,134,108,198,189,46,231,25,113,252,145,245,87,193,104,197,84,158,10,46,250,163,166,40,139,112,53,148,66,70,72,251,244,113,148,233,138,133,139,86,77,158,187,164,123,82,78,254,29,114,170,133,171,170,48]}

@titanous
Copy link
Contributor

Also, all JSON files should be formatted with MarshalIndent and have a trailing newline at the end.

@titanous
Copy link
Contributor

This works, which is unexpected:

$ tuf gen-key asdf

@titanous
Copy link
Contributor

All expires should be coerced to UTC before saving.

@titanous
Copy link
Contributor

One of the initial commands should create the staged/targets directory.

@titanous
Copy link
Contributor

tuf snapshot doesn't appear to work:

$ tree .
.
├── keys
│   ├── asdf-949815ba0fa9342dfa1e0489a5fe5a5eda50c073ba3f093cdb52e565f42365f5.json
│   ├── root-5244d08a4363a884910099276bea11ac62f1dbfa9c6a3d6c5c2f5f723fbfffb4.json
│   ├── snapshot-5ca07d17bdab4d06177a2bb8d5f08cb7b438aa4071b52128609b1014df529dc3.json
│   ├── targets-117d877a16096ae667f71d8589c46ca6926b7e16439d49bf23ae7bec4d358039.json
│   └── timestamp-e8e4ff1892f24b700c445bc6ee60955d1797d55e8f2b0eac9c9bc88c745ddad2.json
├── repository
└── staged
    ├── root.json
    ├── targets
    │   └── foo
    └── targets.json

4 directories, 8 files

$ tuf snapshot
tuf: invalid role

Signed-off-by: Lewis Marshall <lewis@lmars.net>
Signed-off-by: Lewis Marshall <lewis@lmars.net>
@lmars
Copy link
Contributor Author

lmars commented Dec 30, 2014

@titanous comments addressed, just couldn't get the JSON indentation to work for manifests so opened #12

}

type ErrFileNotFound struct {
path string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be exported.

Signed-off-by: Lewis Marshall <lewis@lmars.net>
Signed-off-by: Lewis Marshall <lewis@lmars.net>
Signed-off-by: Lewis Marshall <lewis@lmars.net>
@titanous
Copy link
Contributor

LGTM

lmars added a commit that referenced this pull request Dec 31, 2014
Support creating and modifying repos
@lmars lmars merged commit 89be826 into master Dec 31, 2014
@lmars lmars deleted the persist-repository branch December 31, 2014 00:24
titanous pushed a commit that referenced this pull request Jun 22, 2015
Use endophage for client imports
ethan-lowman-dd pushed a commit to ethan-lowman-dd/go-tuf that referenced this pull request Jul 14, 2021
…wman/delegations-in-client

Iteration on "Support delegations in client"
lebauce pushed a commit to lebauce/go-tuf that referenced this pull request Jul 26, 2021
ethan-lowman-dd added a commit to mnm678/go-tuf that referenced this pull request Mar 9, 2022
# This is the 1st commit message:

[Delegations prereq] Use a verify.DB for delegation in client

Splitting up theupdateframework#175

# This is the commit message theupdateframework#2:

stash

# This is the commit message theupdateframework#3:

Add tests to make sure the top level targets 'delegation' edge has associated keys. Make NewDelegationsIterator return an error if the passed DB is missing the top level targets role

# This is the commit message theupdateframework#4:

[Delegations prereq] Make signers addressible by key ID in LocalStore

Splitting up theupdateframework#175

# This is the commit message theupdateframework#5:

Clarify naming

# This is the commit message theupdateframework#6:

Add local_store_test.go

# This is the commit message theupdateframework#7:

Another test case

# This is the commit message theupdateframework#8:

[Delegations prereq] Use a verify.DB for delegation in client

Splitting up theupdateframework#175
ethan-lowman-dd added a commit to mnm678/go-tuf that referenced this pull request Mar 9, 2022
# This is the 1st commit message:

[Delegations prereq] Use a verify.DB for delegation in client

Splitting up theupdateframework#175

# This is the commit message theupdateframework#2:

stash

# This is the commit message theupdateframework#3:

Add tests to make sure the top level targets 'delegation' edge has associated keys. Make NewDelegationsIterator return an error if the passed DB is missing the top level targets role

# This is the commit message theupdateframework#4:

[Delegations prereq] Make signers addressible by key ID in LocalStore

Splitting up theupdateframework#175

# This is the commit message theupdateframework#5:

Clarify naming

# This is the commit message theupdateframework#6:

Add local_store_test.go

# This is the commit message theupdateframework#7:

Another test case

# This is the commit message theupdateframework#8:

[Delegations prereq] Use a verify.DB for delegation in client

Splitting up theupdateframework#175

# This is the commit message theupdateframework#9:

stash

# This is the commit message theupdateframework#10:

Add tests to make sure the top level targets 'delegation' edge has associated keys. Make NewDelegationsIterator return an error if the passed DB is missing the top level targets role
rdimitrov added a commit to rdimitrov/go-tuf that referenced this pull request Jan 25, 2024
…framework#3)

* docs: add comments describing the different types

Signed-off-by: Radoslav Dimitrov <dimitrovr@vmware.com>

* chore: add golangci and codeql

Signed-off-by: Radoslav Dimitrov <dimitrovr@vmware.com>

* chore: begin adding tests

Signed-off-by: Radoslav Dimitrov <dimitrovr@vmware.com>

* chore: add licence notice

Signed-off-by: Radoslav Dimitrov <dimitrovr@vmware.com>

* chore: update licence year to 2023

Signed-off-by: Radoslav Dimitrov <dimitrovr@vmware.com>

* chore: fix linting error

Signed-off-by: Radoslav Dimitrov <dimitrovr@vmware.com>

* chore: temp limit ci to ubuntu so we don't waste GHA resources

Signed-off-by: Radoslav Dimitrov <dimitrovr@vmware.com>

Signed-off-by: Radoslav Dimitrov <dimitrovr@vmware.com>
rdimitrov added a commit that referenced this pull request Jan 29, 2024
* docs: add comments describing the different types

Signed-off-by: Radoslav Dimitrov <dimitrovr@vmware.com>

* chore: add golangci and codeql

Signed-off-by: Radoslav Dimitrov <dimitrovr@vmware.com>

* chore: begin adding tests

Signed-off-by: Radoslav Dimitrov <dimitrovr@vmware.com>

* chore: add licence notice

Signed-off-by: Radoslav Dimitrov <dimitrovr@vmware.com>

* chore: update licence year to 2023

Signed-off-by: Radoslav Dimitrov <dimitrovr@vmware.com>

* chore: fix linting error

Signed-off-by: Radoslav Dimitrov <dimitrovr@vmware.com>

* chore: temp limit ci to ubuntu so we don't waste GHA resources

Signed-off-by: Radoslav Dimitrov <dimitrovr@vmware.com>

Signed-off-by: Radoslav Dimitrov <dimitrovr@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants