diff --git a/README.md b/README.md index 40307b90..1828a1c4 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ -# The OpenLane - Core +# Openlane - Core -This repository houses the core server and orchestration elements which are at the heart of the [OpenLane](https://theopenlane.io) cloud service. We have no plans to ever gate / silo elements of the code that may fall under our "enterprise licensing" (or any other commercial license we offer) and intend to keep the code Apache 2.0 licensed and free for use, forever. Given that, if you find value in anything we're doing here, our cloud services, or use this software yourself (for any purpose) - don't be afraid to become a contributor! If you have any questions please reach out to `contribute@theopenlane.io`. +This repository houses the core server and orchestration elements which are at the heart of the [Openlane](https://theopenlane.io) cloud service. We have no plans to ever gate / silo elements of the code that may fall under our "enterprise licensing" (or any other commercial license we offer) and intend to keep the code Apache 2.0 licensed and free for use, forever. Given that, if you find value in anything we're doing here, our cloud services, or use this software yourself (for any purpose) - don't be afraid to become a contributor! If you have any questions please reach out to `contribute@theopenlane.io`. ## Features @@ -82,13 +82,13 @@ The only "supported" method of deploying today is locally, but we have a WIP Hel ## Contributing -Please read the [contributing](.github/CONTRIBUTING.md) guide as well as the [Developer Certificate of Origin](https://developercertificate.org/). You will be required to sign all commits to the The OpenLane project, so if you're unfamiliar with how to set that up, see [github's documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification). +Please read the [contributing](.github/CONTRIBUTING.md) guide as well as the [Developer Certificate of Origin](https://developercertificate.org/). You will be required to sign all commits to the [theopenlane](https://github.com/theopenlane) organization, so if you're unfamiliar with how to set that up, see [github's documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification). ## Licensing -This repository contains `core` which is open source software under [Apache 2.0](LICENSE). The OpenLane is a product produced from this open source software exclusively by The Open Lane, Inc. This product is produced under our published commercial terms (which are subject to change), and any logos or trademarks in this repository or the broader [theopenlane](https://github.com/theopenlane) organization are not covered under the Apache License. +This repository contains `core` which is open source software under [Apache 2.0](LICENSE). Openlane is a product produced from this open source software exclusively by The Open Lane, Inc. This product is produced under our published commercial terms (which are subject to change), and any logos or trademarks in this repository or the broader [theopenlane](https://github.com/theopenlane) organization are not covered under the Apache License. -Others are allowed to make their own distribution of this software or include this software in other commercial offerings, but cannot use any of the The OpenLane logos, trademarks, cloud services, etc. +Others are allowed to make their own distribution of this software or include this software in other commercial offerings, but cannot use any of the Openlane logos, trademarks, cloud services, etc. ## Security diff --git a/cmd/cli/cmd/client.go b/cmd/cli/cmd/client.go index 03d6f211..6d2ac0c6 100644 --- a/cmd/cli/cmd/client.go +++ b/cmd/cli/cmd/client.go @@ -23,10 +23,10 @@ const ( sessionKey = "open_lane_session" ) -// SetupClientWithAuth will setup the OpenLane client with the the bearer token passed in the Authorization header +// SetupClientWithAuth will setup the openlane client with the the bearer token passed in the Authorization header // and the session cookie passed in the Cookie header. If the token is expired, it will be refreshed. // The token and session will be stored in the keyring for future requests -func SetupClientWithAuth(ctx context.Context) (*openlaneclient.OpenLaneClient, error) { +func SetupClientWithAuth(ctx context.Context) (*openlaneclient.OpenlaneClient, error) { // setup interceptors token, session, err := GetTokenFromKeyring(ctx) if err != nil { @@ -68,7 +68,7 @@ func SetupClientWithAuth(ctx context.Context) (*openlaneclient.OpenLaneClient, e // SetupClient will setup the client without the Authorization header // this is used for endpoints that do not require authentication, e.g. `v1/login` -func SetupClient(ctx context.Context) (*openlaneclient.OpenLaneClient, error) { +func SetupClient(ctx context.Context) (*openlaneclient.OpenlaneClient, error) { config, opts, err := configureDefaultOpts() if err != nil { return nil, err @@ -106,7 +106,7 @@ func configureClientEndpoints() (openlaneclient.ClientOption, error) { // StoreSessionCookies gets the session cookie from the cookie jar // and stores it in the keychain for future requests -func StoreSessionCookies(client *openlaneclient.OpenLaneClient) { +func StoreSessionCookies(client *openlaneclient.OpenlaneClient) { session, err := client.GetSessionFromCookieJar() if err != nil || session == "" { fmt.Println("unable to get session from cookie jar") @@ -126,7 +126,7 @@ func StoreSessionCookies(client *openlaneclient.OpenLaneClient) { // StoreAuthCookies gets the auth cookies from the cookie jar if they exist // and stores them in the keychain for future requests -func StoreAuthCookies(client *openlaneclient.OpenLaneClient) { +func StoreAuthCookies(client *openlaneclient.OpenlaneClient) { token := client.GetAuthTokensFromCookieJar() if token == nil { diff --git a/cmd/cli/cmd/login/root.go b/cmd/cli/cmd/login/root.go index f41b0f84..ab316722 100644 --- a/cmd/cli/cmd/login/root.go +++ b/cmd/cli/cmd/login/root.go @@ -54,7 +54,7 @@ func login(ctx context.Context) (*oauth2.Token, error) { return tokens, nil } -func passwordAuth(ctx context.Context, client *openlaneclient.OpenLaneClient, username string) (*oauth2.Token, error) { +func passwordAuth(ctx context.Context, client *openlaneclient.OpenlaneClient, username string) (*oauth2.Token, error) { // read password from terminal if not set in environment variable password := cmd.Config.String("password") diff --git a/fga/tests/tests.yaml b/fga/tests/tests.yaml index e0798b88..2fc53b0b 100644 --- a/fga/tests/tests.yaml +++ b/fga/tests/tests.yaml @@ -1,4 +1,4 @@ -name: OpenLane +name: Openlane model_file: ../model/model.fga tuples: # setup parent child org relationship diff --git a/go.sum b/go.sum index 3b382bac..323d7380 100644 --- a/go.sum +++ b/go.sum @@ -40,8 +40,6 @@ github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEV github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2 h1:ZBbLwSJqkHBuFDA6DUhhse0IGJ7T5bemHyNILUjvOq4= github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2/go.mod h1:VSw57q4QFiWDbRnjdX8Cb3Ow0SFncRw+bA/ofY6Q83w= -github.com/XSAM/otelsql v0.32.0 h1:vDRE4nole0iOOlTaC/Bn6ti7VowzgxK39n3Ll1Kt7i0= -github.com/XSAM/otelsql v0.32.0/go.mod h1:Ary0hlyVBbaSwo8atZB8Aoothg9s/LBJj/N/p5qDmLM= github.com/XSAM/otelsql v0.33.0 h1:8ZgVGFMG78Gd7BcCkxZ+lBTybWrnOtQv5sn4sLWb0+w= github.com/XSAM/otelsql v0.33.0/go.mod h1:TIaqdCA0m+GP0TJ4axwMSLunVfMFsxf1x1UU8MlUvAY= github.com/Yamashou/gqlgenc v0.24.0 h1:Aeufjb2zF0XxkeSTAVQ+DfiHL+ney/M2ovShZozBmHw= @@ -450,8 +448,6 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posthog/posthog-go v1.2.20 h1:gH62ssImK6xRKbYgmaW+sIPqvXBtu6iYjRR3f4lLIoA= -github.com/posthog/posthog-go v1.2.20/go.mod h1:QjlpryJtfYLrZF2GUkAhejH4E7WlDbdKkvOi5hLmkdg= github.com/posthog/posthog-go v1.2.21 h1:p2ea0l+Qwtk+VC2LCAI87Dz36vwj9i+QHw5s6CpRikA= github.com/posthog/posthog-go v1.2.21/go.mod h1:uYC2l1Yktc8E+9FAHJ9QZG4vQf/NHJPD800Hsm7DzoM= github.com/pquerna/otp v1.4.0 h1:wZvl1TIVxKRThZIBiwOOHOGP/1+nZyWBil9Y2XNEDzg= @@ -463,8 +459,6 @@ github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/j github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= -github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/common v0.57.0 h1:Ro/rKjwdq9mZn1K5QPctzh+MA4Lp0BuYk5ZZEVhoNcY= github.com/prometheus/common v0.57.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= @@ -484,8 +478,6 @@ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= -github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagikazarmark/locafero v0.6.0 h1:ON7AQg37yzcRPU69mt7gwhFEBwxI6P9T4Qu3N51bwOk= @@ -542,8 +534,6 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/theopenlane/beacon v0.1.0 h1:cyGx18rbaJTZT8pRcqMMvg+kN6uh86X4OoDahQp6VnE= github.com/theopenlane/beacon v0.1.0/go.mod h1:gOJAanQzfmDF3FIyv7Lwx16bKI7YPkJx1iRT4SdcBW4= -github.com/theopenlane/dbx v0.1.0 h1:hjaaruFBwLQ8yHDAN3P68j8hYbdkJE3fb0ynAwTidOY= -github.com/theopenlane/dbx v0.1.0/go.mod h1:SJm0TRYqkqC+Ap+G32zgK96OkujZvtHTqWQXmzo8ZRg= github.com/theopenlane/dbx v0.1.1 h1:RSSZLfhCCYKWf6+4taAfoZefvrvmLuIadjJDAxH154s= github.com/theopenlane/dbx v0.1.1/go.mod h1:pSfzjKF3GI0FSG4NDXYJqFYVSJXV9JrLlk2sHUtvfZ8= github.com/theopenlane/echo-prometheus v0.1.0 h1:1zMejBVHe5w4zLHS+k5FV9S/46QBiwO6ggTSKi6r/7E= @@ -617,8 +607,8 @@ go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2 go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= -go.opentelemetry.io/otel/sdk/metric v1.28.0 h1:OkuaKgKrgAbYrrY0t92c+cC+2F6hsFNnCQArXCKlg08= -go.opentelemetry.io/otel/sdk/metric v1.28.0/go.mod h1:cWPjykihLAPvXKi4iZc1dpER3Jdq2Z0YLse3moQUCpg= +go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= +go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= @@ -717,8 +707,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 h1:LLhsEBxRTBLuKlQxFBYUOU8xyFgXv6cOTp2HASDlsDk= golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -google.golang.org/api v0.194.0 h1:dztZKG9HgtIpbI35FhfuSNR/zmaMVdxNlntHj1sIS4s= -google.golang.org/api v0.194.0/go.mod h1:AgvUFdojGANh3vI+P7EVnxj3AISHllxGCJSFmggmnd0= google.golang.org/api v0.195.0 h1:Ude4N8FvTKnnQJHU48RFI40jOBgIrL8Zqr3/QeST6yU= google.golang.org/api v0.195.0/go.mod h1:DOGRWuv3P8TU8Lnz7uQc4hyNqrBpMtD9ppW3wBJurgc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -726,14 +714,10 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20240814211410-ddb44dafa142 h1:oLiyxGgE+rt22duwci1+TG7bg2/L1LQsXwfjPlmuJA0= -google.golang.org/genproto v0.0.0-20240814211410-ddb44dafa142/go.mod h1:G11eXq53iI5Q+kyNOmCvnzBaxEA2Q/Ik5Tj7nqBE8j4= -google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7 h1:YcyjlL1PRr2Q17/I0dPk2JmYS5CDXfcdb2Z3YRioEbw= -google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo= +google.golang.org/genproto v0.0.0-20240823204242-4ba0660f739c h1:TYOEhrQMrNDTAd2rX9m+WgGr8Ku6YNuj1D7OX6rWSok= +google.golang.org/genproto v0.0.0-20240823204242-4ba0660f739c/go.mod h1:2rC5OendXvZ8wGEo/cSLheztrZDZaSoHanUcd1xtZnw= google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed h1:3RgNmBoI9MZhsj3QxC+AP/qQhNwpCLOvYDYYsFrhFt0= google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7 h1:2035KHhUv+EpyB+hWgJnaWKJOdX1E95w2S8Rr4uWKTs= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed h1:J6izYgfBXAI3xTKLgxzTmUltdYaLsuBxFCgDHWJ/eXg= google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -741,8 +725,6 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -777,16 +759,14 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= modernc.org/cc/v4 v4.21.4 h1:3Be/Rdo1fpr8GrQ7IVw9OHtplU4gWbb+wNgeoBMmGLQ= modernc.org/cc/v4 v4.21.4/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ= -modernc.org/ccgo/v4 v4.20.7 h1:skrinQsjxWfvj6nbC3ztZPJy+NuwmB3hV9zX/pthNYQ= -modernc.org/ccgo/v4 v4.20.7/go.mod h1:UOkI3JSG2zT4E2ioHlncSOZsXbuDCZLvPi3uMlZT5GY= +modernc.org/ccgo/v4 v4.21.0 h1:kKPI3dF7RIag8YcToh5ZwDcVMIv6VGa0ED5cvh0LMW4= +modernc.org/ccgo/v4 v4.21.0/go.mod h1:h6kt6H/A2+ew/3MW/p6KEoQmrq/i3pr0J/SiwiaF/g0= modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= modernc.org/gc/v2 v2.5.0 h1:bJ9ChznK1L1mUtAQtxi0wi5AtAs5jQuw4PrPHO5pb6M= modernc.org/gc/v2 v2.5.0/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= modernc.org/gc/v3 v3.0.0-20240801135723-a856999a2e4a h1:CfbpOLEo2IwNzJdMvE8aiRbPMxoTpgAJeyePh0SmO8M= modernc.org/gc/v3 v3.0.0-20240801135723-a856999a2e4a/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4= -modernc.org/libc v1.59.9 h1:k+nNDDakwipimgmJ1D9H466LhFeSkaPPycAs1OZiDmY= -modernc.org/libc v1.59.9/go.mod h1:EY/egGEU7Ju66eU6SBqCNYaFUDuc4npICkMWnU5EE3A= modernc.org/libc v1.60.0 h1:XeRF1gXky7JE5E8IErtYAdKj+ykZPdYUsgJNQ8RFWIA= modernc.org/libc v1.60.0/go.mod h1:xJuobKuNxKH3RUatS7GjR+suWj+5c2K7bi4m/S5arOY= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= diff --git a/gqlgenc.yml b/gqlgenc.yml index c3d88409..02aeab55 100644 --- a/gqlgenc.yml +++ b/gqlgenc.yml @@ -18,6 +18,6 @@ schema: ["schema.graphql"] query: ["query/*.graphql"] generate: clientV2: true - clientInterfaceName: "OpenLaneGraphClient" + clientInterfaceName: "OpenlaneGraphClient" query: false mutation: false diff --git a/internal/graphapi/contact_test.go b/internal/graphapi/contact_test.go index a08aadd4..e9e48701 100644 --- a/internal/graphapi/contact_test.go +++ b/internal/graphapi/contact_test.go @@ -30,7 +30,7 @@ func (suite *GraphTestSuite) TestQueryContact() { name string queryID string allowed bool - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context expected *ent.Contact errorMsg string @@ -127,7 +127,7 @@ func (suite *GraphTestSuite) TestQueryContacts() { testCases := []struct { name string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context expectedResults int }{ @@ -180,7 +180,7 @@ func (suite *GraphTestSuite) TestMutationCreateContact() { testCases := []struct { name string request openlaneclient.CreateContactInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool expectedErr string @@ -323,7 +323,7 @@ func (suite *GraphTestSuite) TestMutationUpdateContact() { testCases := []struct { name string request openlaneclient.UpdateContactInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool expectedErr string @@ -474,7 +474,7 @@ func (suite *GraphTestSuite) TestMutationDeleteContact() { testCases := []struct { name string idToDelete string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool checkAccess bool diff --git a/internal/graphapi/entitlement_test.go b/internal/graphapi/entitlement_test.go index 3d61e070..3a101ede 100644 --- a/internal/graphapi/entitlement_test.go +++ b/internal/graphapi/entitlement_test.go @@ -25,7 +25,7 @@ func (suite *GraphTestSuite) TestQueryEntitlement() { testCases := []struct { name string queryID string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context errorMsg string }{ @@ -103,7 +103,7 @@ func (suite *GraphTestSuite) TestQueryEntitlements() { testCases := []struct { name string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context expectedResults int }{ @@ -163,7 +163,7 @@ func (suite *GraphTestSuite) TestMutationCreateEntitlement() { testCases := []struct { name string request openlaneclient.CreateEntitlementInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool expectedErr string @@ -296,7 +296,7 @@ func (suite *GraphTestSuite) TestMutationUpdateEntitlement() { testCases := []struct { name string request openlaneclient.UpdateEntitlementInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool expectedErr string @@ -402,7 +402,7 @@ func (suite *GraphTestSuite) TestMutationDeleteEntitlement() { testCases := []struct { name string idToDelete string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool checkAccess bool diff --git a/internal/graphapi/entitlementplan_test.go b/internal/graphapi/entitlementplan_test.go index e4774ff7..4d83c6af 100644 --- a/internal/graphapi/entitlementplan_test.go +++ b/internal/graphapi/entitlementplan_test.go @@ -24,7 +24,7 @@ func (suite *GraphTestSuite) TestQueryEntitlementPlan() { testCases := []struct { name string queryID string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context errorMsg string }{ @@ -101,7 +101,7 @@ func (suite *GraphTestSuite) TestQueryEntitlementPlans() { testCases := []struct { name string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context expectedResults int }{ @@ -154,7 +154,7 @@ func (suite *GraphTestSuite) TestMutationCreateEntitlementPlan() { testCases := []struct { name string request openlaneclient.CreateEntitlementPlanInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool expectedErr string @@ -274,7 +274,7 @@ func (suite *GraphTestSuite) TestMutationUpdateEntitlementPlan() { testCases := []struct { name string request openlaneclient.UpdateEntitlementPlanInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool expectedErr string @@ -362,7 +362,7 @@ func (suite *GraphTestSuite) TestMutationDeleteEntitlementPlan() { testCases := []struct { name string idToDelete string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool checkAccess bool diff --git a/internal/graphapi/entitlementplanfeature_test.go b/internal/graphapi/entitlementplanfeature_test.go index 1e30161a..2f38e93a 100644 --- a/internal/graphapi/entitlementplanfeature_test.go +++ b/internal/graphapi/entitlementplanfeature_test.go @@ -23,7 +23,7 @@ func (suite *GraphTestSuite) TestQueryEntitlementPlanFeature() { testCases := []struct { name string queryID string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context errorMsg string }{ @@ -101,7 +101,7 @@ func (suite *GraphTestSuite) TestQueryEntitlementPlanFeatures() { testCases := []struct { name string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context expectedResults int }{ @@ -160,7 +160,7 @@ func (suite *GraphTestSuite) TestMutationCreateEntitlementPlanFeature() { testCases := []struct { name string request openlaneclient.CreateEntitlementPlanFeatureInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool expectedErr string @@ -293,7 +293,7 @@ func (suite *GraphTestSuite) TestMutationUpdateEntitlementPlanFeature() { testCases := []struct { name string request openlaneclient.UpdateEntitlementPlanFeatureInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool expectedErr string @@ -385,7 +385,7 @@ func (suite *GraphTestSuite) TestMutationDeleteEntitlementPlanFeature() { testCases := []struct { name string idToDelete string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool checkAccess bool diff --git a/internal/graphapi/entity_test.go b/internal/graphapi/entity_test.go index 798b6539..1a49ef72 100644 --- a/internal/graphapi/entity_test.go +++ b/internal/graphapi/entity_test.go @@ -26,7 +26,7 @@ func (suite *GraphTestSuite) TestQueryEntity() { testCases := []struct { name string queryID string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool expected *ent.Entity @@ -108,7 +108,7 @@ func (suite *GraphTestSuite) TestQueryEntities() { testCases := []struct { name string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context expectedResults int }{ @@ -161,7 +161,7 @@ func (suite *GraphTestSuite) TestMutationCreateEntity() { testCases := []struct { name string request openlaneclient.CreateEntityInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool expectedErr string @@ -325,7 +325,7 @@ func (suite *GraphTestSuite) TestMutationUpdateEntity() { testCases := []struct { name string request openlaneclient.UpdateEntityInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool expectedErr string @@ -451,7 +451,7 @@ func (suite *GraphTestSuite) TestMutationDeleteEntity() { testCases := []struct { name string idToDelete string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool checkAccess bool diff --git a/internal/graphapi/entitytype_test.go b/internal/graphapi/entitytype_test.go index f44cf46b..5fa619ab 100644 --- a/internal/graphapi/entitytype_test.go +++ b/internal/graphapi/entitytype_test.go @@ -26,7 +26,7 @@ func (suite *GraphTestSuite) TestQueryEntityType() { testCases := []struct { name string queryID string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool expected *ent.EntityType @@ -108,7 +108,7 @@ func (suite *GraphTestSuite) TestQueryEntityTypes() { testCases := []struct { name string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context expectedResults int }{ @@ -161,7 +161,7 @@ func (suite *GraphTestSuite) TestMutationCreateEntityType() { testCases := []struct { name string request openlaneclient.CreateEntityTypeInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool expectedErr string @@ -250,7 +250,7 @@ func (suite *GraphTestSuite) TestMutationUpdateEntityType() { testCases := []struct { name string request openlaneclient.UpdateEntityTypeInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool expectedErr string @@ -331,7 +331,7 @@ func (suite *GraphTestSuite) TestMutationDeleteEntityType() { testCases := []struct { name string idToDelete string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool checkAccess bool diff --git a/internal/graphapi/feature_test.go b/internal/graphapi/feature_test.go index a9496935..5575d304 100644 --- a/internal/graphapi/feature_test.go +++ b/internal/graphapi/feature_test.go @@ -24,7 +24,7 @@ func (suite *GraphTestSuite) TestQueryFeature() { testCases := []struct { name string queryID string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context errorMsg string }{ @@ -100,7 +100,7 @@ func (suite *GraphTestSuite) TestQueryFeatures() { testCases := []struct { name string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context expectedResults int }{ @@ -153,7 +153,7 @@ func (suite *GraphTestSuite) TestMutationCreateFeature() { testCases := []struct { name string request openlaneclient.CreateFeatureInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool expectedErr string @@ -276,7 +276,7 @@ func (suite *GraphTestSuite) TestMutationUpdateFeature() { testCases := []struct { name string request openlaneclient.UpdateFeatureInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool expectedErr string @@ -368,7 +368,7 @@ func (suite *GraphTestSuite) TestMutationDeleteFeature() { testCases := []struct { name string idToDelete string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool checkAccess bool diff --git a/internal/graphapi/group_test.go b/internal/graphapi/group_test.go index 7db0481f..e3205188 100644 --- a/internal/graphapi/group_test.go +++ b/internal/graphapi/group_test.go @@ -30,7 +30,7 @@ func (suite *GraphTestSuite) TestQueryGroup() { testCases := []struct { name string queryID string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool expected *ent.Group @@ -280,7 +280,7 @@ func (suite *GraphTestSuite) TestMutationCreateGroup() { displayName string owner string settings *openlaneclient.CreateGroupSettingInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool list bool @@ -463,7 +463,7 @@ func (suite *GraphTestSuite) TestMutationUpdateGroup() { allowed bool updateInput openlaneclient.UpdateGroupInput expectedRes openlaneclient.UpdateGroup_UpdateGroup_Group - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context list bool errorMsg string @@ -644,7 +644,7 @@ func (suite *GraphTestSuite) TestMutationDeleteGroup() { testCases := []struct { name string groupID string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool errorMsg string diff --git a/internal/graphapi/groupmembers_test.go b/internal/graphapi/groupmembers_test.go index 48f39941..d6cecf46 100644 --- a/internal/graphapi/groupmembers_test.go +++ b/internal/graphapi/groupmembers_test.go @@ -35,7 +35,7 @@ func (suite *GraphTestSuite) TestQueryGroupMembers() { testCases := []struct { name string queryID string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool expected *ent.GroupMembership @@ -153,7 +153,7 @@ func (suite *GraphTestSuite) TestMutationCreateGroupMembers() { groupID string userID string role enums.Role - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool check bool @@ -332,7 +332,7 @@ func (suite *GraphTestSuite) TestMutationUpdateGroupMembers() { testCases := []struct { name string role enums.Role - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool check bool @@ -439,7 +439,7 @@ func (suite *GraphTestSuite) TestMutationDeleteGroupMembers() { testCases := []struct { name string idToDelete string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool checkAccess bool diff --git a/internal/graphapi/invite_test.go b/internal/graphapi/invite_test.go index fa9bd9d9..9a9f8803 100644 --- a/internal/graphapi/invite_test.go +++ b/internal/graphapi/invite_test.go @@ -27,7 +27,7 @@ func (suite *GraphTestSuite) TestQueryInvite() { testCases := []struct { name string queryID string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context shouldCheck bool wantErr bool @@ -106,7 +106,7 @@ func (suite *GraphTestSuite) TestMutationCreateInvite() { recipient string orgID string role enums.Role - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context accessAllowed bool skipMockCheck bool @@ -298,7 +298,7 @@ func (suite *GraphTestSuite) TestMutationDeleteInvite() { testCases := []struct { name string queryID string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context skipMockCheck bool allowed bool diff --git a/internal/graphapi/organization_test.go b/internal/graphapi/organization_test.go index fb4848c7..2e1d502e 100644 --- a/internal/graphapi/organization_test.go +++ b/internal/graphapi/organization_test.go @@ -35,7 +35,7 @@ func (suite *GraphTestSuite) TestQueryOrganization() { testCases := []struct { name string queryID string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context expected *ent.Organization orgMembersExpected int @@ -181,7 +181,7 @@ func (suite *GraphTestSuite) TestMutationCreateOrganization() { orgDescription string parentOrgID string settings *openlaneclient.CreateOrganizationSettingInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context expectedDefaultOrgUpdate bool errorMsg string @@ -407,7 +407,7 @@ func (suite *GraphTestSuite) TestMutationUpdateOrganization() { testCases := []struct { name string updateInput openlaneclient.UpdateOrganizationInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context expectedRes openlaneclient.UpdateOrganization_UpdateOrganization_Organization errorMsg string diff --git a/internal/graphapi/orgmembers_test.go b/internal/graphapi/orgmembers_test.go index 210925a4..0aa46607 100644 --- a/internal/graphapi/orgmembers_test.go +++ b/internal/graphapi/orgmembers_test.go @@ -36,7 +36,7 @@ func (suite *GraphTestSuite) TestQueryOrgMembers() { testCases := []struct { name string queryID string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context allowed bool expectedLen int diff --git a/internal/graphapi/subscriber_test.go b/internal/graphapi/subscriber_test.go index d83d735f..49327745 100644 --- a/internal/graphapi/subscriber_test.go +++ b/internal/graphapi/subscriber_test.go @@ -32,7 +32,7 @@ func (suite *GraphTestSuite) TestQuerySubscriber() { testCases := []struct { name string email string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context shouldCheck bool wantErr bool @@ -139,7 +139,7 @@ func (suite *GraphTestSuite) TestQuerySubscribers() { testCases := []struct { name string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context numExpected int check bool @@ -203,7 +203,7 @@ func (suite *GraphTestSuite) TestMutationCreateSubscriber() { name string email string ownerID string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context wantErr bool }{ @@ -291,7 +291,7 @@ func (suite *GraphTestSuite) TestUpdateSubscriber() { name string email string updateInput openlaneclient.UpdateSubscriberInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context shouldCheck bool wantErr bool @@ -399,7 +399,7 @@ func (suite *GraphTestSuite) TestDeleteSubscriber() { name string email string organizationID string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context wantErr bool }{ diff --git a/internal/graphapi/tfasetting_test.go b/internal/graphapi/tfasetting_test.go index 91bbcc86..d109c808 100644 --- a/internal/graphapi/tfasetting_test.go +++ b/internal/graphapi/tfasetting_test.go @@ -29,7 +29,7 @@ func (suite *GraphTestSuite) TestQueryTFASetting() { testCases := []struct { name string userID string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context errorMsg string }{ @@ -91,7 +91,7 @@ func (suite *GraphTestSuite) TestMutationCreateTFASetting() { name string userID string input openlaneclient.CreateTFASettingInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context errMsg string }{ @@ -180,7 +180,7 @@ func (suite *GraphTestSuite) TestMutationUpdateTFASetting() { testCases := []struct { name string input openlaneclient.UpdateTFASettingInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context errMsg string }{ diff --git a/internal/graphapi/tools_test.go b/internal/graphapi/tools_test.go index 254f57bc..4bcf2ea8 100644 --- a/internal/graphapi/tools_test.go +++ b/internal/graphapi/tools_test.go @@ -53,9 +53,9 @@ type GraphTestSuite struct { // client contains all the clients the test need to interact with type client struct { db *ent.Client - api *openlaneclient.OpenLaneClient - apiWithPAT *openlaneclient.OpenLaneClient - apiWithToken *openlaneclient.OpenLaneClient + api *openlaneclient.OpenlaneClient + apiWithPAT *openlaneclient.OpenlaneClient + apiWithToken *openlaneclient.OpenlaneClient fga *mock_fga.MockSdkClient } diff --git a/internal/graphapi/usersetting_test.go b/internal/graphapi/usersetting_test.go index 3475d681..3a944096 100644 --- a/internal/graphapi/usersetting_test.go +++ b/internal/graphapi/usersetting_test.go @@ -34,7 +34,7 @@ func (suite *GraphTestSuite) TestQueryUserSetting() { testCases := []struct { name string queryID string - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context expected *openlaneclient.GetUserSettings_UserSettings_Edges_Node errorMsg string @@ -152,7 +152,7 @@ func (suite *GraphTestSuite) TestMutationUpdateUserSetting() { testCases := []struct { name string updateInput openlaneclient.UpdateUserSettingInput - client *openlaneclient.OpenLaneClient + client *openlaneclient.OpenlaneClient ctx context.Context expectedRes openlaneclient.UpdateUserSetting_UpdateUserSetting_UserSetting allowed bool diff --git a/internal/httpserve/handlers/register.go b/internal/httpserve/handlers/register.go index 365062b7..39c2cb98 100644 --- a/internal/httpserve/handlers/register.go +++ b/internal/httpserve/handlers/register.go @@ -87,7 +87,7 @@ func (h *Handler) RegisterHandler(ctx echo.Context) error { Reply: rout.Reply{Success: true}, ID: meowuser.ID, Email: meowuser.Email, - Message: "Welcome to OpenLane!", + Message: "Welcome to Openlane!", Token: meowtoken.Token, } diff --git a/internal/httpserve/handlers/tools_test.go b/internal/httpserve/handlers/tools_test.go index 28daa82a..10312c30 100644 --- a/internal/httpserve/handlers/tools_test.go +++ b/internal/httpserve/handlers/tools_test.go @@ -49,7 +49,7 @@ type HandlerTestSuite struct { suite.Suite e *echo.Echo db *ent.Client - api *openlaneclient.OpenLaneClient + api *openlaneclient.OpenlaneClient h *handlers.Handler fga *mock_fga.MockSdkClient tf *testutils.TestFixture diff --git a/internal/httpserve/server/openapi.go b/internal/httpserve/server/openapi.go index 244f354d..31be4a8c 100644 --- a/internal/httpserve/server/openapi.go +++ b/internal/httpserve/server/openapi.go @@ -99,10 +99,10 @@ func NewOpenAPISpec() (*openapi3.T, error) { return &openapi3.T{ OpenAPI: "3.1.0", Info: &openapi3.Info{ - Title: "OpenLane OpenAPI 3.1.0 Specifications", + Title: "Openlane OpenAPI 3.1.0 Specifications", Version: "v1.0.0", Contact: &openapi3.Contact{ - Name: "OpenLane", + Name: "Openlane", Email: "support@theopenlane.io", URL: "https://theopenlane.io", }, diff --git a/internal/httpserve/server/server.go b/internal/httpserve/server/server.go index c2bcecc7..dd3f33fd 100644 --- a/internal/httpserve/server/server.go +++ b/internal/httpserve/server/server.go @@ -95,6 +95,8 @@ func (s *Server) StartEchoServer(ctx context.Context) error { s.logger.Infow("registered route", "route", r.Path(), "method", r.Method()) } + s.logger.Info(startBlock) + // if TLS is enabled, start new echo server with TLS if s.config.Settings.Server.TLS.Enabled { s.logger.Infow("starting in https mode") @@ -102,27 +104,16 @@ func (s *Server) StartEchoServer(ctx context.Context) error { return sc.StartTLS(srv.Echo, s.config.Settings.Server.TLS.CertFile, s.config.Settings.Server.TLS.CertKey) } - s.logger.Infow(startBlock) - // otherwise, start without TLS return sc.Start(srv.Echo) } var startBlock = ` -┌────────────────────────────────────────────────────────────────────────────────────┐ -│ │ -│ │ -│ │ -| ******* ** │ -| **/////** ****** /** │ -| ** //**/**///** ***** ******* /** ****** ******* ***** │ -| /** /**/** /** **///**//**///** /** //////** //**///** **///** │ -| /** /**/****** /******* /** /** /** ******* /** /**/******* │ -| //** ** /**/// /**//// /** /** /** **////** /** /**/**//// │ -| //******* /** //****** *** /** /********//******** *** /**//****** │ -| /////// // ////// /// // //////// //////// /// // ////// │ -│ │ -│ │ -│ │ -│ │ -└────────────────────────────────────────────────────────────────────────────────────┘` +________________________________________________________________ + + / +-----------__------__----__----__---/----__----__----__--------- + / ) / ) /___) / ) / / ) / ) /___) +________(___/___/___/_(___ _/___/_/___(___(_/___/_(___ _________ + +` diff --git a/pkg/coreclient/graphclient.go b/pkg/coreclient/graphclient.go index 784ef39c..6a2a8505 100644 --- a/pkg/coreclient/graphclient.go +++ b/pkg/coreclient/graphclient.go @@ -14,7 +14,7 @@ import ( "github.com/theopenlane/entx/history" ) -type OpenLaneGraphClient interface { +type OpenlaneGraphClient interface { CreateAPIToken(ctx context.Context, input CreateAPITokenInput, interceptors ...clientv2.RequestInterceptor) (*CreateAPIToken, error) UpdateAPIToken(ctx context.Context, updateAPITokenID string, input UpdateAPITokenInput, interceptors ...clientv2.RequestInterceptor) (*UpdateAPIToken, error) GetAllAPITokens(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllAPITokens, error) @@ -256,7 +256,7 @@ type Client struct { Client *clientv2.Client } -func NewClient(cli *http.Client, baseURL string, options *clientv2.Options, interceptors ...clientv2.RequestInterceptor) OpenLaneGraphClient { +func NewClient(cli *http.Client, baseURL string, options *clientv2.Options, interceptors ...clientv2.RequestInterceptor) OpenlaneGraphClient { return &Client{Client: clientv2.NewClient(cli, baseURL, options, interceptors...)} } diff --git a/pkg/events/soiree/README.md b/pkg/events/soiree/README.md index 651e8581..5508b7c3 100644 --- a/pkg/events/soiree/README.md +++ b/pkg/events/soiree/README.md @@ -326,7 +326,7 @@ func main() { } ``` -Listeners are now identified by a UUID vs. the standard ULID generated by The OpenLane. You can also create listeners with a similar naming convention as the topic so you can identify them more easily. Generally speaking, though: listeners are acting on the events immediately. This is an in-memory implementation so the most appropriate use of the goroutine pools are either writing to a persistent store immediately when the event occurs to perform other future actions if required, handling an event immediately based on a criteria (e.g. webhooks, outbound http methods) or other idempotent actions. +Listeners are now identified by a UUID vs. the standard ULID generated by Openlane. You can also create listeners with a similar naming convention as the topic so you can identify them more easily. Generally speaking, though: listeners are acting on the events immediately. This is an in-memory implementation so the most appropriate use of the goroutine pools are either writing to a persistent store immediately when the event occurs to perform other future actions if required, handling an event immediately based on a criteria (e.g. webhooks, outbound http methods) or other idempotent actions. ### Handling Panics diff --git a/pkg/gencmd/README.md b/pkg/gencmd/README.md index bd7eaa66..d3517539 100644 --- a/pkg/gencmd/README.md +++ b/pkg/gencmd/README.md @@ -1,6 +1,6 @@ # GenCMD -This package is used to generate the base CRUD operations for a cli command for the `OpenLaneClient` +This package is used to generate the base CRUD operations for a cli command for the `OpenlaneClient` ## Usage diff --git a/pkg/models/models.go b/pkg/models/models.go index 8a031eb5..3e3538b6 100644 --- a/pkg/models/models.go +++ b/pkg/models/models.go @@ -171,7 +171,7 @@ var ExampleRegisterSuccessResponse = RegisterReply{ Reply: rout.Reply{Success: true}, ID: "1234", Email: "", - Message: "Welcome to OpenLane!", + Message: "Welcome to Openlane!", Token: "", } diff --git a/pkg/openlaneclient/client.go b/pkg/openlaneclient/client.go index b8bc078f..b2ded958 100644 --- a/pkg/openlaneclient/client.go +++ b/pkg/openlaneclient/client.go @@ -21,10 +21,10 @@ const ( cookieExpiryMinutes = 10 * time.Minute ) -// OpenLaneClient wraps The OpenLane API client methods to form a single client interface -type OpenLaneClient struct { - OpenLaneRestClient - OpenLaneGraphClient +// OpenlaneClient wraps the Openlane API client methods to form a single client interface +type OpenlaneClient struct { + OpenlaneRestClient + OpenlaneGraphClient } // A Reauthenticator generates new access and refresh pair given a valid refresh token @@ -33,14 +33,14 @@ type Reauthenticator interface { } // NewWithDefaults creates a new API v1 client with default configuration -func NewWithDefaults(opts ...ClientOption) (*OpenLaneClient, error) { +func NewWithDefaults(opts ...ClientOption) (*OpenlaneClient, error) { config := NewDefaultConfig() return New(config, opts...) } // New creates a new API v1 client that implements the Client interface -func New(config Config, opts ...ClientOption) (*OpenLaneClient, error) { +func New(config Config, opts ...ClientOption) (*OpenlaneClient, error) { // configure rest client c, err := NewRestClient(config, opts...) if err != nil { @@ -58,7 +58,7 @@ func New(config Config, opts ...ClientOption) (*OpenLaneClient, error) { api.Config.Interceptors..., ) - return &OpenLaneClient{ + return &OpenlaneClient{ c, graphClient, }, nil @@ -94,15 +94,15 @@ type APIv1 struct { } // Config is the configuration for the APIv1 client -func (c *OpenLaneClient) Config() Config { - api := c.OpenLaneRestClient.(*APIv1) +func (c *OpenlaneClient) Config() Config { + api := c.OpenlaneRestClient.(*APIv1) return api.Config } // HTTPSlingClient is the http client for the APIv1 client -func (c *OpenLaneClient) HTTPSlingClient() *httpsling.Client { - api := c.OpenLaneRestClient.(*APIv1) +func (c *OpenlaneClient) HTTPSlingClient() *httpsling.Client { + api := c.OpenlaneRestClient.(*APIv1) return api.HTTPSlingClient } @@ -110,7 +110,7 @@ func (c *OpenLaneClient) HTTPSlingClient() *httpsling.Client { // AccessToken returns the access token cached on the client or an error if it is not // available. This method is primarily used for testing but can be used to fetch the // access token for debugging or inspection if necessary. -func (c *OpenLaneClient) AccessToken() (_ string, err error) { +func (c *OpenlaneClient) AccessToken() (_ string, err error) { var cookies []*http.Cookie if cookies, err = c.Cookies(); err != nil { @@ -129,7 +129,7 @@ func (c *OpenLaneClient) AccessToken() (_ string, err error) { // RefreshToken returns the refresh token cached on the client or an error if it is not // available. This method is primarily used for testing but can be used to fetch the // refresh token for debugging or inspection if necessary. -func (c *OpenLaneClient) RefreshToken() (_ string, err error) { +func (c *OpenlaneClient) RefreshToken() (_ string, err error) { var cookies []*http.Cookie if cookies, err = c.Cookies(); err != nil { @@ -147,7 +147,7 @@ func (c *OpenLaneClient) RefreshToken() (_ string, err error) { // SetAuthTokens is a helper function to set the access and refresh tokens on the // client cookie jar. -func (c *OpenLaneClient) SetAuthTokens(access, refresh string) error { +func (c *OpenlaneClient) SetAuthTokens(access, refresh string) error { if c.HTTPSlingClient().HTTPClient.Jar == nil { return ErrNoCookieJarSet } @@ -182,7 +182,7 @@ func (c *OpenLaneClient) SetAuthTokens(access, refresh string) error { } // ClearAuthTokens clears the access and refresh tokens on the client Jar. -func (c *OpenLaneClient) ClearAuthTokens() { +func (c *OpenlaneClient) ClearAuthTokens() { if cookies, err := c.Cookies(); err == nil { // Expire the access and refresh cookies. for _, cookie := range cookies { @@ -197,7 +197,7 @@ func (c *OpenLaneClient) ClearAuthTokens() { } // Returns the cookies set from the previous request(s) on the client Jar. -func (c *OpenLaneClient) Cookies() ([]*http.Cookie, error) { +func (c *OpenlaneClient) Cookies() ([]*http.Cookie, error) { if c.HTTPSlingClient().HTTPClient.Jar == nil { return nil, ErrNoCookieJarSet } @@ -208,7 +208,7 @@ func (c *OpenLaneClient) Cookies() ([]*http.Cookie, error) { } // GetSessionFromCookieJar parses the cookie jar for the session cookie -func (c *OpenLaneClient) GetSessionFromCookieJar() (sessionID string, err error) { +func (c *OpenlaneClient) GetSessionFromCookieJar() (sessionID string, err error) { cookies, err := c.Cookies() if err != nil { return "", err @@ -232,7 +232,7 @@ func (c *OpenLaneClient) GetSessionFromCookieJar() (sessionID string, err error) // GetAuthTokensFromCookieJar gets the access and refresh tokens from the cookie jar // and returns them as an oauth2.Token if they are set -func (c *OpenLaneClient) GetAuthTokensFromCookieJar() *oauth2.Token { +func (c *OpenlaneClient) GetAuthTokensFromCookieJar() *oauth2.Token { token := oauth2.Token{} if cookies, err := c.Cookies(); err == nil { diff --git a/pkg/openlaneclient/graphclient.go b/pkg/openlaneclient/graphclient.go index 97262287..b5781200 100644 --- a/pkg/openlaneclient/graphclient.go +++ b/pkg/openlaneclient/graphclient.go @@ -14,7 +14,7 @@ import ( "github.com/theopenlane/entx/history" ) -type OpenLaneGraphClient interface { +type OpenlaneGraphClient interface { CreateAPIToken(ctx context.Context, input CreateAPITokenInput, interceptors ...clientv2.RequestInterceptor) (*CreateAPIToken, error) UpdateAPIToken(ctx context.Context, updateAPITokenID string, input UpdateAPITokenInput, interceptors ...clientv2.RequestInterceptor) (*UpdateAPIToken, error) GetAllAPITokens(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*GetAllAPITokens, error) @@ -256,7 +256,7 @@ type Client struct { Client *clientv2.Client } -func NewClient(cli *http.Client, baseURL string, options *clientv2.Options, interceptors ...clientv2.RequestInterceptor) OpenLaneGraphClient { +func NewClient(cli *http.Client, baseURL string, options *clientv2.Options, interceptors ...clientv2.RequestInterceptor) OpenlaneGraphClient { return &Client{Client: clientv2.NewClient(cli, baseURL, options, interceptors...)} } diff --git a/pkg/openlaneclient/restclient.go b/pkg/openlaneclient/restclient.go index 78cb35b9..3adf77ea 100644 --- a/pkg/openlaneclient/restclient.go +++ b/pkg/openlaneclient/restclient.go @@ -7,8 +7,8 @@ import ( "github.com/theopenlane/core/pkg/models" ) -// OpenLaneRestClient is the interface that wraps the OpenLane API REST client methods -type OpenLaneRestClient interface { +// OpenlaneRestClient is the interface that wraps the openlane API REST client methods +type OpenlaneRestClient interface { // Register a new user with the API Register(context.Context, *models.RegisterRequest) (*models.RegisterReply, error) // Login to the API @@ -29,8 +29,8 @@ type OpenLaneRestClient interface { AcceptInvite(context.Context, *models.InviteRequest) (*models.InviteReply, error) } -// New creates a new API v1 client that implements the OpenLane Client interface -func NewRestClient(config Config, opts ...ClientOption) (_ OpenLaneRestClient, err error) { +// New creates a new API v1 client that implements the Openlane Client interface +func NewRestClient(config Config, opts ...ClientOption) (_ OpenlaneRestClient, err error) { c := &APIv1{ Config: config, } @@ -53,8 +53,8 @@ func NewRestClient(config Config, opts ...ClientOption) (_ OpenLaneRestClient, e return c, nil } -// Ensure the APIv1 implements the OpenLaneClient interface -var _ OpenLaneRestClient = &APIv1{} +// Ensure the APIv1 implements the OpenlaneClient interface +var _ OpenlaneRestClient = &APIv1{} // Register a new user with the API func (s *APIv1) Register(ctx context.Context, in *models.RegisterRequest) (out *models.RegisterReply, err error) { diff --git a/pkg/testutils/client.go b/pkg/testutils/client.go index 0e8285d5..b1bab8d4 100644 --- a/pkg/testutils/client.go +++ b/pkg/testutils/client.go @@ -31,8 +31,8 @@ func (l localRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) return w.Result(), nil } -// TestClient creates a new OpenLaneClient for testing -func TestClient(t *testing.T, c *generated.Client, opts ...openlaneclient.ClientOption) (*openlaneclient.OpenLaneClient, error) { +// TestClient creates a new OpenlaneClient for testing +func TestClient(t *testing.T, c *generated.Client, opts ...openlaneclient.ClientOption) (*openlaneclient.OpenlaneClient, error) { e := testEchoServer(t, c, false) // setup interceptors @@ -47,8 +47,8 @@ func TestClient(t *testing.T, c *generated.Client, opts ...openlaneclient.Client return openlaneclient.New(config, opts...) } -// TestClientWithAuth creates a new OpenLaneClient for testing that includes the auth middleware -func TestClientWithAuth(t *testing.T, c *generated.Client, opts ...openlaneclient.ClientOption) (*openlaneclient.OpenLaneClient, error) { +// TestClientWithAuth creates a new OpenlaneClient for testing that includes the auth middleware +func TestClientWithAuth(t *testing.T, c *generated.Client, opts ...openlaneclient.ClientOption) (*openlaneclient.OpenlaneClient, error) { e := testEchoServer(t, c, true) // setup interceptors