Documentation ¶
Overview ¶
Package ports contains entry-point related logic for builder-hub. As of now only way to access builder-hub functionality is via http
Index ¶
- Constants
- Variables
- type AuthData
- type BuilderHubHandler
- func (bhs *BuilderHubHandler) GetActiveBuilders(w http.ResponseWriter, r *http.Request)
- func (bhs *BuilderHubHandler) GetActiveBuildersNoAuth(w http.ResponseWriter, r *http.Request)
- func (bhs *BuilderHubHandler) GetAllowedMeasurements(w http.ResponseWriter, r *http.Request)
- func (bhs *BuilderHubHandler) GetConfigSecrets(w http.ResponseWriter, r *http.Request)
- func (bhs *BuilderHubHandler) RegisterCredentials(w http.ResponseWriter, r *http.Request)
- type BuilderHubService
- type BuilderWithServiceCreds
- type Measurement
- type ServiceCred
Constants ¶
View Source
const ( AttestationTypeHeader string = "X-Flashbots-Attestation-Type" MeasurementHeader string = "X-Flashbots-Measurement" ForwardedHeader string = "X-Forwarded-For" )
Variables ¶
View Source
var ErrInvalidAuthData = errors.New("invalid auth data")
Functions ¶
This section is empty.
Types ¶
type BuilderHubHandler ¶
type BuilderHubHandler struct {
// contains filtered or unexported fields
}
func NewBuilderHubHandler ¶
func NewBuilderHubHandler(builderHubService BuilderHubService, log *httplog.Logger) *BuilderHubHandler
func (*BuilderHubHandler) GetActiveBuilders ¶
func (bhs *BuilderHubHandler) GetActiveBuilders(w http.ResponseWriter, r *http.Request)
func (*BuilderHubHandler) GetActiveBuildersNoAuth ¶
func (bhs *BuilderHubHandler) GetActiveBuildersNoAuth(w http.ResponseWriter, r *http.Request)
func (*BuilderHubHandler) GetAllowedMeasurements ¶
func (bhs *BuilderHubHandler) GetAllowedMeasurements(w http.ResponseWriter, r *http.Request)
func (*BuilderHubHandler) GetConfigSecrets ¶
func (bhs *BuilderHubHandler) GetConfigSecrets(w http.ResponseWriter, r *http.Request)
func (*BuilderHubHandler) RegisterCredentials ¶
func (bhs *BuilderHubHandler) RegisterCredentials(w http.ResponseWriter, r *http.Request)
type BuilderHubService ¶
type BuilderHubService interface { GetAllowedMeasurements(ctx context.Context) ([]domain.Measurement, error) GetActiveBuilders(ctx context.Context) ([]domain.BuilderWithServices, error) VerifyIPAndMeasurements(ctx context.Context, ip net.IP, measurement map[string]string, attestationType string) (*domain.Builder, string, error) GetConfigWithSecrets(ctx context.Context, builderName string) ([]byte, error) RegisterCredentialsForBuilder(ctx context.Context, builderName, service, tlsCert string, ecdsaPubKey []byte, measurementName, attestationType string) error }
type BuilderWithServiceCreds ¶
type BuilderWithServiceCreds struct { IP string Name string ServiceCreds map[string]ServiceCred }
func (BuilderWithServiceCreds) MarshalJSON ¶
func (b BuilderWithServiceCreds) MarshalJSON() ([]byte, error)
MarshalJSON is a custom json marshaller. Unfortunately, there seems to be no way to inline map[string]Service when marshalling so we need to be careful when adding new fields, since custom json implementation will ignore it by default
type Measurement ¶
type Measurement struct { Name string `json:"measurement_id"` AttestationType string `json:"attestation_type"` Measurements map[string]domain.SingleMeasurement `json:"measurements"` }
type ServiceCred ¶
Click to show internal directories.
Click to hide internal directories.