Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
server
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
m-team
oidc
mytoken
server
Commits
7dc55226
Verified
Commit
7dc55226
authored
2 years ago
by
Gabriel Zachmann
Browse files
Options
Downloads
Patches
Plain Diff
fix code issues
parent
1cc7adc6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#323217
passed
2 years ago
Stage: build
Stage: test
Stage: lint
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
internal/endpoints/token/mytoken/pkg/myTokenRequest.go
+2
-3
2 additions, 3 deletions
internal/endpoints/token/mytoken/pkg/myTokenRequest.go
internal/endpoints/token/mytoken/pkg/oidcFlowRequest.go
+0
-57
0 additions, 57 deletions
internal/endpoints/token/mytoken/pkg/oidcFlowRequest.go
with
2 additions
and
60 deletions
internal/endpoints/token/mytoken/pkg/myTokenRequest.go
+
2
−
3
View file @
7dc55226
package
pkg
import
(
"github.com/oidc-mytoken/api/v0"
"github.com/oidc-mytoken/server/internal/model/profiled"
"github.com/oidc-mytoken/server/internal/mytoken/universalmytoken"
)
// MytokenFromMytokenRequest is a request to create a new Mytoken from an existing Mytoken
// It is analog to api.MytokenFromMytokenRequest
type
MytokenFromMytokenRequest
struct
{
api
.
MytokenFromMytokenRequest
`json:",inline"`
profiled
.
GeneralMytokenRequest
`json:",inline"`
Mytoken
universalmytoken
.
UniversalMytoken
`json:"mytoken"`
FailOnRestrictionsNotTighter
bool
`json:"error_on_restrictions,omitempty"`
}
// NewMytokenRequest creates a MytokenFromMytokenRequest with the default values where they can be omitted
...
...
This diff is collapsed.
Click to expand it.
internal/endpoints/token/mytoken/pkg/oidcFlowRequest.go
+
0
−
57
View file @
7dc55226
...
...
@@ -51,63 +51,6 @@ func NewOIDCFlowRequest() *OIDCFlowRequest {
}
}
/*
// SetRedirectType sets the (hidden) redirect type
func (r *OIDCFlowRequest) SetRedirectType(redirect string) {
r.clientType = redirect
}
// SetRedirectURI sets the (hidden) redirect uri
func (r *OIDCFlowRequest) SetRedirectURI(uri string) {
r.redirectURI = uri
}
// MarshalJSON implements the json.Marshaler interface
func (r OIDCFlowRequest) MarshalJSON() ([]byte, error) { // skipcq: CRT-P0003
type ofr OIDCFlowRequest
o := struct {
ofr
ClientType string `json:"client_type,omitempty"`
RedirectURI string `json:"redirect_uri,omitempty"`
}{
ofr: ofr(r),
ClientType: r.clientType,
RedirectURI: r.redirectURI,
}
data, err := json.Marshal(o)
return data, errors.WithStack(err)
}
// UnmarshalJSON implements the json.Unmarshaler interface
func (r *OIDCFlowRequest) UnmarshalJSON(data []byte) error {
type ofr OIDCFlowRequest
o := struct {
ofr
RedirectType string `json:"client_type"`
RedirectURI string `json:"redirect_uri"`
}{
ofr: ofr(*NewOIDCFlowRequest()),
}
o.RedirectType = o.clientType
o.RedirectURI = o.redirectURI
if err := json.Unmarshal(data, &o); err != nil {
return errors.WithStack(err)
}
o.clientType = o.RedirectType
o.redirectURI = o.RedirectURI
*r = OIDCFlowRequest(o.ofr)
return nil
}
// ToAuthCodeFlowRequest creates a AuthCodeFlowRequest from the OIDCFlowRequest
func (r OIDCFlowRequest) ToAuthCodeFlowRequest() AuthCodeFlowRequest { // skipcq: CRT-P0003
return AuthCodeFlowRequest{
OIDCFlowRequest: r,
ClientType: r.clientType,
RedirectURI: r.redirectURI,
}
}
*/
// Scan implements the sql.Scanner interface
func
(
r
*
OIDCFlowRequest
)
Scan
(
src
interface
{})
error
{
v
,
ok
:=
src
.
([]
byte
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment