@@ -3315,3 +3315,79 @@ type Foo struct {
33153315 IntField *int
33163316}
33173317`
3318+
3319+ const MultipleAPIKeySecurity = `
3320+ // Service is the MultipleAPIKeySecurity service interface.
3321+ type Service interface {
3322+ // A implements A.
3323+ A(context.Context, *APayload) (err error)
3324+ }
3325+
3326+ // Auther defines the authorization functions to be implemented by the service.
3327+ type Auther interface {
3328+ // APIKeyAuth implements the authorization logic for the APIKey security scheme.
3329+ APIKeyAuth(ctx context.Context, key string, schema *security.APIKeyScheme) (context.Context, error)
3330+ }
3331+
3332+ // APIName is the name of the API as defined in the design.
3333+ const APIName = "test api"
3334+
3335+ // APIVersion is the version of the API as defined in the design.
3336+ const APIVersion = "0.0.1"
3337+
3338+ // ServiceName is the name of the service as defined in the design. This is the
3339+ // same value that is set in the endpoint request contexts under the ServiceKey
3340+ // key.
3341+ const ServiceName = "MultipleAPIKeySecurity"
3342+
3343+ // MethodNames lists the service method names as defined in the design. These
3344+ // are the same values that are set in the endpoint request contexts under the
3345+ // MethodKey key.
3346+ var MethodNames = [1]string{"A"}
3347+
3348+ // APayload is the payload type of the MultipleAPIKeySecurity service A method.
3349+ type APayload struct {
3350+ APIKey string
3351+ TenantID string
3352+ }
3353+ `
3354+
3355+ const MixedAndMultipleAPIKeySecurity = `
3356+ // Service is the MixedAndMultipleAPIKeySecurity service interface.
3357+ type Service interface {
3358+ // A implements A.
3359+ A(context.Context, *APayload) (err error)
3360+ }
3361+
3362+ // Auther defines the authorization functions to be implemented by the service.
3363+ type Auther interface {
3364+ // JWTAuth implements the authorization logic for the JWT security scheme.
3365+ JWTAuth(ctx context.Context, token string, schema *security.JWTScheme) (context.Context, error)
3366+ // APIKeyAuth implements the authorization logic for the APIKey security scheme.
3367+ APIKeyAuth(ctx context.Context, key string, schema *security.APIKeyScheme) (context.Context, error)
3368+ }
3369+
3370+ // APIName is the name of the API as defined in the design.
3371+ const APIName = "test api"
3372+
3373+ // APIVersion is the version of the API as defined in the design.
3374+ const APIVersion = "0.0.1"
3375+
3376+ // ServiceName is the name of the service as defined in the design. This is the
3377+ // same value that is set in the endpoint request contexts under the ServiceKey
3378+ // key.
3379+ const ServiceName = "MixedAndMultipleAPIKeySecurity"
3380+
3381+ // MethodNames lists the service method names as defined in the design. These
3382+ // are the same values that are set in the endpoint request contexts under the
3383+ // MethodKey key.
3384+ var MethodNames = [1]string{"A"}
3385+
3386+ // APayload is the payload type of the MixedAndMultipleAPIKeySecurity service A
3387+ // method.
3388+ type APayload struct {
3389+ JWT *string
3390+ APIKey *string
3391+ TenantID *string
3392+ }
3393+ `
0 commit comments