Skip to content

add: new api endpoints for the visualizer + modify the existing endpo…#141

Draft
kazuhidelee wants to merge 2 commits into
gittuf:mainfrom
kazuhidelee:tonylee/adding_new_api_endpoints
Draft

add: new api endpoints for the visualizer + modify the existing endpo…#141
kazuhidelee wants to merge 2 commits into
gittuf:mainfrom
kazuhidelee:tonylee/adding_new_api_endpoints

Conversation

@kazuhidelee

Copy link
Copy Markdown

…int to match the readme description

Description

AI Usage

  • I did not use generative AI at all in making the content of this pull
    request.
  • I did use generative AI in some form in making the content of this
    pull request. I have described my use of AI below.

Contributor Checklist

  • I have manually reviewed all content submitted to gittuf in this pull
    request.
  • I fully understand the content I am submitting.
  • The changes introduced are documented and have tests included if
    applicable.
  • My changes do not infringe on copyright/trademarks/etc.
  • All commits in this pull request include a DCO
    Signoff
    .
  • By submitting this pull request, I agree to follow the gittuf Code of
    Conduct
    .

…int to match the readme description

Signed-off-by: Tony Lee <tonyklee@umich.edu>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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 {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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 {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I feel like we don't need to do this if we unmarshal into a specific struct?

@kazuhidelee kazuhidelee force-pushed the tonylee/adding_new_api_endpoints branch from 3bf4a29 to 9308da9 Compare June 24, 2026 22:03
…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
}
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.

4 participants