<commit_before>package oauth

import (
	"io"
	"net/http"
	"xorkevin.dev/governor"
	"xorkevin.dev/governor/service/image"
	"xorkevin.dev/governor/service/objstore"
)

type (
	resOpenidConfig struct {
		Issuer          string   `json:"issuer"`
		EPAuthorization string   `json:"authorization_endpoint"`
		EPToken         string   `json:"token_endpoint"`
		EPUserinfo      string   `json:"userinfo_endpoint"`
		EPJwks          string   `json:"jwks_uri"`
		Scopes          []string `json:"scopes_supported"`
		ResponseTypes   []string `json:"response_types_supported"`
		ResponseModes   []string `json:"response_modes_supported"`
		GrantTypes      []string `json:"grant_types_supported"`
		SubjectTypes    []string `json:"subject_types_supported"`
		SigningAlgs     []string `json:"id_token_signing_alg_values_supported"`
		EPTokenAuth     []string `json:"token_endpoint_auth_methods_supported"`
		Claims          []string `json:"claims_supported"`
	}
)

func (s *service) GetOpenidConfig() (*resOpenidConfig, error) {
	return &resOpenidConfig{
		Issuer:          s.issuer,
		EPAuthorization: s.epauth,
		EPToken:         s.eptoken,
		EPUserinfo:      s.epuserinfo,
		EPJwks:          s.epjwks,
		Scopes:          []string{"openid", "profile", "email"},
		ResponseTypes:   []string{"code", "id_token", "code id_token"},
		ResponseModes:   []string{"query"},
		GrantTypes:      []string{"authorization_code", "refresh_token"},
		SubjectTypes:    []string{"public"},
		SigningAlgs:     []string{"RS256"},
		EPTokenAuth:     []string{"client_secret_basic", "client_secret_post"},
		Claims: []string{
			"iss",
			"sub",
			"aud",
			"iat",
			"nbf",<commit_msg>Add oauth code challenge methods supported<commit_after>package oauth

import (
	"io"
	"net/http"
	"xorkevin.dev/governor"
	"xorkevin.dev/governor/service/image"
	"xorkevin.dev/governor/service/objstore"
)

type (
	resOpenidConfig struct {
		Issuer          string   `json:"issuer"`
		EPAuthorization string   `json:"authorization_endpoint"`
		EPToken         string   `json:"token_endpoint"`
		EPUserinfo      string   `json:"userinfo_endpoint"`
		EPJwks          string   `json:"jwks_uri"`
		Scopes          []string `json:"scopes_supported"`
		ResponseTypes   []string `json:"response_types_supported"`
		ResponseModes   []string `json:"response_modes_supported"`
		GrantTypes      []string `json:"grant_types_supported"`
		SubjectTypes    []string `json:"subject_types_supported"`
		SigningAlgs     []string `json:"id_token_signing_alg_values_supported"`
		EPTokenAuth     []string `json:"token_endpoint_auth_methods_supported"`
		CodeChallenge   []string `json:"code_challenge_methods_supported"`
		Claims          []string `json:"claims_supported"`
	}
)

func (s *service) GetOpenidConfig() (*resOpenidConfig, error) {
	return &resOpenidConfig{
		Issuer:          s.issuer,
		EPAuthorization: s.epauth,
		EPToken:         s.eptoken,
		EPUserinfo:      s.epuserinfo,
		EPJwks:          s.epjwks,
		Scopes:          []string{"openid", "profile", "email"},
		ResponseTypes:   []string{"code", "id_token", "code id_token"},
		ResponseModes:   []string{"query"},
		GrantTypes:      []string{"authorization_code", "refresh_token"},
		SubjectTypes:    []string{"public"},
		SigningAlgs:     []string{"RS256"},
		EPTokenAuth:     []string{"client_secret_basic", "client_secret_post"},
		CodeChallenge:   []string{"plain", "S256"},
		Claims: []string{
			"iss",
			"sub",
			"aud",
			"iat",
			"nbf",
{'fraction_non_alphanumeric': 0.13904982618771727, 'fraction_numerical': 0.002607184241019699, 'mean_word_length': 4.004347826086956, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '803083', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1161, 'n_words': 202}