add: new api endpoints for the visualizer + modify the existing endpo…#141
add: new api endpoints for the visualizer + modify the existing endpo…#141kazuhidelee wants to merge 2 commits into
Conversation
…int to match the readme description Signed-off-by: Tony Lee <tonyklee@umich.edu>
There was a problem hiding this comment.
Can we import some things from https://github.com/gittuf/gittuf/tree/main/internal/tuf and reuse the declarations there instead of redefining them here? e.g. the policyRole.
There was a problem hiding this comment.
I was trying to import directly from https://github.com/gittuf/gittuf/tree/main/internal/tuf but I think Go is blocking imports from another module's internal package. Am I doing the imports wrong or is there another way to do the import?
| return false | ||
| } | ||
|
|
||
| func matchesPattern(pattern, value string) bool { |
There was a problem hiding this comment.
This should be done by fnmatch (see package we import in the tuf package I linked to above) to match the behavior gittuf has.
| } | ||
|
|
||
| // reads an integer value from a decoded JSON field. | ||
| func intValue(value interface{}) int { |
There was a problem hiding this comment.
I feel like we don't need to do this if we unmarshal into a specific struct?
3bf4a29 to
9308da9
Compare
…r validation logic: Signed-off-by: Tony Lee <tonyklee@umich.edu>
| return "", ErrInvalidLocalPath | ||
| } | ||
|
|
||
| // Reject URL-like and UNC/network-style paths. Local endpoints should only |
|
|
||
| if !filepath.IsAbs(path) { | ||
| return "", ErrInvalidLocalPath | ||
| } |
…int to match the readme description
Description
AI Usage
request.
pull request. I have described my use of AI below.
Contributor Checklist
request.
applicable.
Signoff.
Conduct.