Skip to content

Commit

Permalink
feat: change well-known url path for signed cred issuer config
Browse files Browse the repository at this point in the history
Signed-off-by: Mykhailo Sizov <[email protected]>
  • Loading branch information
mishasizov-SK committed Sep 21, 2023
1 parent 7e624a4 commit f90f877
Show file tree
Hide file tree
Showing 9 changed files with 383 additions and 196 deletions.
56 changes: 56 additions & 0 deletions docs/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,34 @@ paths:
$ref: '#/components/schemas/WellKnownOpenIDIssuerConfiguration'
operationId: openid-credential-issuer-config
description: Returns openid-config.
deprecated: true
tags:
- issuer
'/oidc/idp/{profileID}/{profileVersion}/.well-known/openid-credential-issuer':
parameters:
- schema:
type: string
name: profileID
in: path
required: true
description: Profile ID
- schema:
type: string
name: profileVersion
in: path
required: true
description: Profile Version
get:
summary: Request openid-credential-issuer public endpoint.
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/WellKnownOpenIDIssuerConfiguration'
operationId: openid-credential-issuer-config-v2
description: Returns openid-config.
tags:
- issuer
'/issuer/{profileID}/{profileVersion}/.well-known/openid-configuration':
Expand Down Expand Up @@ -78,6 +106,34 @@ paths:
$ref: '#/components/schemas/WellKnownOpenIDConfiguration'
operationId: openid-config
description: Returns openid-config.
deprecated: true
tags:
- issuer
'/oidc/idp/{profileID}/{profileVersion}/.well-known/openid-configuration':
parameters:
- schema:
type: string
name: profileID
in: path
required: true
description: Profile Id
- schema:
type: string
name: profileVersion
in: path
required: true
description: Profile Version
get:
summary: Request openid-config
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/WellKnownOpenIDConfiguration'
operationId: openid-config-v2
description: Returns openid-config.
tags:
- issuer
'/issuer/profiles/{profileID}/{profileVersion}/credentials/issue':
Expand Down
12 changes: 12 additions & 0 deletions pkg/restapi/v1/issuer/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,12 @@ func (c *Controller) OpenidConfig(ctx echo.Context, profileID, profileVersion st
return util.WriteOutput(ctx)(c.getOpenIDConfig(profileID, profileVersion))
}

// OpenidConfigV2 request openid configuration for issuer.
// GET /oidc/idp/{profileID}/{profileVersion}/.well-known/openid-configuration.
func (c *Controller) OpenidConfigV2(ctx echo.Context, profileID, profileVersion string) error {
return c.OpenidConfig(ctx, profileID, profileVersion)
}

// OpenidCredentialIssuerConfig request openid credentials configuration for issuer.
// GET /issuer/{profileID}/{profileVersion}/.well-known/openid-credential-issuer.
func (c *Controller) OpenidCredentialIssuerConfig(ctx echo.Context, profileID, profileVersion string) error {
Expand All @@ -806,6 +812,12 @@ func (c *Controller) OpenidCredentialIssuerConfig(ctx echo.Context, profileID, p
return util.WriteOutput(ctx)(config, nil)
}

// OpenidCredentialIssuerConfigV2 request openid credentials configuration for issuer.
// GET /oidc/idp/{profileID}/{profileVersion}/.well-known/openid-credential-issuer.
func (c *Controller) OpenidCredentialIssuerConfigV2(ctx echo.Context, profileID, profileVersion string) error {
return c.OpenidCredentialIssuerConfig(ctx, profileID, profileVersion)
}

func (c *Controller) getOpenIDConfig(profileID, profileVersion string) (*WellKnownOpenIDConfiguration, error) {
host := c.externalHostURL
if !strings.HasSuffix(host, "/") {
Expand Down
Loading

0 comments on commit f90f877

Please sign in to comment.