-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
125 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Error Handling | ||
|
||
1. AuthenticationError: | ||
- Purpose: Represents an error related to authentication. | ||
- Fields: | ||
- Message: Provides additional information about the error. | ||
|
||
2. APIError: | ||
- Purpose: Represents an error related to API calls. | ||
- Fields: | ||
- Message: Provides additional information about the error. | ||
- Code: Specifies the error code associated with the API error. | ||
|
||
3. SerializationError: | ||
- Purpose: Represents an error related to serialization. | ||
- Fields: | ||
- Message: Provides additional information about the error. | ||
|
||
4. SDKError: | ||
- Purpose: Represents a general SDK error. | ||
- Fields: | ||
- Message: Provides additional information about the error. | ||
|
||
5. RequestError: | ||
- Purpose: Represents an error related to making an authentication request. | ||
- Fields: | ||
- Message: Provides additional information about the error. | ||
|
||
Each error type has an associated Error() method that returns a formatted error message based on the error type and the provided error message. Additionally, there are corresponding New<ErrorType> functions that create and return an error instance with the specified error message. | ||
|
||
To use these error types, you can import the `error` package and utilize the respective New<ErrorType> functions to create specific error instances when necessary. | ||
|
||
Please note that it's important to handle and propagate errors appropriately in your code to ensure proper error handling and debugging. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
```go | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/onelogin/onelogin-go-sdk/internal/models" | ||
"github.com/onelogin/onelogin-go-sdk/pkg/onelogin" | ||
) | ||
|
||
func main() { | ||
var testSSO = models.SSOOpenId{ClientID: "1234567890"} | ||
var testConfig = models.ConfigurationOpenId{ | ||
RedirectURI: "https://example.com", | ||
LoginURL: "https://example.com/login", | ||
OidcApplicationType: 1, | ||
TokenEndpointAuthMethod: 1, | ||
AccessTokenExpirationMinutes: 60, | ||
RefreshTokenExpirationMinutes: 60, | ||
} | ||
|
||
var ( | ||
connetorid int32 = 108419 | ||
name string = "Bow wow wow yippy yo yippy yay" | ||
descr string = "Dog app" | ||
) | ||
|
||
client, err := onelogin.NewOneloginSDK() | ||
if err != nil { | ||
fmt.Println(err) | ||
} | ||
appQ := models.AppQuery{} | ||
applist, err := client.GetApps(&appQ) | ||
if err != nil { | ||
fmt.Println(err) | ||
} | ||
fmt.Printf("%+v\n", applist) | ||
|
||
appT, err := client.CreateApp(models.App{ | ||
ConnectorID: &connetorid, | ||
Name: &name, | ||
Description: &descr, | ||
SSO: testSSO, | ||
Configuration: testConfig, | ||
}) | ||
if err != nil { | ||
fmt.Println(err) | ||
} | ||
fmt.Printf("%+v\n", appT) | ||
} | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters