sty_shared

package
v2024.13.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 25 Imported by: 1

Documentation

Overview

Package sty_shared

This is the STY-Holdings shared services

NOTES:

None

COPYRIGHT & WARRANTY:

Copyright (c) 2022 STY-Holdings, inc
All rights reserved.

This software is the confidential and proprietary information of STY-Holdings, Inc.
Use is subject to license terms.

Unauthorized copying of this file, via any medium is strictly prohibited.

Proprietary and confidential

Written by <Replace with FULL_NAME> / syacko
STY-Holdings, Inc.
support@sty-holdings.com
www.sty-holdings.com

01-2024
USA

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Package sty_shared

This is the STY-Holdings shared services

NOTES:

None

COPYRIGHT & WARRANTY:

Copyright (c) 2022 STY-Holdings, inc
All rights reserved.

This software is the confidential and proprietary information of STY-Holdings, Inc.
Use is subject to license terms.

Unauthorized copying of this file, via any medium is strictly prohibited.

Proprietary and confidential

Written by Scott Yacko / syacko
STY-Holdings, Inc.
support@sty-holdings.com
www.sty-holdings.com

01-2024
USA

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Package sty-shared

This is the STY-Holdings shared services

NOTES:

None

COPYRIGHT & WARRANTY:

Copyright (c) 2022 STY-Holdings, inc
All rights reserved.

This software is the confidential and proprietary information of STY-Holdings, Inc.
Use is subject to license terms.

Unauthorized copying of this file, via any medium is strictly prohibited.

Proprietary and confidential

Written by <Replace with FULL_NAME> / syacko
STY-Holdings, Inc.
support@sty-holdings.com
www.sty-holdings.com

01-2024
USA

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetId added in v2024.5.8

func GetId(
	awsSettings AWSSettings,
	idToken string,
	region, userPoolId string,
) (
	identityId string,
	errorInfo pi.ErrorInfo,
)

GetId - will return AWS Identity Id needed to get temporary credentials. The variables 'region' and 'userPoolId' are optional and are only used when awsSettings values are empty. AWSSettings.styhCognitoIdentityInfo values are used by default. The parameter identityId is not the identity pool id.

Customer Messages: None
Errors: None
Verifications: None

func GetIdentityCredentials added in v2024.5.8

func GetIdentityCredentials(
	awsSettings AWSSettings,
	idToken string,
	identityId string,

) (
	identityIdCredentials aws.Credentials,
	errorInfo pi.ErrorInfo,
)

GetIdentityCredentials - will return AWS temporary credentials. The variables 'identityId' is option and are only used when sessionPtr values are empty. The variable 'identityIdCredentials' is only needed if sessionPtr is nil.

Customer Messages: None
Errors: None
Verifications: None

func GetParameters added in v2024.5.4

func GetParameters(
	awsSettings AWSSettings,
	idToken string,
	ssmParameters ...string,
) (
	parametersOutput awsSSM.GetParametersOutput,
	errorInfo pi.ErrorInfo,
)

GetParameters - will return System Manager parameters. WithDecryption is assumed.

Customer Messages: None
Errors: None
Verifications: None

func Login added in v2024.5.0

func Login(
	loginType, username string,
	password *string,
	awsSettings AWSSettings,
) (
	customerClientId string,
	accessToken string,
	idToken string,
	refreshToken string,
	errorInfo pi.ErrorInfo,
)

Login - authenticates the user with the provided login type, username, and password. It stores the tokens in the sessionPtr, along with the username and the clientId.

Customer Messages: None Errors: None Verifications: None

func NewCognitoLogin added in v2024.5.0

func NewCognitoLogin(
	username, userPoolId, clientId string,
	password *string,
	clientSecret *string,
) (
	*cognitoLogin,
	pi.ErrorInfo,
)

NewCognitoLogin - creates a CognitoLogin object. If you have a clientSecret, we use a pointer so there is only one place in memory (Security).

Customer Messages: None
Errors: None
Verifications: None

func ParseAWSJWT added in v2024.5.3

func ParseAWSJWT(
	awsSettings AWSSettings,
	tokenType, token string,
) (
	claims jwt.Claims,
	tokenValuePtr *jwt.Token,
	errorInfo pi.ErrorInfo,
)

ParseAWSJWT - will return the claims, if any, or an err if the AWS JWT is invalid. This will parse ID and Access tokens. Refresh token are not support and nothing is returned.

Customer Messages: None
Errors: None
Verifications: None

func PullCognitoUserInfo added in v2024.12.1

func PullCognitoUserInfo(
	awsSettings AWSSettings,
	username string,
) (
	userData map[string]interface{},
	errorInfo pi.ErrorInfo,
)

Types

type AWSSettings added in v2024.13.3

type AWSSettings struct {
	// contains filtered or unexported fields
}

func LoadAWSSettings added in v2024.13.3

func LoadAWSSettings(
	environment string,
) (
	awsSettings AWSSettings,
	errorInfo pi.ErrorInfo,
)

LoadAWSSettings - loads AWS settings based on the specified environment. It returns the loaded AWSSettings struct or an ErrorInfo if an error occurs.

Customer Messages: None Errors: ErrEnvironmentInvalid, ErrServiceFailedAWS Verifications: None

func LoadAccountInfo added in v2024.12.2

func LoadAccountInfo(
	awsAccountInfoFile string,
) (
	awsSettings AWSSettings,
	errorInfo pi.ErrorInfo,
)

type CognitoIdentityInfo added in v2024.13.0

type CognitoIdentityInfo struct {
	// contains filtered or unexported fields
}

type CognitoTokens added in v2024.5.2

type CognitoTokens struct {
	Access  string
	ID      string
	Refresh string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL