<commit_before>package design

import (
	. "github.com/goadesign/goa/design"
	. "github.com/goadesign/goa/design/apidsl"
)

const (
	appID            = "example"
	google_audiences = "CLIENT-ID"

	authorizationURL = "https://accounts.google.com/o/oauth2/auth"
	google_issuer    = "https://accounts.google.com"
	google_jwks_uri  = "https://www.googleapis.com/oauth2/v3/certs"
)

var _ = API(appID, func() {
	Title(appID)
})

var JWT = OAuth2Security("google_id_token", func() {
	ImplicitFlow(authorizationURL)
	Scope("read", "read")
})

var _ = Resource("items", func() {
	BasePath("/items")
	Action("get", func() {
		Routing(GET(""))
		Response(OK)
	})
	Security(JWT, func() {
		Scope("read")
		Metadata("swagger:extension:x-google-issuer", google_issuer)
		Metadata("swagger:extension:x-google-jwks_uri", google_jwks_uri)
		//Metadata("swagger:extension:x-google-audiences", google_audiences)
	})
})
<commit_msg>fix scope for OpenID connect<commit_after>package design

import (
	. "github.com/goadesign/goa/design"
	. "github.com/goadesign/goa/design/apidsl"
)

const (
	appID            = "example"
	google_audiences = "CLIENT-ID"

	authorizationURL = "https://accounts.google.com/o/oauth2/auth"
	google_issuer    = "https://accounts.google.com"
	google_jwks_uri  = "https://www.googleapis.com/oauth2/v3/certs"
)

var _ = API(appID, func() {
	Title(appID)
})

var JWT = OAuth2Security("google_id_token", func() {
	ImplicitFlow(authorizationURL)
	Scope("openid", "OpenID connect")
})

var _ = Resource("items", func() {
	BasePath("/items")
	Action("get", func() {
		Routing(GET(""))
		Response(OK)
	})
	Security(JWT, func() {
		Scope("openid")
		Metadata("swagger:extension:x-google-issuer", google_issuer)
		Metadata("swagger:extension:x-google-jwks_uri", google_jwks_uri)
		//Metadata("swagger:extension:x-google-audiences", google_audiences)
	})
})

{'fraction_non_alphanumeric': 0.17269293038316244, 'fraction_numerical': 0.004317323259579061, 'mean_word_length': 4.79375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4776159', 'n_tokens_mistral': 730, 'n_tokens_neox': 721, 'n_words': 93}